net: hp100: remove unnecessary #ifdefs
commit 747a11279a442b913a57bf38934879babab3b58b upstream. Building the hp100 ethernet driver causes warnings when both the PCI and EISA drivers are disabled: ethernet/hp/hp100.c: In function 'hp100_module_init': ethernet/hp/hp100.c:3047:2: warning: label 'out3' defined but not used [-Wunused-label] ethernet/hp/hp100.c: At top level: ethernet/hp/hp100.c:2828:13: warning: 'cleanup_dev' defined but not used [-Wunused-function] We can easily avoid the warnings and make the driver look slightly nicer by removing the #ifdefs that check for the CONFIG_PCI and CONFIG_EISA, as all the registration functions are designed to have no effect when the buses are disabled. Signed-off-by: Arnd Bergmann <arnd@arndb.de> Signed-off-by: David S. Miller <davem@davemloft.net> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
parent
4b88c89bc2
commit
d9a4d80bb3
1 changed files with 0 additions and 18 deletions
|
@ -194,7 +194,6 @@ static const char *hp100_isa_tbl[] = {
|
||||||
};
|
};
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef CONFIG_EISA
|
|
||||||
static struct eisa_device_id hp100_eisa_tbl[] = {
|
static struct eisa_device_id hp100_eisa_tbl[] = {
|
||||||
{ "HWPF180" }, /* HP J2577 rev A */
|
{ "HWPF180" }, /* HP J2577 rev A */
|
||||||
{ "HWP1920" }, /* HP 27248B */
|
{ "HWP1920" }, /* HP 27248B */
|
||||||
|
@ -205,9 +204,7 @@ static struct eisa_device_id hp100_eisa_tbl[] = {
|
||||||
{ "" } /* Mandatory final entry ! */
|
{ "" } /* Mandatory final entry ! */
|
||||||
};
|
};
|
||||||
MODULE_DEVICE_TABLE(eisa, hp100_eisa_tbl);
|
MODULE_DEVICE_TABLE(eisa, hp100_eisa_tbl);
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifdef CONFIG_PCI
|
|
||||||
static const struct pci_device_id hp100_pci_tbl[] = {
|
static const struct pci_device_id hp100_pci_tbl[] = {
|
||||||
{PCI_VENDOR_ID_HP, PCI_DEVICE_ID_HP_J2585A, PCI_ANY_ID, PCI_ANY_ID,},
|
{PCI_VENDOR_ID_HP, PCI_DEVICE_ID_HP_J2585A, PCI_ANY_ID, PCI_ANY_ID,},
|
||||||
{PCI_VENDOR_ID_HP, PCI_DEVICE_ID_HP_J2585B, PCI_ANY_ID, PCI_ANY_ID,},
|
{PCI_VENDOR_ID_HP, PCI_DEVICE_ID_HP_J2585B, PCI_ANY_ID, PCI_ANY_ID,},
|
||||||
|
@ -219,7 +216,6 @@ static const struct pci_device_id hp100_pci_tbl[] = {
|
||||||
{} /* Terminating entry */
|
{} /* Terminating entry */
|
||||||
};
|
};
|
||||||
MODULE_DEVICE_TABLE(pci, hp100_pci_tbl);
|
MODULE_DEVICE_TABLE(pci, hp100_pci_tbl);
|
||||||
#endif
|
|
||||||
|
|
||||||
static int hp100_rx_ratio = HP100_DEFAULT_RX_RATIO;
|
static int hp100_rx_ratio = HP100_DEFAULT_RX_RATIO;
|
||||||
static int hp100_priority_tx = HP100_DEFAULT_PRIORITY_TX;
|
static int hp100_priority_tx = HP100_DEFAULT_PRIORITY_TX;
|
||||||
|
@ -2842,7 +2838,6 @@ static void cleanup_dev(struct net_device *d)
|
||||||
free_netdev(d);
|
free_netdev(d);
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef CONFIG_EISA
|
|
||||||
static int hp100_eisa_probe(struct device *gendev)
|
static int hp100_eisa_probe(struct device *gendev)
|
||||||
{
|
{
|
||||||
struct net_device *dev = alloc_etherdev(sizeof(struct hp100_private));
|
struct net_device *dev = alloc_etherdev(sizeof(struct hp100_private));
|
||||||
|
@ -2884,9 +2879,7 @@ static struct eisa_driver hp100_eisa_driver = {
|
||||||
.remove = hp100_eisa_remove,
|
.remove = hp100_eisa_remove,
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifdef CONFIG_PCI
|
|
||||||
static int hp100_pci_probe(struct pci_dev *pdev,
|
static int hp100_pci_probe(struct pci_dev *pdev,
|
||||||
const struct pci_device_id *ent)
|
const struct pci_device_id *ent)
|
||||||
{
|
{
|
||||||
|
@ -2955,7 +2948,6 @@ static struct pci_driver hp100_pci_driver = {
|
||||||
.probe = hp100_pci_probe,
|
.probe = hp100_pci_probe,
|
||||||
.remove = hp100_pci_remove,
|
.remove = hp100_pci_remove,
|
||||||
};
|
};
|
||||||
#endif
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* module section
|
* module section
|
||||||
|
@ -3032,23 +3024,17 @@ static int __init hp100_module_init(void)
|
||||||
err = hp100_isa_init();
|
err = hp100_isa_init();
|
||||||
if (err && err != -ENODEV)
|
if (err && err != -ENODEV)
|
||||||
goto out;
|
goto out;
|
||||||
#ifdef CONFIG_EISA
|
|
||||||
err = eisa_driver_register(&hp100_eisa_driver);
|
err = eisa_driver_register(&hp100_eisa_driver);
|
||||||
if (err && err != -ENODEV)
|
if (err && err != -ENODEV)
|
||||||
goto out2;
|
goto out2;
|
||||||
#endif
|
|
||||||
#ifdef CONFIG_PCI
|
|
||||||
err = pci_register_driver(&hp100_pci_driver);
|
err = pci_register_driver(&hp100_pci_driver);
|
||||||
if (err && err != -ENODEV)
|
if (err && err != -ENODEV)
|
||||||
goto out3;
|
goto out3;
|
||||||
#endif
|
|
||||||
out:
|
out:
|
||||||
return err;
|
return err;
|
||||||
out3:
|
out3:
|
||||||
#ifdef CONFIG_EISA
|
|
||||||
eisa_driver_unregister (&hp100_eisa_driver);
|
eisa_driver_unregister (&hp100_eisa_driver);
|
||||||
out2:
|
out2:
|
||||||
#endif
|
|
||||||
hp100_isa_cleanup();
|
hp100_isa_cleanup();
|
||||||
goto out;
|
goto out;
|
||||||
}
|
}
|
||||||
|
@ -3057,12 +3043,8 @@ static int __init hp100_module_init(void)
|
||||||
static void __exit hp100_module_exit(void)
|
static void __exit hp100_module_exit(void)
|
||||||
{
|
{
|
||||||
hp100_isa_cleanup();
|
hp100_isa_cleanup();
|
||||||
#ifdef CONFIG_EISA
|
|
||||||
eisa_driver_unregister (&hp100_eisa_driver);
|
eisa_driver_unregister (&hp100_eisa_driver);
|
||||||
#endif
|
|
||||||
#ifdef CONFIG_PCI
|
|
||||||
pci_unregister_driver (&hp100_pci_driver);
|
pci_unregister_driver (&hp100_pci_driver);
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
module_init(hp100_module_init)
|
module_init(hp100_module_init)
|
||||||
|
|
Loading…
Add table
Reference in a new issue