diff options
Diffstat (limited to 'drivers/net/smc91x.c')
-rw-r--r-- | drivers/net/smc91x.c | 40 |
1 files changed, 20 insertions, 20 deletions
diff --git a/drivers/net/smc91x.c b/drivers/net/smc91x.c index f12206bdbb75..860339d51d58 100644 --- a/drivers/net/smc91x.c +++ b/drivers/net/smc91x.c | |||
@@ -70,7 +70,6 @@ static const char version[] = | |||
70 | #include <linux/module.h> | 70 | #include <linux/module.h> |
71 | #include <linux/kernel.h> | 71 | #include <linux/kernel.h> |
72 | #include <linux/sched.h> | 72 | #include <linux/sched.h> |
73 | #include <linux/slab.h> | ||
74 | #include <linux/delay.h> | 73 | #include <linux/delay.h> |
75 | #include <linux/interrupt.h> | 74 | #include <linux/interrupt.h> |
76 | #include <linux/errno.h> | 75 | #include <linux/errno.h> |
@@ -534,9 +533,9 @@ static inline void smc_rcv(struct net_device *dev) | |||
534 | #define smc_special_lock(lock, flags) spin_lock_irqsave(lock, flags) | 533 | #define smc_special_lock(lock, flags) spin_lock_irqsave(lock, flags) |
535 | #define smc_special_unlock(lock, flags) spin_unlock_irqrestore(lock, flags) | 534 | #define smc_special_unlock(lock, flags) spin_unlock_irqrestore(lock, flags) |
536 | #else | 535 | #else |
537 | #define smc_special_trylock(lock, flags) (1) | 536 | #define smc_special_trylock(lock, flags) (flags == flags) |
538 | #define smc_special_lock(lock, flags) do { } while (0) | 537 | #define smc_special_lock(lock, flags) do { flags = 0; } while (0) |
539 | #define smc_special_unlock(lock, flags) do { } while (0) | 538 | #define smc_special_unlock(lock, flags) do { flags = 0; } while (0) |
540 | #endif | 539 | #endif |
541 | 540 | ||
542 | /* | 541 | /* |
@@ -1395,7 +1394,7 @@ static void smc_set_multicast_list(struct net_device *dev) | |||
1395 | * I don't need to zero the multicast table, because the flag is | 1394 | * I don't need to zero the multicast table, because the flag is |
1396 | * checked before the table is | 1395 | * checked before the table is |
1397 | */ | 1396 | */ |
1398 | else if (dev->flags & IFF_ALLMULTI || dev->mc_count > 16) { | 1397 | else if (dev->flags & IFF_ALLMULTI || netdev_mc_count(dev) > 16) { |
1399 | DBG(2, "%s: RCR_ALMUL\n", dev->name); | 1398 | DBG(2, "%s: RCR_ALMUL\n", dev->name); |
1400 | lp->rcr_cur_mode |= RCR_ALMUL; | 1399 | lp->rcr_cur_mode |= RCR_ALMUL; |
1401 | } | 1400 | } |
@@ -1412,8 +1411,7 @@ static void smc_set_multicast_list(struct net_device *dev) | |||
1412 | * the number of the 8 bit register, while the low 3 bits are the bit | 1411 | * the number of the 8 bit register, while the low 3 bits are the bit |
1413 | * within that register. | 1412 | * within that register. |
1414 | */ | 1413 | */ |
1415 | else if (dev->mc_count) { | 1414 | else if (!netdev_mc_empty(dev)) { |
1416 | int i; | ||
1417 | struct dev_mc_list *cur_addr; | 1415 | struct dev_mc_list *cur_addr; |
1418 | 1416 | ||
1419 | /* table for flipping the order of 3 bits */ | 1417 | /* table for flipping the order of 3 bits */ |
@@ -1422,13 +1420,9 @@ static void smc_set_multicast_list(struct net_device *dev) | |||
1422 | /* start with a table of all zeros: reject all */ | 1420 | /* start with a table of all zeros: reject all */ |
1423 | memset(multicast_table, 0, sizeof(multicast_table)); | 1421 | memset(multicast_table, 0, sizeof(multicast_table)); |
1424 | 1422 | ||
1425 | cur_addr = dev->mc_list; | 1423 | netdev_for_each_mc_addr(cur_addr, dev) { |
1426 | for (i = 0; i < dev->mc_count; i++, cur_addr = cur_addr->next) { | ||
1427 | int position; | 1424 | int position; |
1428 | 1425 | ||
1429 | /* do we have a pointer here? */ | ||
1430 | if (!cur_addr) | ||
1431 | break; | ||
1432 | /* make sure this is a multicast address - | 1426 | /* make sure this is a multicast address - |
1433 | shouldn't this be a given if we have it here ? */ | 1427 | shouldn't this be a given if we have it here ? */ |
1434 | if (!(*cur_addr->dmi_addr & 1)) | 1428 | if (!(*cur_addr->dmi_addr & 1)) |
@@ -2031,7 +2025,7 @@ static int __devinit smc_probe(struct net_device *dev, void __iomem *ioaddr, | |||
2031 | } | 2025 | } |
2032 | 2026 | ||
2033 | /* Grab the IRQ */ | 2027 | /* Grab the IRQ */ |
2034 | retval = request_irq(dev->irq, &smc_interrupt, irq_flags, dev->name, dev); | 2028 | retval = request_irq(dev->irq, smc_interrupt, irq_flags, dev->name, dev); |
2035 | if (retval) | 2029 | if (retval) |
2036 | goto err_out; | 2030 | goto err_out; |
2037 | 2031 | ||
@@ -2365,9 +2359,10 @@ static int __devexit smc_drv_remove(struct platform_device *pdev) | |||
2365 | return 0; | 2359 | return 0; |
2366 | } | 2360 | } |
2367 | 2361 | ||
2368 | static int smc_drv_suspend(struct platform_device *dev, pm_message_t state) | 2362 | static int smc_drv_suspend(struct device *dev) |
2369 | { | 2363 | { |
2370 | struct net_device *ndev = platform_get_drvdata(dev); | 2364 | struct platform_device *pdev = to_platform_device(dev); |
2365 | struct net_device *ndev = platform_get_drvdata(pdev); | ||
2371 | 2366 | ||
2372 | if (ndev) { | 2367 | if (ndev) { |
2373 | if (netif_running(ndev)) { | 2368 | if (netif_running(ndev)) { |
@@ -2379,13 +2374,14 @@ static int smc_drv_suspend(struct platform_device *dev, pm_message_t state) | |||
2379 | return 0; | 2374 | return 0; |
2380 | } | 2375 | } |
2381 | 2376 | ||
2382 | static int smc_drv_resume(struct platform_device *dev) | 2377 | static int smc_drv_resume(struct device *dev) |
2383 | { | 2378 | { |
2384 | struct net_device *ndev = platform_get_drvdata(dev); | 2379 | struct platform_device *pdev = to_platform_device(dev); |
2380 | struct net_device *ndev = platform_get_drvdata(pdev); | ||
2385 | 2381 | ||
2386 | if (ndev) { | 2382 | if (ndev) { |
2387 | struct smc_local *lp = netdev_priv(ndev); | 2383 | struct smc_local *lp = netdev_priv(ndev); |
2388 | smc_enable_device(dev); | 2384 | smc_enable_device(pdev); |
2389 | if (netif_running(ndev)) { | 2385 | if (netif_running(ndev)) { |
2390 | smc_reset(ndev); | 2386 | smc_reset(ndev); |
2391 | smc_enable(ndev); | 2387 | smc_enable(ndev); |
@@ -2397,14 +2393,18 @@ static int smc_drv_resume(struct platform_device *dev) | |||
2397 | return 0; | 2393 | return 0; |
2398 | } | 2394 | } |
2399 | 2395 | ||
2396 | static struct dev_pm_ops smc_drv_pm_ops = { | ||
2397 | .suspend = smc_drv_suspend, | ||
2398 | .resume = smc_drv_resume, | ||
2399 | }; | ||
2400 | |||
2400 | static struct platform_driver smc_driver = { | 2401 | static struct platform_driver smc_driver = { |
2401 | .probe = smc_drv_probe, | 2402 | .probe = smc_drv_probe, |
2402 | .remove = __devexit_p(smc_drv_remove), | 2403 | .remove = __devexit_p(smc_drv_remove), |
2403 | .suspend = smc_drv_suspend, | ||
2404 | .resume = smc_drv_resume, | ||
2405 | .driver = { | 2404 | .driver = { |
2406 | .name = CARDNAME, | 2405 | .name = CARDNAME, |
2407 | .owner = THIS_MODULE, | 2406 | .owner = THIS_MODULE, |
2407 | .pm = &smc_drv_pm_ops, | ||
2408 | }, | 2408 | }, |
2409 | }; | 2409 | }; |
2410 | 2410 | ||