Skip to content

Commit 0f3fd9c

Browse files
andy-shevgregkh
authored andcommitted
serial: 8250_pnp: 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 34bbb5d commit 0f3fd9c

File tree

1 file changed

+0
-10
lines changed

1 file changed

+0
-10
lines changed

drivers/tty/serial/8250/8250_pnp.c

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -436,7 +436,6 @@ serial_pnp_probe(struct pnp_dev *dev, const struct pnp_device_id *dev_id)
436436
{
437437
struct uart_8250_port uart, *port;
438438
int ret, flags = dev_id->driver_data;
439-
unsigned char iotype;
440439
long line;
441440

442441
if (flags & UNKNOWN_DEV) {
@@ -448,14 +447,11 @@ serial_pnp_probe(struct pnp_dev *dev, const struct pnp_device_id *dev_id)
448447
memset(&uart, 0, sizeof(uart));
449448
if ((flags & CIR_PORT) && pnp_port_valid(dev, 2)) {
450449
uart.port.iobase = pnp_port_start(dev, 2);
451-
iotype = UPIO_PORT;
452450
} else if (pnp_port_valid(dev, 0)) {
453451
uart.port.iobase = pnp_port_start(dev, 0);
454-
iotype = UPIO_PORT;
455452
} else if (pnp_mem_valid(dev, 0)) {
456453
uart.port.mapbase = pnp_mem_start(dev, 0);
457454
uart.port.mapsize = pnp_mem_len(dev, 0);
458-
iotype = UPIO_MEM;
459455
uart.port.flags = UPF_IOREMAP;
460456
} else
461457
return -ENODEV;
@@ -471,12 +467,6 @@ serial_pnp_probe(struct pnp_dev *dev, const struct pnp_device_id *dev_id)
471467
if (ret)
472468
return ret;
473469

474-
/*
475-
* The previous call may not set iotype correctly when reg-io-width
476-
* property is absent and it doesn't support IO port resource.
477-
*/
478-
uart.port.iotype = iotype;
479-
480470
if (flags & CIR_PORT) {
481471
uart.port.flags |= UPF_FIXED_PORT | UPF_FIXED_TYPE;
482472
uart.port.type = PORT_8250_CIR;

0 commit comments

Comments
 (0)