Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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 <ilpo.jarvinen@linux.intel.com>
Link: https://lore.kernel.org/r/20230915094336.13278-1-ilpo.jarvinen@linux.intel.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

authored by

Ilpo Järvinen and committed by
Greg Kroah-Hartman
a136abd7 4678de73

+7 -11
+7 -11
drivers/tty/serial/8250/8250_mid.c
··· 12 12 #include <linux/rational.h> 13 13 14 14 #include <linux/dma/hsu.h> 15 - #include <linux/8250_pci.h> 16 15 17 16 #include "8250.h" 18 17 ··· 31 32 struct mid8250; 32 33 33 34 struct mid8250_board { 34 - unsigned int flags; 35 35 unsigned long freq; 36 36 unsigned int base_baud; 37 + unsigned int bar; 37 38 int (*setup)(struct mid8250 *, struct uart_port *p); 38 39 void (*exit)(struct mid8250 *); 39 40 }; ··· 168 169 { 169 170 struct hsu_dma_chip *chip = &mid->dma_chip; 170 171 struct pci_dev *pdev = to_pci_dev(p->dev); 171 - unsigned int bar = FL_GET_BASE(mid->board->flags); 172 172 int ret; 173 173 174 174 pci_set_master(pdev); ··· 181 183 chip->dev = &pdev->dev; 182 184 chip->irq = pci_irq_vector(pdev, 0); 183 185 chip->regs = p->membase; 184 - chip->length = pci_resource_len(pdev, bar); 186 + chip->length = pci_resource_len(pdev, mid->board->bar); 185 187 chip->offset = DNV_DMA_CHAN_OFFSET; 186 188 187 189 /* Falling back to PIO mode if DMA probing fails */ ··· 289 291 { 290 292 struct uart_8250_port uart; 291 293 struct mid8250 *mid; 292 - unsigned int bar; 293 294 int ret; 294 295 295 296 ret = pcim_enable_device(pdev); ··· 300 303 return -ENOMEM; 301 304 302 305 mid->board = (struct mid8250_board *)id->driver_data; 303 - bar = FL_GET_BASE(mid->board->flags); 304 306 305 307 memset(&uart, 0, sizeof(struct uart_8250_port)); 306 308 ··· 312 316 uart.port.flags = UPF_SHARE_IRQ | UPF_FIXED_PORT | UPF_FIXED_TYPE; 313 317 uart.port.set_termios = mid8250_set_termios; 314 318 315 - uart.port.mapbase = pci_resource_start(pdev, bar); 316 - uart.port.membase = pcim_iomap(pdev, bar, 0); 319 + uart.port.mapbase = pci_resource_start(pdev, mid->board->bar); 320 + uart.port.membase = pcim_iomap(pdev, mid->board->bar, 0); 317 321 if (!uart.port.membase) 318 322 return -ENOMEM; 319 323 ··· 349 353 } 350 354 351 355 static const struct mid8250_board pnw_board = { 352 - .flags = FL_BASE0, 353 356 .freq = 50000000, 354 357 .base_baud = 115200, 358 + .bar = 0, 355 359 .setup = pnw_setup, 356 360 .exit = pnw_exit, 357 361 }; 358 362 359 363 static const struct mid8250_board tng_board = { 360 - .flags = FL_BASE0, 361 364 .freq = 38400000, 362 365 .base_baud = 1843200, 366 + .bar = 0, 363 367 .setup = tng_setup, 364 368 .exit = tng_exit, 365 369 }; 366 370 367 371 static const struct mid8250_board dnv_board = { 368 - .flags = FL_BASE1, 369 372 .freq = 133333333, 370 373 .base_baud = 115200, 374 + .bar = 1, 371 375 .setup = dnv_setup, 372 376 .exit = dnv_exit, 373 377 };