Skip to content

Commit e179d78

Browse files
arndbdavem330
authored andcommitted
m68k: remove legacy probing
There are six m68k specific drivers that use the legacy probe method in drivers/net/Space.c. However, all of these only support a single device, and they completely ignore the command line settings from netdev_boot_setup_check, so there is really no point at all. Aside from sun3_82586, these already have a module_init function that can be used for built-in mode as well, simply by removing the #ifdef. Note that the 82596 driver was previously used on ISA as well, but that got dropped long ago. Reviewed-by: Geert Uytterhoeven <geert@linux-m68k.org> Signed-off-by: Arnd Bergmann <arnd@arndb.de> Signed-off-by: David S. Miller <davem@davemloft.net>
1 parent 47fd22f commit e179d78

8 files changed

Lines changed: 30 additions & 99 deletions

File tree

‎drivers/net/Space.c‎

Lines changed: 1 addition & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -80,34 +80,12 @@ static struct devprobe2 isa_probes[] __initdata = {
8080
#ifdef CONFIG_CS89x0_ISA
8181
{cs89x0_probe, 0},
8282
#endif
83-
#if defined(CONFIG_MVME16x_NET) || defined(CONFIG_BVME6000_NET) /* Intel */
84-
{i82596_probe, 0}, /* I82596 */
85-
#endif
8683
#ifdef CONFIG_NI65
8784
{ni65_probe, 0},
8885
#endif
8986
{NULL, 0},
9087
};
9188

92-
static struct devprobe2 m68k_probes[] __initdata = {
93-
#ifdef CONFIG_ATARILANCE /* Lance-based Atari ethernet boards */
94-
{atarilance_probe, 0},
95-
#endif
96-
#ifdef CONFIG_SUN3LANCE /* sun3 onboard Lance chip */
97-
{sun3lance_probe, 0},
98-
#endif
99-
#ifdef CONFIG_SUN3_82586 /* sun3 onboard Intel 82586 chip */
100-
{sun3_82586_probe, 0},
101-
#endif
102-
#ifdef CONFIG_APNE /* A1200 PCMCIA NE2000 */
103-
{apne_probe, 0},
104-
#endif
105-
#ifdef CONFIG_MVME147_NET /* MVME147 internal Ethernet */
106-
{mvme147lance_probe, 0},
107-
#endif
108-
{NULL, 0},
109-
};
110-
11189
/* Unified ethernet device probe, segmented per architecture and
11290
* per bus interface. This drives the legacy devices only for now.
11391
*/
@@ -119,8 +97,7 @@ static void __init ethif_probe2(int unit)
11997
if (base_addr == 1)
12098
return;
12199

122-
(void)(probe_list2(unit, m68k_probes, base_addr == 0) &&
123-
probe_list2(unit, isa_probes, base_addr == 0));
100+
probe_list2(unit, isa_probes, base_addr == 0);
124101
}
125102

126103
/* Statically configured drivers -- order matters here. */

‎drivers/net/ethernet/8390/apne.c‎

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,6 @@
7575
#define NESM_STOP_PG 0x80 /* Last page +1 of RX ring */
7676

7777

78-
struct net_device * __init apne_probe(int unit);
7978
static int apne_probe1(struct net_device *dev, int ioaddr);
8079

8180
static void apne_reset_8390(struct net_device *dev);
@@ -120,7 +119,7 @@ static u32 apne_msg_enable;
120119
module_param_named(msg_enable, apne_msg_enable, uint, 0444);
121120
MODULE_PARM_DESC(msg_enable, "Debug message level (see linux/netdevice.h for bitmap)");
122121

123-
struct net_device * __init apne_probe(int unit)
122+
static struct net_device * __init apne_probe(void)
124123
{
125124
struct net_device *dev;
126125
struct ei_device *ei_local;
@@ -150,10 +149,6 @@ struct net_device * __init apne_probe(int unit)
150149
dev = alloc_ei_netdev();
151150
if (!dev)
152151
return ERR_PTR(-ENOMEM);
153-
if (unit >= 0) {
154-
sprintf(dev->name, "eth%d", unit);
155-
netdev_boot_setup_check(dev);
156-
}
157152
ei_local = netdev_priv(dev);
158153
ei_local->msg_enable = apne_msg_enable;
159154

@@ -554,12 +549,11 @@ static irqreturn_t apne_interrupt(int irq, void *dev_id)
554549
return IRQ_HANDLED;
555550
}
556551

557-
#ifdef MODULE
558552
static struct net_device *apne_dev;
559553

560554
static int __init apne_module_init(void)
561555
{
562-
apne_dev = apne_probe(-1);
556+
apne_dev = apne_probe();
563557
return PTR_ERR_OR_ZERO(apne_dev);
564558
}
565559

@@ -579,7 +573,6 @@ static void __exit apne_module_exit(void)
579573
}
580574
module_init(apne_module_init);
581575
module_exit(apne_module_exit);
582-
#endif
583576

584577
static int init_pcmcia(void)
585578
{

‎drivers/net/ethernet/amd/atarilance.c‎

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -367,7 +367,7 @@ static void *slow_memcpy( void *dst, const void *src, size_t len )
367367
}
368368

369369

370-
struct net_device * __init atarilance_probe(int unit)
370+
struct net_device * __init atarilance_probe(void)
371371
{
372372
int i;
373373
static int found;
@@ -382,10 +382,6 @@ struct net_device * __init atarilance_probe(int unit)
382382
dev = alloc_etherdev(sizeof(struct lance_private));
383383
if (!dev)
384384
return ERR_PTR(-ENOMEM);
385-
if (unit >= 0) {
386-
sprintf(dev->name, "eth%d", unit);
387-
netdev_boot_setup_check(dev);
388-
}
389385

390386
for( i = 0; i < N_LANCE_ADDR; ++i ) {
391387
if (lance_probe1( dev, &lance_addr_list[i] )) {
@@ -1137,13 +1133,11 @@ static int lance_set_mac_address( struct net_device *dev, void *addr )
11371133
return 0;
11381134
}
11391135

1140-
1141-
#ifdef MODULE
11421136
static struct net_device *atarilance_dev;
11431137

11441138
static int __init atarilance_module_init(void)
11451139
{
1146-
atarilance_dev = atarilance_probe(-1);
1140+
atarilance_dev = atarilance_probe();
11471141
return PTR_ERR_OR_ZERO(atarilance_dev);
11481142
}
11491143

@@ -1155,4 +1149,3 @@ static void __exit atarilance_module_exit(void)
11551149
}
11561150
module_init(atarilance_module_init);
11571151
module_exit(atarilance_module_exit);
1158-
#endif /* MODULE */

‎drivers/net/ethernet/amd/mvme147.c‎

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ static const struct net_device_ops lance_netdev_ops = {
6868
};
6969

7070
/* Initialise the one and only on-board 7990 */
71-
struct net_device * __init mvme147lance_probe(int unit)
71+
static struct net_device * __init mvme147lance_probe(void)
7272
{
7373
struct net_device *dev;
7474
static int called;
@@ -86,9 +86,6 @@ struct net_device * __init mvme147lance_probe(int unit)
8686
if (!dev)
8787
return ERR_PTR(-ENOMEM);
8888

89-
if (unit >= 0)
90-
sprintf(dev->name, "eth%d", unit);
91-
9289
/* Fill the dev fields */
9390
dev->base_addr = (unsigned long)MVME147_LANCE_BASE;
9491
dev->netdev_ops = &lance_netdev_ops;
@@ -179,22 +176,21 @@ static int m147lance_close(struct net_device *dev)
179176
return 0;
180177
}
181178

182-
#ifdef MODULE
183179
MODULE_LICENSE("GPL");
184180

185181
static struct net_device *dev_mvme147_lance;
186-
int __init init_module(void)
182+
static int __init m147lance_init(void)
187183
{
188-
dev_mvme147_lance = mvme147lance_probe(-1);
184+
dev_mvme147_lance = mvme147lance_probe();
189185
return PTR_ERR_OR_ZERO(dev_mvme147_lance);
190186
}
187+
module_init(m147lance_init);
191188

192-
void __exit cleanup_module(void)
189+
static void __exit m147lance_exit(void)
193190
{
194191
struct m147lance_private *lp = netdev_priv(dev_mvme147_lance);
195192
unregister_netdev(dev_mvme147_lance);
196193
free_pages(lp->ram, 3);
197194
free_netdev(dev_mvme147_lance);
198195
}
199-
200-
#endif /* MODULE */
196+
module_exit(m147lance_exit);

‎drivers/net/ethernet/amd/sun3lance.c‎

Lines changed: 6 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -245,7 +245,7 @@ static void set_multicast_list( struct net_device *dev );
245245

246246
/************************* End of Prototypes **************************/
247247

248-
struct net_device * __init sun3lance_probe(int unit)
248+
static struct net_device * __init sun3lance_probe(void)
249249
{
250250
struct net_device *dev;
251251
static int found;
@@ -272,10 +272,6 @@ struct net_device * __init sun3lance_probe(int unit)
272272
dev = alloc_etherdev(sizeof(struct lance_private));
273273
if (!dev)
274274
return ERR_PTR(-ENOMEM);
275-
if (unit >= 0) {
276-
sprintf(dev->name, "eth%d", unit);
277-
netdev_boot_setup_check(dev);
278-
}
279275

280276
if (!lance_probe(dev))
281277
goto out;
@@ -924,24 +920,21 @@ static void set_multicast_list( struct net_device *dev )
924920
}
925921

926922

927-
#ifdef MODULE
928-
929923
static struct net_device *sun3lance_dev;
930924

931-
int __init init_module(void)
925+
static int __init sun3lance_init(void)
932926
{
933-
sun3lance_dev = sun3lance_probe(-1);
927+
sun3lance_dev = sun3lance_probe();
934928
return PTR_ERR_OR_ZERO(sun3lance_dev);
935929
}
930+
module_init(sun3lance_init);
936931

937-
void __exit cleanup_module(void)
932+
static void __exit sun3lance_cleanup(void)
938933
{
939934
unregister_netdev(sun3lance_dev);
940935
#ifdef CONFIG_SUN3
941936
iounmap((void __iomem *)sun3lance_dev->base_addr);
942937
#endif
943938
free_netdev(sun3lance_dev);
944939
}
945-
946-
#endif /* MODULE */
947-
940+
module_exit(sun3lance_cleanup);

‎drivers/net/ethernet/i825xx/82596.c‎

Lines changed: 6 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1110,9 +1110,6 @@ static void print_eth(unsigned char *add, char *str)
11101110
add, add + 6, add, add[12], add[13], str);
11111111
}
11121112

1113-
static int io = 0x300;
1114-
static int irq = 10;
1115-
11161113
static const struct net_device_ops i596_netdev_ops = {
11171114
.ndo_open = i596_open,
11181115
.ndo_stop = i596_close,
@@ -1123,7 +1120,7 @@ static const struct net_device_ops i596_netdev_ops = {
11231120
.ndo_validate_addr = eth_validate_addr,
11241121
};
11251122

1126-
struct net_device * __init i82596_probe(int unit)
1123+
static struct net_device * __init i82596_probe(void)
11271124
{
11281125
struct net_device *dev;
11291126
int i;
@@ -1140,14 +1137,6 @@ struct net_device * __init i82596_probe(int unit)
11401137
if (!dev)
11411138
return ERR_PTR(-ENOMEM);
11421139

1143-
if (unit >= 0) {
1144-
sprintf(dev->name, "eth%d", unit);
1145-
netdev_boot_setup_check(dev);
1146-
} else {
1147-
dev->base_addr = io;
1148-
dev->irq = irq;
1149-
}
1150-
11511140
#ifdef ENABLE_MVME16x_NET
11521141
if (MACH_IS_MVME16x) {
11531142
if (mvme16x_config & MVME16x_CONFIG_NO_ETHERNET) {
@@ -1515,22 +1504,22 @@ static void set_multicast_list(struct net_device *dev)
15151504
}
15161505
}
15171506

1518-
#ifdef MODULE
15191507
static struct net_device *dev_82596;
15201508

15211509
static int debug = -1;
15221510
module_param(debug, int, 0);
15231511
MODULE_PARM_DESC(debug, "i82596 debug mask");
15241512

1525-
int __init init_module(void)
1513+
static int __init i82596_init(void)
15261514
{
15271515
if (debug >= 0)
15281516
i596_debug = debug;
1529-
dev_82596 = i82596_probe(-1);
1517+
dev_82596 = i82596_probe();
15301518
return PTR_ERR_OR_ZERO(dev_82596);
15311519
}
1520+
module_init(i82596_init);
15321521

1533-
void __exit cleanup_module(void)
1522+
static void __exit i82596_cleanup(void)
15341523
{
15351524
unregister_netdev(dev_82596);
15361525
#ifdef __mc68000__
@@ -1544,5 +1533,4 @@ void __exit cleanup_module(void)
15441533
free_page ((u32)(dev_82596->mem_start));
15451534
free_netdev(dev_82596);
15461535
}
1547-
1548-
#endif /* MODULE */
1536+
module_exit(i82596_cleanup);

‎drivers/net/ethernet/i825xx/sun3_82586.c‎

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ static int rfdadd = 0; /* rfdadd=1 may be better for 8K MEM cards */
2929
static int fifo=0x8; /* don't change */
3030

3131
#include <linux/kernel.h>
32+
#include <linux/module.h>
3233
#include <linux/string.h>
3334
#include <linux/errno.h>
3435
#include <linux/ioport.h>
@@ -276,7 +277,7 @@ static void alloc586(struct net_device *dev)
276277
memset((char *)p->scb,0,sizeof(struct scb_struct));
277278
}
278279

279-
struct net_device * __init sun3_82586_probe(int unit)
280+
static int __init sun3_82586_probe(void)
280281
{
281282
struct net_device *dev;
282283
unsigned long ioaddr;
@@ -291,25 +292,20 @@ struct net_device * __init sun3_82586_probe(int unit)
291292
break;
292293

293294
default:
294-
return ERR_PTR(-ENODEV);
295+
return -ENODEV;
295296
}
296297

297298
if (found)
298-
return ERR_PTR(-ENODEV);
299+
return -ENODEV;
299300

300301
ioaddr = (unsigned long)ioremap(IE_OBIO, SUN3_82586_TOTAL_SIZE);
301302
if (!ioaddr)
302-
return ERR_PTR(-ENOMEM);
303+
return -ENOMEM;
303304
found = 1;
304305

305306
dev = alloc_etherdev(sizeof(struct priv));
306307
if (!dev)
307308
goto out;
308-
if (unit >= 0) {
309-
sprintf(dev->name, "eth%d", unit);
310-
netdev_boot_setup_check(dev);
311-
}
312-
313309
dev->irq = IE_IRQ;
314310
dev->base_addr = ioaddr;
315311
err = sun3_82586_probe1(dev, ioaddr);
@@ -326,8 +322,9 @@ struct net_device * __init sun3_82586_probe(int unit)
326322
free_netdev(dev);
327323
out:
328324
iounmap((void __iomem *)ioaddr);
329-
return ERR_PTR(err);
325+
return err;
330326
}
327+
module_init(sun3_82586_probe);
331328

332329
static const struct net_device_ops sun3_82586_netdev_ops = {
333330
.ndo_open = sun3_82586_open,

‎include/net/Space.h‎

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,16 +8,10 @@ struct net_device *ultra_probe(int unit);
88
struct net_device *wd_probe(int unit);
99
struct net_device *ne_probe(int unit);
1010
struct net_device *fmv18x_probe(int unit);
11-
struct net_device *i82596_probe(int unit);
1211
struct net_device *ni65_probe(int unit);
1312
struct net_device *sonic_probe(int unit);
1413
struct net_device *smc_init(int unit);
15-
struct net_device *atarilance_probe(int unit);
16-
struct net_device *sun3lance_probe(int unit);
17-
struct net_device *sun3_82586_probe(int unit);
18-
struct net_device *apne_probe(int unit);
1914
struct net_device *cs89x0_probe(int unit);
20-
struct net_device *mvme147lance_probe(int unit);
2115
struct net_device *tc515_probe(int unit);
2216
struct net_device *lance_probe(int unit);
2317
struct net_device *cops_probe(int unit);

0 commit comments

Comments
 (0)