serial: 8250_mid: Remove 8250_pci usage
PATCH 1/2 serial: 8250_mid: Remove 8250_pci usage
8250_mid uses FL_*BASE* from linux/8250_pci.h and nothing else. The code can be simplified by directly defining BARs within the driver instead.
Signed-off-by Ilpo Järvinen <[email protected]>
--- drivers/tty/serial/8250/8250_mid.c | 18 +++++++----------- 1 file changed, 7 insertions(+), 11 deletions(-)
drivers/tty/serial/8250/8250_mid.c +7 -11
@@ -12,7 +12,6 @@#include <linux/rational.h> #include <linux/dma/hsu.h> -#include <linux/8250_pci.h> #include "8250.h"
@@ -32,9 +31,9 @@struct mid8250 ;struct mid8250_board { -unsigned int flags;unsigned long freq;unsigned int base_baud; +unsigned int bar;int (*setup)(struct mid8250 *,struct uart_port *p);void (*exit)(struct mid8250 *); };
@@ -169,7 +168,6 @@ static int dnv_setup(struct mid8250 *mid, struct uart_port *p) {struct hsu_dma_chip *chip = &mid->dma_chip;struct pci_dev *pdev =to_pci_dev (p->dev); -unsigned int bar =FL_GET_BASE (mid->board->flags);int ret;pci_set_master (pdev);
@@ -183,7 +181,7 @@ static int dnv_setup(struct mid8250 *mid, struct uart_port *p) chip->dev = &pdev->dev; chip->irq =pci_irq_vector (pdev,0 ); chip->regs = p->membase; - chip->length =pci_resource_len (pdev, bar); + chip->length =pci_resource_len (pdev, mid->board->bar); chip->offset =DNV_DMA_CHAN_OFFSET ;/* Falling back to PIO mode if DMA probing fails */
@@ -291,7 +289,6 @@ static int mid8250_probe(struct pci_dev *pdev, const struct pci_device_id *id) {struct uart_8250_port uart;struct mid8250 *mid; -unsigned int bar;int ret; ret =pcim_enable_device (pdev);
@@ -303,7 +300,6 @@ static int mid8250_probe(struct pci_dev *pdev, const struct pci_device_id *id)return -ENOMEM ; mid->board = (struct mid8250_board *)id->driver_data; - bar =FL_GET_BASE (mid->board->flags);memset (&uart,0 ,sizeof (struct uart_8250_port ));
@@ -316,8 +312,8 @@ static int mid8250_probe(struct pci_dev *pdev, const struct pci_device_id *id) uart.port.flags =UPF_SHARE_IRQ |UPF_FIXED_PORT |UPF_FIXED_TYPE ; uart.port.set_termios = mid8250_set_termios; - uart.port.mapbase =pci_resource_start (pdev, bar); - uart.port.membase =pcim_iomap (pdev, bar,0 ); + uart.port.mapbase =pci_resource_start (pdev, mid->board->bar); + uart.port.membase =pcim_iomap (pdev, mid->board->bar,0 );if (!uart.port.membase)return -ENOMEM ;
@@ -353,25 +349,25 @@ static void mid8250_remove(struct pci_dev *pdev) }static const struct mid8250_board pnw_board = { - .flags =FL_BASE0 , .freq =50000000 , .base_baud =115200 , + .bar =0 , .setup = pnw_setup, .exit = pnw_exit, };static const struct mid8250_board tng_board = { - .flags =FL_BASE0 , .freq =38400000 , .base_baud =1843200 , + .bar =0 , .setup = tng_setup, .exit = tng_exit, };static const struct mid8250_board dnv_board = { - .flags =FL_BASE1 , .freq =133333333 , .base_baud =115200 , + .bar =1 , .setup = dnv_setup, .exit = dnv_exit, };
Signature · 1 line
2.30.2
PATCH 2/2 tty: serial: 8250_exar: Does not use anything from 8250_pci
8250_exar includes linux/8250_pci.h and depends on SERIAL_8250_PCI. Neither is necessary so this patch removes the include and changes the depends on to SERIAL_8250 && PCI (taken from SERIAL_8250_PCI).
Signed-off-by Ilpo Järvinen <[email protected]>
---
Cc: Matthew Howell <[email protected]>
drivers/tty/serial/8250/8250_exar.c | 1 - drivers/tty/serial/8250/Kconfig | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-)
drivers/tty/serial/8250/8250_exar.c +0 -1
@@ -18,7 +18,6 @@#include <linux/slab.h> #include <linux/string.h> #include <linux/tty.h> -#include <linux/8250_pci.h> #include <linux/delay.h> #include <asm/byteorder.h>
drivers/tty/serial/8250/Kconfig +1 -1
@@ -148,7 +148,7 @@ config SERIAL_8250_PCI config SERIAL_8250_EXAR tristate "8250/16550 Exar/Commtech PCI/PCIe device support" - depends on SERIAL_8250_PCI + depends on SERIAL_8250 && PCI default SERIAL_8250 help This builds support for XR17C1xx, XR17V3xx and some Commtech
Signature · 1 line
2.30.2