serial: 8250_platform: Remove unneeded ->iotype assignment
If ->iobase is set the default will be UPIO_PORT for ->iotype after the uart_read_and_validate_port_properties() call. Hence no need to assign that explicitly. Otherwise it will be UPIO_MEM. Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Link: https://lore.kernel.org/r/20250124161530.398361-6-andriy.shevchenko@linux.intel.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
parent
fe310f7532
commit
34bbb5d513
1 changed files with 0 additions and 9 deletions
|
@ -112,7 +112,6 @@ static int serial8250_probe_acpi(struct platform_device *pdev)
|
||||||
struct device *dev = &pdev->dev;
|
struct device *dev = &pdev->dev;
|
||||||
struct uart_8250_port uart = { };
|
struct uart_8250_port uart = { };
|
||||||
struct resource *regs;
|
struct resource *regs;
|
||||||
unsigned char iotype;
|
|
||||||
int ret, line;
|
int ret, line;
|
||||||
|
|
||||||
regs = platform_get_mem_or_io(pdev, 0);
|
regs = platform_get_mem_or_io(pdev, 0);
|
||||||
|
@ -122,13 +121,11 @@ static int serial8250_probe_acpi(struct platform_device *pdev)
|
||||||
switch (resource_type(regs)) {
|
switch (resource_type(regs)) {
|
||||||
case IORESOURCE_IO:
|
case IORESOURCE_IO:
|
||||||
uart.port.iobase = regs->start;
|
uart.port.iobase = regs->start;
|
||||||
iotype = UPIO_PORT;
|
|
||||||
break;
|
break;
|
||||||
case IORESOURCE_MEM:
|
case IORESOURCE_MEM:
|
||||||
uart.port.mapbase = regs->start;
|
uart.port.mapbase = regs->start;
|
||||||
uart.port.mapsize = resource_size(regs);
|
uart.port.mapsize = resource_size(regs);
|
||||||
uart.port.flags = UPF_IOREMAP;
|
uart.port.flags = UPF_IOREMAP;
|
||||||
iotype = UPIO_MEM;
|
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
|
@ -147,12 +144,6 @@ static int serial8250_probe_acpi(struct platform_device *pdev)
|
||||||
if (ret)
|
if (ret)
|
||||||
return ret;
|
return ret;
|
||||||
|
|
||||||
/*
|
|
||||||
* The previous call may not set iotype correctly when reg-io-width
|
|
||||||
* property is absent and it doesn't support IO port resource.
|
|
||||||
*/
|
|
||||||
uart.port.iotype = iotype;
|
|
||||||
|
|
||||||
line = serial8250_register_8250_port(&uart);
|
line = serial8250_register_8250_port(&uart);
|
||||||
if (line < 0)
|
if (line < 0)
|
||||||
return line;
|
return line;
|
||||||
|
|
Loading…
Add table
Reference in a new issue