serial: port: Assign ->iotype correctly when ->iobase is set
Currently the ->iotype is always assigned to the UPIO_MEM when the respective property is not found. However, this will not support the cases when user wants to have UPIO_PORT to be set or preserved. Support this scenario by checking ->iobase value and default the ->iotype respectively. Fixes:1117a6fdc7
("serial: 8250_of: Switch to use uart_read_port_properties()") Fixes:e894b6005d
("serial: port: Introduce a common helper to read properties") Cc: stable <stable@kernel.org> Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Link: https://lore.kernel.org/r/20250124161530.398361-2-andriy.shevchenko@linux.intel.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
parent
e8ed246ded
commit
166ac2bba1
1 changed files with 2 additions and 1 deletions
|
@ -173,6 +173,7 @@ EXPORT_SYMBOL(uart_remove_one_port);
|
||||||
* The caller is responsible to initialize the following fields of the @port
|
* The caller is responsible to initialize the following fields of the @port
|
||||||
* ->dev (must be valid)
|
* ->dev (must be valid)
|
||||||
* ->flags
|
* ->flags
|
||||||
|
* ->iobase
|
||||||
* ->mapbase
|
* ->mapbase
|
||||||
* ->mapsize
|
* ->mapsize
|
||||||
* ->regshift (if @use_defaults is false)
|
* ->regshift (if @use_defaults is false)
|
||||||
|
@ -214,7 +215,7 @@ static int __uart_read_properties(struct uart_port *port, bool use_defaults)
|
||||||
/* Read the registers I/O access type (default: MMIO 8-bit) */
|
/* Read the registers I/O access type (default: MMIO 8-bit) */
|
||||||
ret = device_property_read_u32(dev, "reg-io-width", &value);
|
ret = device_property_read_u32(dev, "reg-io-width", &value);
|
||||||
if (ret) {
|
if (ret) {
|
||||||
port->iotype = UPIO_MEM;
|
port->iotype = port->iobase ? UPIO_PORT : UPIO_MEM;
|
||||||
} else {
|
} else {
|
||||||
switch (value) {
|
switch (value) {
|
||||||
case 1:
|
case 1:
|
||||||
|
|
Loading…
Add table
Reference in a new issue