declance.c (e98bdb3059cbf2b1cd4261e126b08429f64466c3) declance.c (be12502e2e64854dbe0a2ddff6d26ec1143d6890)
1/*
2 * Lance ethernet driver for the MIPS processor based
3 * DECstation family
4 *
5 *
6 * adopted from sunlance.c by Richard van den Berg
7 *
8 * Copyright (C) 2002, 2003, 2005, 2006 Maciej W. Rozycki

--- 1262 unchanged lines hidden (view full) ---

1271
1272err_out_dev:
1273 free_netdev(dev);
1274
1275err_out:
1276 return ret;
1277}
1278
1/*
2 * Lance ethernet driver for the MIPS processor based
3 * DECstation family
4 *
5 *
6 * adopted from sunlance.c by Richard van den Berg
7 *
8 * Copyright (C) 2002, 2003, 2005, 2006 Maciej W. Rozycki

--- 1262 unchanged lines hidden (view full) ---

1271
1272err_out_dev:
1273 free_netdev(dev);
1274
1275err_out:
1276 return ret;
1277}
1278
1279static void __exit dec_lance_remove(struct device *bdev)
1280{
1281 struct net_device *dev = dev_get_drvdata(bdev);
1282 resource_size_t start, len;
1283
1284 unregister_netdev(dev);
1285 start = to_tc_dev(bdev)->resource.start;
1286 len = to_tc_dev(bdev)->resource.end - start + 1;
1287 release_mem_region(start, len);
1288 free_netdev(dev);
1289}
1290
1291/* Find all the lance cards on the system and initialize them */
1292static int __init dec_lance_platform_probe(void)
1293{
1294 int count = 0;
1295
1296 if (dec_interrupt[DEC_IRQ_LANCE] >= 0) {
1297 if (dec_interrupt[DEC_IRQ_LANCE_MERR] >= 0) {
1298 if (dec_lance_probe(NULL, ASIC_LANCE) >= 0)

--- 16 unchanged lines hidden (view full) ---

1315 unregister_netdev(dev);
1316 root_lance_dev = lp->next;
1317 free_netdev(dev);
1318 }
1319}
1320
1321#ifdef CONFIG_TC
1322static int dec_lance_tc_probe(struct device *dev);
1279/* Find all the lance cards on the system and initialize them */
1280static int __init dec_lance_platform_probe(void)
1281{
1282 int count = 0;
1283
1284 if (dec_interrupt[DEC_IRQ_LANCE] >= 0) {
1285 if (dec_interrupt[DEC_IRQ_LANCE_MERR] >= 0) {
1286 if (dec_lance_probe(NULL, ASIC_LANCE) >= 0)

--- 16 unchanged lines hidden (view full) ---

1303 unregister_netdev(dev);
1304 root_lance_dev = lp->next;
1305 free_netdev(dev);
1306 }
1307}
1308
1309#ifdef CONFIG_TC
1310static int dec_lance_tc_probe(struct device *dev);
1323static int __exit dec_lance_tc_remove(struct device *dev);
1311static int dec_lance_tc_remove(struct device *dev);
1324
1325static const struct tc_device_id dec_lance_tc_table[] = {
1326 { "DEC ", "PMAD-AA " },
1327 { }
1328};
1329MODULE_DEVICE_TABLE(tc, dec_lance_tc_table);
1330
1331static struct tc_driver dec_lance_tc_driver = {
1332 .id_table = dec_lance_tc_table,
1333 .driver = {
1334 .name = "declance",
1335 .bus = &tc_bus_type,
1336 .probe = dec_lance_tc_probe,
1312
1313static const struct tc_device_id dec_lance_tc_table[] = {
1314 { "DEC ", "PMAD-AA " },
1315 { }
1316};
1317MODULE_DEVICE_TABLE(tc, dec_lance_tc_table);
1318
1319static struct tc_driver dec_lance_tc_driver = {
1320 .id_table = dec_lance_tc_table,
1321 .driver = {
1322 .name = "declance",
1323 .bus = &tc_bus_type,
1324 .probe = dec_lance_tc_probe,
1337 .remove = __exit_p(dec_lance_tc_remove),
1325 .remove = dec_lance_tc_remove,
1338 },
1339};
1340
1341static int dec_lance_tc_probe(struct device *dev)
1342{
1343 int status = dec_lance_probe(dev, PMAD_LANCE);
1344 if (!status)
1345 get_device(dev);
1346 return status;
1347}
1348
1326 },
1327};
1328
1329static int dec_lance_tc_probe(struct device *dev)
1330{
1331 int status = dec_lance_probe(dev, PMAD_LANCE);
1332 if (!status)
1333 get_device(dev);
1334 return status;
1335}
1336
1349static int __exit dec_lance_tc_remove(struct device *dev)
1337static void dec_lance_remove(struct device *bdev)
1350{
1338{
1339 struct net_device *dev = dev_get_drvdata(bdev);
1340 resource_size_t start, len;
1341
1342 unregister_netdev(dev);
1343 start = to_tc_dev(bdev)->resource.start;
1344 len = to_tc_dev(bdev)->resource.end - start + 1;
1345 release_mem_region(start, len);
1346 free_netdev(dev);
1347}
1348
1349static int dec_lance_tc_remove(struct device *dev)
1350{
1351 put_device(dev);
1352 dec_lance_remove(dev);
1353 return 0;
1354}
1355#endif
1356
1357static int __init dec_lance_init(void)
1358{

--- 17 unchanged lines hidden ---
1351 put_device(dev);
1352 dec_lance_remove(dev);
1353 return 0;
1354}
1355#endif
1356
1357static int __init dec_lance_init(void)
1358{

--- 17 unchanged lines hidden ---