aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/ethernet/davicom/dm9000.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/net/ethernet/davicom/dm9000.c')
-rw-r--r--drivers/net/ethernet/davicom/dm9000.c98
1 files changed, 50 insertions, 48 deletions
diff --git a/drivers/net/ethernet/davicom/dm9000.c b/drivers/net/ethernet/davicom/dm9000.c
index 13723c96d1a2..9b33057a9477 100644
--- a/drivers/net/ethernet/davicom/dm9000.c
+++ b/drivers/net/ethernet/davicom/dm9000.c
@@ -93,7 +93,7 @@ enum dm9000_type {
93}; 93};
94 94
95/* Structure/enum declaration ------------------------------- */ 95/* Structure/enum declaration ------------------------------- */
96typedef struct board_info { 96struct board_info {
97 97
98 void __iomem *io_addr; /* Register I/O base address */ 98 void __iomem *io_addr; /* Register I/O base address */
99 void __iomem *io_data; /* Data I/O address */ 99 void __iomem *io_data; /* Data I/O address */
@@ -141,7 +141,7 @@ typedef struct board_info {
141 u32 wake_state; 141 u32 wake_state;
142 142
143 int ip_summed; 143 int ip_summed;
144} board_info_t; 144};
145 145
146/* debug code */ 146/* debug code */
147 147
@@ -151,7 +151,7 @@ typedef struct board_info {
151 } \ 151 } \
152} while (0) 152} while (0)
153 153
154static inline board_info_t *to_dm9000_board(struct net_device *dev) 154static inline struct board_info *to_dm9000_board(struct net_device *dev)
155{ 155{
156 return netdev_priv(dev); 156 return netdev_priv(dev);
157} 157}
@@ -162,7 +162,7 @@ static inline board_info_t *to_dm9000_board(struct net_device *dev)
162 * Read a byte from I/O port 162 * Read a byte from I/O port
163 */ 163 */
164static u8 164static u8
165ior(board_info_t *db, int reg) 165ior(struct board_info *db, int reg)
166{ 166{
167 writeb(reg, db->io_addr); 167 writeb(reg, db->io_addr);
168 return readb(db->io_data); 168 return readb(db->io_data);
@@ -173,14 +173,14 @@ ior(board_info_t *db, int reg)
173 */ 173 */
174 174
175static void 175static void
176iow(board_info_t *db, int reg, int value) 176iow(struct board_info *db, int reg, int value)
177{ 177{
178 writeb(reg, db->io_addr); 178 writeb(reg, db->io_addr);
179 writeb(value, db->io_data); 179 writeb(value, db->io_data);
180} 180}
181 181
182static void 182static void
183dm9000_reset(board_info_t *db) 183dm9000_reset(struct board_info *db)
184{ 184{
185 dev_dbg(db->dev, "resetting device\n"); 185 dev_dbg(db->dev, "resetting device\n");
186 186
@@ -272,7 +272,7 @@ static void dm9000_dumpblk_32bit(void __iomem *reg, int count)
272 * Sleep, either by using msleep() or if we are suspending, then 272 * Sleep, either by using msleep() or if we are suspending, then
273 * use mdelay() to sleep. 273 * use mdelay() to sleep.
274 */ 274 */
275static void dm9000_msleep(board_info_t *db, unsigned int ms) 275static void dm9000_msleep(struct board_info *db, unsigned int ms)
276{ 276{
277 if (db->in_suspend || db->in_timeout) 277 if (db->in_suspend || db->in_timeout)
278 mdelay(ms); 278 mdelay(ms);
@@ -284,7 +284,7 @@ static void dm9000_msleep(board_info_t *db, unsigned int ms)
284static int 284static int
285dm9000_phy_read(struct net_device *dev, int phy_reg_unused, int reg) 285dm9000_phy_read(struct net_device *dev, int phy_reg_unused, int reg)
286{ 286{
287 board_info_t *db = netdev_priv(dev); 287 struct board_info *db = netdev_priv(dev);
288 unsigned long flags; 288 unsigned long flags;
289 unsigned int reg_save; 289 unsigned int reg_save;
290 int ret; 290 int ret;
@@ -330,7 +330,7 @@ static void
330dm9000_phy_write(struct net_device *dev, 330dm9000_phy_write(struct net_device *dev,
331 int phyaddr_unused, int reg, int value) 331 int phyaddr_unused, int reg, int value)
332{ 332{
333 board_info_t *db = netdev_priv(dev); 333 struct board_info *db = netdev_priv(dev);
334 unsigned long flags; 334 unsigned long flags;
335 unsigned long reg_save; 335 unsigned long reg_save;
336 336
@@ -408,7 +408,7 @@ static void dm9000_set_io(struct board_info *db, int byte_width)
408 } 408 }
409} 409}
410 410
411static void dm9000_schedule_poll(board_info_t *db) 411static void dm9000_schedule_poll(struct board_info *db)
412{ 412{
413 if (db->type == TYPE_DM9000E) 413 if (db->type == TYPE_DM9000E)
414 schedule_delayed_work(&db->phy_poll, HZ * 2); 414 schedule_delayed_work(&db->phy_poll, HZ * 2);
@@ -416,7 +416,7 @@ static void dm9000_schedule_poll(board_info_t *db)
416 416
417static int dm9000_ioctl(struct net_device *dev, struct ifreq *req, int cmd) 417static int dm9000_ioctl(struct net_device *dev, struct ifreq *req, int cmd)
418{ 418{
419 board_info_t *dm = to_dm9000_board(dev); 419 struct board_info *dm = to_dm9000_board(dev);
420 420
421 if (!netif_running(dev)) 421 if (!netif_running(dev))
422 return -EINVAL; 422 return -EINVAL;
@@ -425,7 +425,7 @@ static int dm9000_ioctl(struct net_device *dev, struct ifreq *req, int cmd)
425} 425}
426 426
427static unsigned int 427static unsigned int
428dm9000_read_locked(board_info_t *db, int reg) 428dm9000_read_locked(struct board_info *db, int reg)
429{ 429{
430 unsigned long flags; 430 unsigned long flags;
431 unsigned int ret; 431 unsigned int ret;
@@ -437,7 +437,7 @@ dm9000_read_locked(board_info_t *db, int reg)
437 return ret; 437 return ret;
438} 438}
439 439
440static int dm9000_wait_eeprom(board_info_t *db) 440static int dm9000_wait_eeprom(struct board_info *db)
441{ 441{
442 unsigned int status; 442 unsigned int status;
443 int timeout = 8; /* wait max 8msec */ 443 int timeout = 8; /* wait max 8msec */
@@ -474,7 +474,7 @@ static int dm9000_wait_eeprom(board_info_t *db)
474 * Read a word data from EEPROM 474 * Read a word data from EEPROM
475 */ 475 */
476static void 476static void
477dm9000_read_eeprom(board_info_t *db, int offset, u8 *to) 477dm9000_read_eeprom(struct board_info *db, int offset, u8 *to)
478{ 478{
479 unsigned long flags; 479 unsigned long flags;
480 480
@@ -514,7 +514,7 @@ dm9000_read_eeprom(board_info_t *db, int offset, u8 *to)
514 * Write a word data to SROM 514 * Write a word data to SROM
515 */ 515 */
516static void 516static void
517dm9000_write_eeprom(board_info_t *db, int offset, u8 *data) 517dm9000_write_eeprom(struct board_info *db, int offset, u8 *data)
518{ 518{
519 unsigned long flags; 519 unsigned long flags;
520 520
@@ -546,7 +546,7 @@ dm9000_write_eeprom(board_info_t *db, int offset, u8 *data)
546static void dm9000_get_drvinfo(struct net_device *dev, 546static void dm9000_get_drvinfo(struct net_device *dev,
547 struct ethtool_drvinfo *info) 547 struct ethtool_drvinfo *info)
548{ 548{
549 board_info_t *dm = to_dm9000_board(dev); 549 struct board_info *dm = to_dm9000_board(dev);
550 550
551 strlcpy(info->driver, CARDNAME, sizeof(info->driver)); 551 strlcpy(info->driver, CARDNAME, sizeof(info->driver));
552 strlcpy(info->version, DRV_VERSION, sizeof(info->version)); 552 strlcpy(info->version, DRV_VERSION, sizeof(info->version));
@@ -556,21 +556,21 @@ static void dm9000_get_drvinfo(struct net_device *dev,
556 556
557static u32 dm9000_get_msglevel(struct net_device *dev) 557static u32 dm9000_get_msglevel(struct net_device *dev)
558{ 558{
559 board_info_t *dm = to_dm9000_board(dev); 559 struct board_info *dm = to_dm9000_board(dev);
560 560
561 return dm->msg_enable; 561 return dm->msg_enable;
562} 562}
563 563
564static void dm9000_set_msglevel(struct net_device *dev, u32 value) 564static void dm9000_set_msglevel(struct net_device *dev, u32 value)
565{ 565{
566 board_info_t *dm = to_dm9000_board(dev); 566 struct board_info *dm = to_dm9000_board(dev);
567 567
568 dm->msg_enable = value; 568 dm->msg_enable = value;
569} 569}
570 570
571static int dm9000_get_settings(struct net_device *dev, struct ethtool_cmd *cmd) 571static int dm9000_get_settings(struct net_device *dev, struct ethtool_cmd *cmd)
572{ 572{
573 board_info_t *dm = to_dm9000_board(dev); 573 struct board_info *dm = to_dm9000_board(dev);
574 574
575 mii_ethtool_gset(&dm->mii, cmd); 575 mii_ethtool_gset(&dm->mii, cmd);
576 return 0; 576 return 0;
@@ -578,21 +578,21 @@ static int dm9000_get_settings(struct net_device *dev, struct ethtool_cmd *cmd)
578 578
579static int dm9000_set_settings(struct net_device *dev, struct ethtool_cmd *cmd) 579static int dm9000_set_settings(struct net_device *dev, struct ethtool_cmd *cmd)
580{ 580{
581 board_info_t *dm = to_dm9000_board(dev); 581 struct board_info *dm = to_dm9000_board(dev);
582 582
583 return mii_ethtool_sset(&dm->mii, cmd); 583 return mii_ethtool_sset(&dm->mii, cmd);
584} 584}
585 585
586static int dm9000_nway_reset(struct net_device *dev) 586static int dm9000_nway_reset(struct net_device *dev)
587{ 587{
588 board_info_t *dm = to_dm9000_board(dev); 588 struct board_info *dm = to_dm9000_board(dev);
589 return mii_nway_restart(&dm->mii); 589 return mii_nway_restart(&dm->mii);
590} 590}
591 591
592static int dm9000_set_features(struct net_device *dev, 592static int dm9000_set_features(struct net_device *dev,
593 netdev_features_t features) 593 netdev_features_t features)
594{ 594{
595 board_info_t *dm = to_dm9000_board(dev); 595 struct board_info *dm = to_dm9000_board(dev);
596 netdev_features_t changed = dev->features ^ features; 596 netdev_features_t changed = dev->features ^ features;
597 unsigned long flags; 597 unsigned long flags;
598 598
@@ -608,7 +608,7 @@ static int dm9000_set_features(struct net_device *dev,
608 608
609static u32 dm9000_get_link(struct net_device *dev) 609static u32 dm9000_get_link(struct net_device *dev)
610{ 610{
611 board_info_t *dm = to_dm9000_board(dev); 611 struct board_info *dm = to_dm9000_board(dev);
612 u32 ret; 612 u32 ret;
613 613
614 if (dm->flags & DM9000_PLATF_EXT_PHY) 614 if (dm->flags & DM9000_PLATF_EXT_PHY)
@@ -629,7 +629,7 @@ static int dm9000_get_eeprom_len(struct net_device *dev)
629static int dm9000_get_eeprom(struct net_device *dev, 629static int dm9000_get_eeprom(struct net_device *dev,
630 struct ethtool_eeprom *ee, u8 *data) 630 struct ethtool_eeprom *ee, u8 *data)
631{ 631{
632 board_info_t *dm = to_dm9000_board(dev); 632 struct board_info *dm = to_dm9000_board(dev);
633 int offset = ee->offset; 633 int offset = ee->offset;
634 int len = ee->len; 634 int len = ee->len;
635 int i; 635 int i;
@@ -653,7 +653,7 @@ static int dm9000_get_eeprom(struct net_device *dev,
653static int dm9000_set_eeprom(struct net_device *dev, 653static int dm9000_set_eeprom(struct net_device *dev,
654 struct ethtool_eeprom *ee, u8 *data) 654 struct ethtool_eeprom *ee, u8 *data)
655{ 655{
656 board_info_t *dm = to_dm9000_board(dev); 656 struct board_info *dm = to_dm9000_board(dev);
657 int offset = ee->offset; 657 int offset = ee->offset;
658 int len = ee->len; 658 int len = ee->len;
659 int done; 659 int done;
@@ -691,7 +691,7 @@ static int dm9000_set_eeprom(struct net_device *dev,
691 691
692static void dm9000_get_wol(struct net_device *dev, struct ethtool_wolinfo *w) 692static void dm9000_get_wol(struct net_device *dev, struct ethtool_wolinfo *w)
693{ 693{
694 board_info_t *dm = to_dm9000_board(dev); 694 struct board_info *dm = to_dm9000_board(dev);
695 695
696 memset(w, 0, sizeof(struct ethtool_wolinfo)); 696 memset(w, 0, sizeof(struct ethtool_wolinfo));
697 697
@@ -702,7 +702,7 @@ static void dm9000_get_wol(struct net_device *dev, struct ethtool_wolinfo *w)
702 702
703static int dm9000_set_wol(struct net_device *dev, struct ethtool_wolinfo *w) 703static int dm9000_set_wol(struct net_device *dev, struct ethtool_wolinfo *w)
704{ 704{
705 board_info_t *dm = to_dm9000_board(dev); 705 struct board_info *dm = to_dm9000_board(dev);
706 unsigned long flags; 706 unsigned long flags;
707 u32 opts = w->wolopts; 707 u32 opts = w->wolopts;
708 u32 wcr = 0; 708 u32 wcr = 0;
@@ -752,7 +752,7 @@ static const struct ethtool_ops dm9000_ethtool_ops = {
752 .set_eeprom = dm9000_set_eeprom, 752 .set_eeprom = dm9000_set_eeprom,
753}; 753};
754 754
755static void dm9000_show_carrier(board_info_t *db, 755static void dm9000_show_carrier(struct board_info *db,
756 unsigned carrier, unsigned nsr) 756 unsigned carrier, unsigned nsr)
757{ 757{
758 int lpa; 758 int lpa;
@@ -775,7 +775,7 @@ static void
775dm9000_poll_work(struct work_struct *w) 775dm9000_poll_work(struct work_struct *w)
776{ 776{
777 struct delayed_work *dw = to_delayed_work(w); 777 struct delayed_work *dw = to_delayed_work(w);
778 board_info_t *db = container_of(dw, board_info_t, phy_poll); 778 struct board_info *db = container_of(dw, struct board_info, phy_poll);
779 struct net_device *ndev = db->ndev; 779 struct net_device *ndev = db->ndev;
780 780
781 if (db->flags & DM9000_PLATF_SIMPLE_PHY && 781 if (db->flags & DM9000_PLATF_SIMPLE_PHY &&
@@ -817,10 +817,12 @@ dm9000_release_board(struct platform_device *pdev, struct board_info *db)
817 817
818 /* release the resources */ 818 /* release the resources */
819 819
820 release_resource(db->data_req); 820 if (db->data_req)
821 release_resource(db->data_req);
821 kfree(db->data_req); 822 kfree(db->data_req);
822 823
823 release_resource(db->addr_req); 824 if (db->addr_req)
825 release_resource(db->addr_req);
824 kfree(db->addr_req); 826 kfree(db->addr_req);
825} 827}
826 828
@@ -841,7 +843,7 @@ static unsigned char dm9000_type_to_char(enum dm9000_type type)
841static void 843static void
842dm9000_hash_table_unlocked(struct net_device *dev) 844dm9000_hash_table_unlocked(struct net_device *dev)
843{ 845{
844 board_info_t *db = netdev_priv(dev); 846 struct board_info *db = netdev_priv(dev);
845 struct netdev_hw_addr *ha; 847 struct netdev_hw_addr *ha;
846 int i, oft; 848 int i, oft;
847 u32 hash_val; 849 u32 hash_val;
@@ -877,7 +879,7 @@ dm9000_hash_table_unlocked(struct net_device *dev)
877static void 879static void
878dm9000_hash_table(struct net_device *dev) 880dm9000_hash_table(struct net_device *dev)
879{ 881{
880 board_info_t *db = netdev_priv(dev); 882 struct board_info *db = netdev_priv(dev);
881 unsigned long flags; 883 unsigned long flags;
882 884
883 spin_lock_irqsave(&db->lock, flags); 885 spin_lock_irqsave(&db->lock, flags);
@@ -886,13 +888,13 @@ dm9000_hash_table(struct net_device *dev)
886} 888}
887 889
888static void 890static void
889dm9000_mask_interrupts(board_info_t *db) 891dm9000_mask_interrupts(struct board_info *db)
890{ 892{
891 iow(db, DM9000_IMR, IMR_PAR); 893 iow(db, DM9000_IMR, IMR_PAR);
892} 894}
893 895
894static void 896static void
895dm9000_unmask_interrupts(board_info_t *db) 897dm9000_unmask_interrupts(struct board_info *db)
896{ 898{
897 iow(db, DM9000_IMR, db->imr_all); 899 iow(db, DM9000_IMR, db->imr_all);
898} 900}
@@ -903,7 +905,7 @@ dm9000_unmask_interrupts(board_info_t *db)
903static void 905static void
904dm9000_init_dm9000(struct net_device *dev) 906dm9000_init_dm9000(struct net_device *dev)
905{ 907{
906 board_info_t *db = netdev_priv(dev); 908 struct board_info *db = netdev_priv(dev);
907 unsigned int imr; 909 unsigned int imr;
908 unsigned int ncr; 910 unsigned int ncr;
909 911
@@ -968,7 +970,7 @@ dm9000_init_dm9000(struct net_device *dev)
968/* Our watchdog timed out. Called by the networking layer */ 970/* Our watchdog timed out. Called by the networking layer */
969static void dm9000_timeout(struct net_device *dev) 971static void dm9000_timeout(struct net_device *dev)
970{ 972{
971 board_info_t *db = netdev_priv(dev); 973 struct board_info *db = netdev_priv(dev);
972 u8 reg_save; 974 u8 reg_save;
973 unsigned long flags; 975 unsigned long flags;
974 976
@@ -994,7 +996,7 @@ static void dm9000_send_packet(struct net_device *dev,
994 int ip_summed, 996 int ip_summed,
995 u16 pkt_len) 997 u16 pkt_len)
996{ 998{
997 board_info_t *dm = to_dm9000_board(dev); 999 struct board_info *dm = to_dm9000_board(dev);
998 1000
999 /* The DM9000 is not smart enough to leave fragmented packets alone. */ 1001 /* The DM9000 is not smart enough to leave fragmented packets alone. */
1000 if (dm->ip_summed != ip_summed) { 1002 if (dm->ip_summed != ip_summed) {
@@ -1021,7 +1023,7 @@ static int
1021dm9000_start_xmit(struct sk_buff *skb, struct net_device *dev) 1023dm9000_start_xmit(struct sk_buff *skb, struct net_device *dev)
1022{ 1024{
1023 unsigned long flags; 1025 unsigned long flags;
1024 board_info_t *db = netdev_priv(dev); 1026 struct board_info *db = netdev_priv(dev);
1025 1027
1026 dm9000_dbg(db, 3, "%s:\n", __func__); 1028 dm9000_dbg(db, 3, "%s:\n", __func__);
1027 1029
@@ -1060,7 +1062,7 @@ dm9000_start_xmit(struct sk_buff *skb, struct net_device *dev)
1060 * receive the packet to upper layer, free the transmitted packet 1062 * receive the packet to upper layer, free the transmitted packet
1061 */ 1063 */
1062 1064
1063static void dm9000_tx_done(struct net_device *dev, board_info_t *db) 1065static void dm9000_tx_done(struct net_device *dev, struct board_info *db)
1064{ 1066{
1065 int tx_status = ior(db, DM9000_NSR); /* Got TX status */ 1067 int tx_status = ior(db, DM9000_NSR); /* Got TX status */
1066 1068
@@ -1092,7 +1094,7 @@ struct dm9000_rxhdr {
1092static void 1094static void
1093dm9000_rx(struct net_device *dev) 1095dm9000_rx(struct net_device *dev)
1094{ 1096{
1095 board_info_t *db = netdev_priv(dev); 1097 struct board_info *db = netdev_priv(dev);
1096 struct dm9000_rxhdr rxhdr; 1098 struct dm9000_rxhdr rxhdr;
1097 struct sk_buff *skb; 1099 struct sk_buff *skb;
1098 u8 rxbyte, *rdptr; 1100 u8 rxbyte, *rdptr;
@@ -1194,7 +1196,7 @@ dm9000_rx(struct net_device *dev)
1194static irqreturn_t dm9000_interrupt(int irq, void *dev_id) 1196static irqreturn_t dm9000_interrupt(int irq, void *dev_id)
1195{ 1197{
1196 struct net_device *dev = dev_id; 1198 struct net_device *dev = dev_id;
1197 board_info_t *db = netdev_priv(dev); 1199 struct board_info *db = netdev_priv(dev);
1198 int int_status; 1200 int int_status;
1199 unsigned long flags; 1201 unsigned long flags;
1200 u8 reg_save; 1202 u8 reg_save;
@@ -1244,7 +1246,7 @@ static irqreturn_t dm9000_interrupt(int irq, void *dev_id)
1244static irqreturn_t dm9000_wol_interrupt(int irq, void *dev_id) 1246static irqreturn_t dm9000_wol_interrupt(int irq, void *dev_id)
1245{ 1247{
1246 struct net_device *dev = dev_id; 1248 struct net_device *dev = dev_id;
1247 board_info_t *db = netdev_priv(dev); 1249 struct board_info *db = netdev_priv(dev);
1248 unsigned long flags; 1250 unsigned long flags;
1249 unsigned nsr, wcr; 1251 unsigned nsr, wcr;
1250 1252
@@ -1294,7 +1296,7 @@ static void dm9000_poll_controller(struct net_device *dev)
1294static int 1296static int
1295dm9000_open(struct net_device *dev) 1297dm9000_open(struct net_device *dev)
1296{ 1298{
1297 board_info_t *db = netdev_priv(dev); 1299 struct board_info *db = netdev_priv(dev);
1298 unsigned long irqflags = db->irq_res->flags & IRQF_TRIGGER_MASK; 1300 unsigned long irqflags = db->irq_res->flags & IRQF_TRIGGER_MASK;
1299 1301
1300 if (netif_msg_ifup(db)) 1302 if (netif_msg_ifup(db))
@@ -1340,7 +1342,7 @@ dm9000_open(struct net_device *dev)
1340static void 1342static void
1341dm9000_shutdown(struct net_device *dev) 1343dm9000_shutdown(struct net_device *dev)
1342{ 1344{
1343 board_info_t *db = netdev_priv(dev); 1345 struct board_info *db = netdev_priv(dev);
1344 1346
1345 /* RESET device */ 1347 /* RESET device */
1346 dm9000_phy_write(dev, 0, MII_BMCR, BMCR_RESET); /* PHY RESET */ 1348 dm9000_phy_write(dev, 0, MII_BMCR, BMCR_RESET); /* PHY RESET */
@@ -1356,7 +1358,7 @@ dm9000_shutdown(struct net_device *dev)
1356static int 1358static int
1357dm9000_stop(struct net_device *ndev) 1359dm9000_stop(struct net_device *ndev)
1358{ 1360{
1359 board_info_t *db = netdev_priv(ndev); 1361 struct board_info *db = netdev_priv(ndev);
1360 1362
1361 if (netif_msg_ifdown(db)) 1363 if (netif_msg_ifdown(db))
1362 dev_dbg(db->dev, "shutting down %s\n", ndev->name); 1364 dev_dbg(db->dev, "shutting down %s\n", ndev->name);
@@ -1679,7 +1681,7 @@ dm9000_drv_suspend(struct device *dev)
1679{ 1681{
1680 struct platform_device *pdev = to_platform_device(dev); 1682 struct platform_device *pdev = to_platform_device(dev);
1681 struct net_device *ndev = platform_get_drvdata(pdev); 1683 struct net_device *ndev = platform_get_drvdata(pdev);
1682 board_info_t *db; 1684 struct board_info *db;
1683 1685
1684 if (ndev) { 1686 if (ndev) {
1685 db = netdev_priv(ndev); 1687 db = netdev_priv(ndev);
@@ -1702,7 +1704,7 @@ dm9000_drv_resume(struct device *dev)
1702{ 1704{
1703 struct platform_device *pdev = to_platform_device(dev); 1705 struct platform_device *pdev = to_platform_device(dev);
1704 struct net_device *ndev = platform_get_drvdata(pdev); 1706 struct net_device *ndev = platform_get_drvdata(pdev);
1705 board_info_t *db = netdev_priv(ndev); 1707 struct board_info *db = netdev_priv(ndev);
1706 1708
1707 if (ndev) { 1709 if (ndev) {
1708 if (netif_running(ndev)) { 1710 if (netif_running(ndev)) {