Messages in this thread Patch in this message | | | Date | Mon, 10 Jul 2000 18:42:22 +0200 (MET DST) | From | Mikael Pettersson <> | Subject | [PATCH] compile fix for parport_pc.c in test3-pre |
| |
drivers/parport/parport_pc.c doesn't compile in 2.4.0-test3-pre if CONFIG_PCI is off, since test3-pre's use of "-Werror" forces gcc to flag unused variables and functions as errors.
This patch removes this PCI-only data and code from parport_pc when CONFIG_PCI is off, reducing the size of parport_pc.o by 15% from 26872 to 22876 bytes on my old 486.
/Mikael
--- linux-2.4.0-test3-pre8/drivers/parport/parport_pc.c.~1~ Mon Jul 10 11:50:45 2000 +++ linux-2.4.0-test3-pre8/drivers/parport/parport_pc.c Mon Jul 10 12:40:03 2000 @@ -2175,6 +2175,8 @@ } +#ifdef CONFIG_PCI + /* Via support maintained by Jeff Garzik <jgarzik@mandrakesoft.com> */ static int __devinit sio_via_686a_probe (struct pci_dev *pdev) { @@ -2455,15 +2457,15 @@ return count == 0 ? -ENODEV : 0; } -static struct pci_driver parport_pc_pci_driver = { +static struct pci_driver parport_pc_pci_driver_struct = { name: "parport_pc", id_table: parport_pc_pci_tbl, probe: parport_pc_pci_probe, }; +#define parport_pc_pci_driver &parport_pc_pci_driver_struct static int __init parport_pc_init_superio (void) { -#ifdef CONFIG_PCI const struct pci_device_id *id; struct pci_dev *pdev; @@ -2474,11 +2476,17 @@ return parport_pc_superio_info[id->driver_data].probe (pdev); } -#endif /* CONFIG_PCI */ return 0; /* zero devices found */ } +#else /* !CONFIG_PCI */ + +#define parport_pc_pci_driver NULL +#define parport_pc_init_superio() 0 + +#endif /* CONFIG_PCI */ + /* This is called by parport_pc_find_nonpci_ports (in asm/parport.h) */ static int __init __attribute__((unused)) parport_pc_find_isa_ports (int autoirq, int autodma) @@ -2520,7 +2528,7 @@ /* ISA ports and whatever (see asm/parport.h). */ count += parport_pc_find_nonpci_ports (autoirq, autodma); - r = pci_register_driver (&parport_pc_pci_driver); + r = pci_register_driver (parport_pc_pci_driver); if (r > 0) count += r; @@ -2616,7 +2624,7 @@ struct parport *p = parport_enumerate(), *tmp; if (!user_specified) - pci_unregister_driver (&parport_pc_pci_driver); + pci_unregister_driver (parport_pc_pci_driver); while (p) { tmp = p->next; - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.rutgers.edu Please read the FAQ at http://www.tux.org/lkml/
| |