]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
serial: port: Assign ->iotype correctly when ->iobase is set
authorAndy Shevchenko <andriy.shevchenko@linux.intel.com>
Fri, 24 Jan 2025 16:10:46 +0000 (18:10 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 21 Feb 2025 13:01:35 +0000 (14:01 +0100)
commit29c04864fba2ff891485ba1332907322a32161ea
tree9fa4697a78e30f31a96d1491f84601fae37c7a90
parentedd408444537ecdf89d719acf331cebc0c5b1351
serial: port: Assign ->iotype correctly when ->iobase is set

commit 166ac2bba167d575e7146beaa66093bc7c072f43 upstream.

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: 1117a6fdc7c1 ("serial: 8250_of: Switch to use uart_read_port_properties()")
Fixes: e894b6005dce ("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>
drivers/tty/serial/serial_port.c