Skip to content

Commit 34bbb5d

Browse files
andy-shevgregkh
authored andcommitted
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 <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Greg Kroah-Hartman <[email protected]>
1 parent fe310f7 commit 34bbb5d

File tree

1 file changed

+0
-9
lines changed

1 file changed

+0
-9
lines changed

drivers/tty/serial/8250/8250_platform.c

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,6 @@ static int serial8250_probe_acpi(struct platform_device *pdev)
112112
struct device *dev = &pdev->dev;
113113
struct uart_8250_port uart = { };
114114
struct resource *regs;
115-
unsigned char iotype;
116115
int ret, line;
117116

118117
regs = platform_get_mem_or_io(pdev, 0);
@@ -122,13 +121,11 @@ static int serial8250_probe_acpi(struct platform_device *pdev)
122121
switch (resource_type(regs)) {
123122
case IORESOURCE_IO:
124123
uart.port.iobase = regs->start;
125-
iotype = UPIO_PORT;
126124
break;
127125
case IORESOURCE_MEM:
128126
uart.port.mapbase = regs->start;
129127
uart.port.mapsize = resource_size(regs);
130128
uart.port.flags = UPF_IOREMAP;
131-
iotype = UPIO_MEM;
132129
break;
133130
default:
134131
return -EINVAL;
@@ -147,12 +144,6 @@ static int serial8250_probe_acpi(struct platform_device *pdev)
147144
if (ret)
148145
return ret;
149146

150-
/*
151-
* The previous call may not set iotype correctly when reg-io-width
152-
* property is absent and it doesn't support IO port resource.
153-
*/
154-
uart.port.iotype = iotype;
155-
156147
line = serial8250_register_8250_port(&uart);
157148
if (line < 0)
158149
return line;

0 commit comments

Comments
 (0)