Commit d7e203ff authored by Arnd Bergmann's avatar Arnd Bergmann Committed by David S. Miller

ne2000: fix unused function warning

Geert noticed a warning on MIPS TX49xx, Atari and presuambly other
platforms when the driver is built-in but NETDEV_LEGACY_INIT is
disabled:

drivers/net/ethernet/8390/ne.c:909:20: warning: ‘ne_add_devices’ defined but not used [-Wunused-function]

Merge the two module init functions into a single one with an
IS_ENABLED() check to replace the incorrect #ifdef.

Fixes: 4228c394 ("make legacy ISA probe optional")
Reported-by: default avatarGeert Uytterhoeven <geert@linux-m68k.org>
Signed-off-by: default avatarArnd Bergmann <arnd@arndb.de>
Reviewed-by: default avatarGeert Uytterhoeven <geert@linux-m68k.org>
Tested-by: default avatarGeert Uytterhoeven <geert@linux-m68k.org>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent c324f023
...@@ -922,13 +922,16 @@ static void __init ne_add_devices(void) ...@@ -922,13 +922,16 @@ static void __init ne_add_devices(void)
} }
} }
#ifdef MODULE
static int __init ne_init(void) static int __init ne_init(void)
{ {
int retval; int retval;
if (IS_MODULE(CONFIG_NE2000))
ne_add_devices(); ne_add_devices();
retval = platform_driver_probe(&ne_driver, ne_drv_probe); retval = platform_driver_probe(&ne_driver, ne_drv_probe);
if (retval) {
if (IS_MODULE(CONFIG_NE2000) && retval) {
if (io[0] == 0) if (io[0] == 0)
pr_notice("ne.c: You must supply \"io=0xNNN\"" pr_notice("ne.c: You must supply \"io=0xNNN\""
" value(s) for ISA cards.\n"); " value(s) for ISA cards.\n");
...@@ -941,18 +944,8 @@ static int __init ne_init(void) ...@@ -941,18 +944,8 @@ static int __init ne_init(void)
return retval; return retval;
} }
module_init(ne_init); module_init(ne_init);
#else /* MODULE */
static int __init ne_init(void)
{
int retval = platform_driver_probe(&ne_driver, ne_drv_probe);
/* Unregister unused platform_devices. */ #if !defined(MODULE) && defined(CONFIG_NETDEV_LEGACY_INIT)
ne_loop_rm_unreg(0);
return retval;
}
module_init(ne_init);
#ifdef CONFIG_NETDEV_LEGACY_INIT
struct net_device * __init ne_probe(int unit) struct net_device * __init ne_probe(int unit)
{ {
int this_dev; int this_dev;
...@@ -994,7 +987,6 @@ struct net_device * __init ne_probe(int unit) ...@@ -994,7 +987,6 @@ struct net_device * __init ne_probe(int unit)
return ERR_PTR(-ENODEV); return ERR_PTR(-ENODEV);
} }
#endif #endif
#endif /* MODULE */
static void __exit ne_exit(void) static void __exit ne_exit(void)
{ {
......
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