Commit 6e1d6fb8 authored by Russell King's avatar Russell King

[SERIAL] Remove UPF_RESOURCES

The UPF_RESOURCES flag was added to the serial layer to cater for
the idiosyncrasies of the PCMCIA layer, where the PCMCIA core code
handles the claiming of busy resources.

However, the PCMCIA core has progressed, and now does not claim busy
resources - IOW, it now behaves just like any other bus driver,
where resources are allocated non-busy and its up to the drivers to
mark their regions busy using request_region / request_mem_region.

The effect of this is that the UPF_RESOURCES hack in the serial
layer is now redundant, and can now be removed - 8250 devices
should now always use request_region / request_mem_region
unconditionally.

Signed-off-by: Russell King.
parent deaeb66a
...@@ -1687,8 +1687,6 @@ static void serial8250_release_port(struct uart_port *port) ...@@ -1687,8 +1687,6 @@ static void serial8250_release_port(struct uart_port *port)
struct uart_8250_port *up = (struct uart_8250_port *)port; struct uart_8250_port *up = (struct uart_8250_port *)port;
unsigned long start, offset = 0, size = 0; unsigned long start, offset = 0, size = 0;
if (!(up->port.flags & UPF_RESOURCES))
return;
if (up->port.type == PORT_RSA) { if (up->port.type == PORT_RSA) {
offset = UART_RSA_BASE << up->port.regshift; offset = UART_RSA_BASE << up->port.regshift;
size = 8; size = 8;
...@@ -1733,16 +1731,14 @@ static int serial8250_request_port(struct uart_port *port) ...@@ -1733,16 +1731,14 @@ static int serial8250_request_port(struct uart_port *port)
struct resource *res = NULL, *res_rsa = NULL; struct resource *res = NULL, *res_rsa = NULL;
int ret = 0; int ret = 0;
if (up->port.flags & UPF_RESOURCES) { if (up->port.type == PORT_RSA) {
if (up->port.type == PORT_RSA) { ret = serial8250_request_rsa_resource(up, &res_rsa);
ret = serial8250_request_rsa_resource(up, &res_rsa); if (ret < 0)
if (ret < 0) return ret;
return ret;
}
ret = serial8250_request_std_resource(up, &res);
} }
ret = serial8250_request_std_resource(up, &res);
/* /*
* If we have a mapbase, then request that as well. * If we have a mapbase, then request that as well.
*/ */
...@@ -1782,17 +1778,13 @@ static void serial8250_config_port(struct uart_port *port, int flags) ...@@ -1782,17 +1778,13 @@ static void serial8250_config_port(struct uart_port *port, int flags)
* Find the region that we can probe for. This in turn * Find the region that we can probe for. This in turn
* tells us whether we can probe for the type of port. * tells us whether we can probe for the type of port.
*/ */
if (up->port.flags & UPF_RESOURCES) { ret = serial8250_request_std_resource(up, &res_std);
ret = serial8250_request_std_resource(up, &res_std); if (ret < 0)
if (ret < 0) return;
return;
ret = serial8250_request_rsa_resource(up, &res_rsa); ret = serial8250_request_rsa_resource(up, &res_rsa);
if (ret < 0) if (ret < 0)
probeflags &= ~PROBE_RSA;
} else {
probeflags &= ~PROBE_RSA; probeflags &= ~PROBE_RSA;
}
if (flags & UART_CONFIG_TYPE) if (flags & UART_CONFIG_TYPE)
autoconfig(up, probeflags); autoconfig(up, probeflags);
...@@ -1867,8 +1859,7 @@ static void __init serial8250_isa_init_ports(void) ...@@ -1867,8 +1859,7 @@ static void __init serial8250_isa_init_ports(void)
up->port.iobase = old_serial_port[i].port; up->port.iobase = old_serial_port[i].port;
up->port.irq = irq_canonicalize(old_serial_port[i].irq); up->port.irq = irq_canonicalize(old_serial_port[i].irq);
up->port.uartclk = old_serial_port[i].baud_base * 16; up->port.uartclk = old_serial_port[i].baud_base * 16;
up->port.flags = old_serial_port[i].flags | up->port.flags = old_serial_port[i].flags;
UPF_RESOURCES;
up->port.hub6 = old_serial_port[i].hub6; up->port.hub6 = old_serial_port[i].hub6;
up->port.membase = old_serial_port[i].iomem_base; up->port.membase = old_serial_port[i].iomem_base;
up->port.iotype = old_serial_port[i].io_type; up->port.iotype = old_serial_port[i].io_type;
......
...@@ -43,8 +43,7 @@ serial_register_onedev(unsigned long baddr, void *vaddr, int irq, unsigned int b ...@@ -43,8 +43,7 @@ serial_register_onedev(unsigned long baddr, void *vaddr, int irq, unsigned int b
memset(&req, 0, sizeof(req)); memset(&req, 0, sizeof(req));
req.irq = irq; req.irq = irq;
req.flags = UPF_AUTOPROBE | UPF_RESOURCES | req.flags = UPF_AUTOPROBE | UPF_SHARE_IRQ;
UPF_SHARE_IRQ;
req.baud_base = baud_base; req.baud_base = baud_base;
req.io_type = UPIO_MEM; req.io_type = UPIO_MEM;
req.iomem_base = vaddr; req.iomem_base = vaddr;
......
...@@ -123,7 +123,7 @@ static int acpi_serial_add(struct acpi_device *device) ...@@ -123,7 +123,7 @@ static int acpi_serial_add(struct acpi_device *device)
} }
serial_req.baud_base = BASE_BAUD; serial_req.baud_base = BASE_BAUD;
serial_req.flags = UPF_SKIP_TEST | UPF_BOOT_AUTOCONF | UPF_RESOURCES; serial_req.flags = UPF_SKIP_TEST | UPF_BOOT_AUTOCONF;
priv->line = register_serial(&serial_req); priv->line = register_serial(&serial_req);
if (priv->line < 0) { if (priv->line < 0) {
......
...@@ -1665,7 +1665,7 @@ pciserial_init_one(struct pci_dev *dev, const struct pci_device_id *ent) ...@@ -1665,7 +1665,7 @@ pciserial_init_one(struct pci_dev *dev, const struct pci_device_id *ent)
for (i = 0; i < nr_ports; i++) { for (i = 0; i < nr_ports; i++) {
memset(&serial_req, 0, sizeof(serial_req)); memset(&serial_req, 0, sizeof(serial_req));
serial_req.flags = UPF_SKIP_TEST | UPF_AUTOPROBE | serial_req.flags = UPF_SKIP_TEST | UPF_AUTOPROBE |
UPF_RESOURCES | UPF_SHARE_IRQ; UPF_SHARE_IRQ;
serial_req.baud_base = board->base_baud; serial_req.baud_base = board->base_baud;
serial_req.irq = get_pci_irq(dev, board, i); serial_req.irq = get_pci_irq(dev, board, i);
if (quirk->setup(dev, board, &serial_req, i)) if (quirk->setup(dev, board, &serial_req, i))
......
...@@ -413,7 +413,7 @@ serial_pnp_probe(struct pnp_dev * dev, const struct pnp_device_id *dev_id) ...@@ -413,7 +413,7 @@ serial_pnp_probe(struct pnp_dev * dev, const struct pnp_device_id *dev_id)
serial_req.port, serial_req.irq, serial_req.io_type); serial_req.port, serial_req.irq, serial_req.io_type);
#endif #endif
serial_req.flags = UPF_SKIP_TEST | UPF_AUTOPROBE | UPF_RESOURCES; serial_req.flags = UPF_SKIP_TEST | UPF_AUTOPROBE;
serial_req.baud_base = 115200; serial_req.baud_base = 115200;
line = register_serial(&serial_req); line = register_serial(&serial_req);
......
...@@ -969,9 +969,7 @@ static int serial8250_request_port(struct uart_port *port) ...@@ -969,9 +969,7 @@ static int serial8250_request_port(struct uart_port *port)
struct resource *res = NULL, *res_rsa = NULL; struct resource *res = NULL, *res_rsa = NULL;
int ret = 0; int ret = 0;
if (up->port.flags & UPF_RESOURCES) { ret = serial8250_request_std_resource(up, &res);
ret = serial8250_request_std_resource(up, &res);
}
/* /*
* If we have a mapbase, then request that as well. * If we have a mapbase, then request that as well.
...@@ -1072,8 +1070,7 @@ static void __init serial8250_isa_init_ports(void) ...@@ -1072,8 +1070,7 @@ static void __init serial8250_isa_init_ports(void)
up->port.iobase = old_serial_port[i].port; up->port.iobase = old_serial_port[i].port;
up->port.irq = old_serial_port[i].irq; up->port.irq = old_serial_port[i].irq;
up->port.uartclk = get_au1x00_uart_baud_base(); up->port.uartclk = get_au1x00_uart_baud_base();
up->port.flags = old_serial_port[i].flags | up->port.flags = old_serial_port[i].flags;
UPF_RESOURCES;
up->port.hub6 = old_serial_port[i].hub6; up->port.hub6 = old_serial_port[i].hub6;
up->port.membase = old_serial_port[i].iomem_base; up->port.membase = old_serial_port[i].iomem_base;
up->port.iotype = old_serial_port[i].io_type; up->port.iotype = old_serial_port[i].io_type;
......
...@@ -24,7 +24,7 @@ static int __init serial_bast_register(unsigned long port, unsigned int irq) ...@@ -24,7 +24,7 @@ static int __init serial_bast_register(unsigned long port, unsigned int irq)
printk("BAST: SuperIO serial (%08lx,%d)\n", port, irq); printk("BAST: SuperIO serial (%08lx,%d)\n", port, irq);
#endif #endif
serial_req.flags = UPF_AUTOPROBE | UPF_RESOURCES | UPF_SHARE_IRQ; serial_req.flags = UPF_AUTOPROBE | UPF_SHARE_IRQ;
serial_req.baud_base = BASE_BAUD; serial_req.baud_base = BASE_BAUD;
serial_req.irq = irq; serial_req.irq = irq;
serial_req.io_type = UPIO_MEM; serial_req.io_type = UPIO_MEM;
......
...@@ -205,7 +205,6 @@ struct uart_port { ...@@ -205,7 +205,6 @@ struct uart_port {
#define UPF_CONS_FLOW (1 << 23) #define UPF_CONS_FLOW (1 << 23)
#define UPF_SHARE_IRQ (1 << 24) #define UPF_SHARE_IRQ (1 << 24)
#define UPF_BOOT_AUTOCONF (1 << 28) #define UPF_BOOT_AUTOCONF (1 << 28)
#define UPF_RESOURCES (1 << 30)
#define UPF_IOREMAP (1 << 31) #define UPF_IOREMAP (1 << 31)
#define UPF_CHANGE_MASK (0x17fff) #define UPF_CHANGE_MASK (0x17fff)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment