diff options
author | Anatolij Gustschin <agust@denx.de> | 2010-02-26 07:00:47 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2010-02-27 05:34:35 -0500 |
commit | fcb6a1c83e48c30ff99624e9c46ce301707ede05 (patch) | |
tree | 8dfa3e911cb3ac5dd725fc4980b636d0e6e54693 | |
parent | ce300c7ffa61165f9bfd16e511ee0cd4114977ab (diff) |
fs_enet: use dev_xxx instead of printk
Signed-off-by: Anatolij Gustschin <agust@denx.de>
Acked-by: Grant Likely <grant.likely@secretlab.ca>
Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r-- | drivers/net/fs_enet/fs_enet-main.c | 39 | ||||
-rw-r--r-- | drivers/net/fs_enet/mac-fcc.c | 5 | ||||
-rw-r--r-- | drivers/net/fs_enet/mac-fec.c | 12 | ||||
-rw-r--r-- | drivers/net/fs_enet/mac-scc.c | 9 |
4 files changed, 27 insertions, 38 deletions
diff --git a/drivers/net/fs_enet/fs_enet-main.c b/drivers/net/fs_enet/fs_enet-main.c index ec2f5034457..c34a7e0a28e 100644 --- a/drivers/net/fs_enet/fs_enet-main.c +++ b/drivers/net/fs_enet/fs_enet-main.c | |||
@@ -108,9 +108,7 @@ static int fs_enet_rx_napi(struct napi_struct *napi, int budget) | |||
108 | * the last indicator should be set. | 108 | * the last indicator should be set. |
109 | */ | 109 | */ |
110 | if ((sc & BD_ENET_RX_LAST) == 0) | 110 | if ((sc & BD_ENET_RX_LAST) == 0) |
111 | printk(KERN_WARNING DRV_MODULE_NAME | 111 | dev_warn(fep->dev, "rcv is not +last\n"); |
112 | ": %s rcv is not +last\n", | ||
113 | dev->name); | ||
114 | 112 | ||
115 | /* | 113 | /* |
116 | * Check for errors. | 114 | * Check for errors. |
@@ -178,9 +176,8 @@ static int fs_enet_rx_napi(struct napi_struct *napi, int budget) | |||
178 | received++; | 176 | received++; |
179 | netif_receive_skb(skb); | 177 | netif_receive_skb(skb); |
180 | } else { | 178 | } else { |
181 | printk(KERN_WARNING DRV_MODULE_NAME | 179 | dev_warn(fep->dev, |
182 | ": %s Memory squeeze, dropping packet.\n", | 180 | "Memory squeeze, dropping packet.\n"); |
183 | dev->name); | ||
184 | fep->stats.rx_dropped++; | 181 | fep->stats.rx_dropped++; |
185 | skbn = skb; | 182 | skbn = skb; |
186 | } | 183 | } |
@@ -242,9 +239,7 @@ static int fs_enet_rx_non_napi(struct net_device *dev) | |||
242 | * the last indicator should be set. | 239 | * the last indicator should be set. |
243 | */ | 240 | */ |
244 | if ((sc & BD_ENET_RX_LAST) == 0) | 241 | if ((sc & BD_ENET_RX_LAST) == 0) |
245 | printk(KERN_WARNING DRV_MODULE_NAME | 242 | dev_warn(fep->dev, "rcv is not +last\n"); |
246 | ": %s rcv is not +last\n", | ||
247 | dev->name); | ||
248 | 243 | ||
249 | /* | 244 | /* |
250 | * Check for errors. | 245 | * Check for errors. |
@@ -313,9 +308,8 @@ static int fs_enet_rx_non_napi(struct net_device *dev) | |||
313 | received++; | 308 | received++; |
314 | netif_rx(skb); | 309 | netif_rx(skb); |
315 | } else { | 310 | } else { |
316 | printk(KERN_WARNING DRV_MODULE_NAME | 311 | dev_warn(fep->dev, |
317 | ": %s Memory squeeze, dropping packet.\n", | 312 | "Memory squeeze, dropping packet.\n"); |
318 | dev->name); | ||
319 | fep->stats.rx_dropped++; | 313 | fep->stats.rx_dropped++; |
320 | skbn = skb; | 314 | skbn = skb; |
321 | } | 315 | } |
@@ -388,10 +382,10 @@ static void fs_enet_tx(struct net_device *dev) | |||
388 | } else | 382 | } else |
389 | fep->stats.tx_packets++; | 383 | fep->stats.tx_packets++; |
390 | 384 | ||
391 | if (sc & BD_ENET_TX_READY) | 385 | if (sc & BD_ENET_TX_READY) { |
392 | printk(KERN_WARNING DRV_MODULE_NAME | 386 | dev_warn(fep->dev, |
393 | ": %s HEY! Enet xmit interrupt and TX_READY.\n", | 387 | "HEY! Enet xmit interrupt and TX_READY.\n"); |
394 | dev->name); | 388 | } |
395 | 389 | ||
396 | /* | 390 | /* |
397 | * Deferred means some collisions occurred during transmit, | 391 | * Deferred means some collisions occurred during transmit, |
@@ -511,9 +505,8 @@ void fs_init_bds(struct net_device *dev) | |||
511 | for (i = 0, bdp = fep->rx_bd_base; i < fep->rx_ring; i++, bdp++) { | 505 | for (i = 0, bdp = fep->rx_bd_base; i < fep->rx_ring; i++, bdp++) { |
512 | skb = dev_alloc_skb(ENET_RX_FRSIZE); | 506 | skb = dev_alloc_skb(ENET_RX_FRSIZE); |
513 | if (skb == NULL) { | 507 | if (skb == NULL) { |
514 | printk(KERN_WARNING DRV_MODULE_NAME | 508 | dev_warn(fep->dev, |
515 | ": %s Memory squeeze, unable to allocate skb\n", | 509 | "Memory squeeze, unable to allocate skb\n"); |
516 | dev->name); | ||
517 | break; | 510 | break; |
518 | } | 511 | } |
519 | skb_align(skb, ENET_RX_ALIGN); | 512 | skb_align(skb, ENET_RX_ALIGN); |
@@ -610,8 +603,7 @@ static int fs_enet_start_xmit(struct sk_buff *skb, struct net_device *dev) | |||
610 | * Ooops. All transmit buffers are full. Bail out. | 603 | * Ooops. All transmit buffers are full. Bail out. |
611 | * This should not happen, since the tx queue should be stopped. | 604 | * This should not happen, since the tx queue should be stopped. |
612 | */ | 605 | */ |
613 | printk(KERN_WARNING DRV_MODULE_NAME | 606 | dev_warn(fep->dev, "tx queue full!.\n"); |
614 | ": %s tx queue full!.\n", dev->name); | ||
615 | return NETDEV_TX_BUSY; | 607 | return NETDEV_TX_BUSY; |
616 | } | 608 | } |
617 | 609 | ||
@@ -788,8 +780,7 @@ static int fs_enet_open(struct net_device *dev) | |||
788 | r = request_irq(fep->interrupt, fs_enet_interrupt, IRQF_SHARED, | 780 | r = request_irq(fep->interrupt, fs_enet_interrupt, IRQF_SHARED, |
789 | "fs_enet-mac", dev); | 781 | "fs_enet-mac", dev); |
790 | if (r != 0) { | 782 | if (r != 0) { |
791 | printk(KERN_ERR DRV_MODULE_NAME | 783 | dev_err(fep->dev, "Could not allocate FS_ENET IRQ!"); |
792 | ": %s Could not allocate FS_ENET IRQ!", dev->name); | ||
793 | if (fep->fpi->use_napi) | 784 | if (fep->fpi->use_napi) |
794 | napi_disable(&fep->napi); | 785 | napi_disable(&fep->napi); |
795 | return -EINVAL; | 786 | return -EINVAL; |
@@ -1053,7 +1044,7 @@ static int __devinit fs_enet_probe(struct of_device *ofdev, | |||
1053 | if (ret) | 1044 | if (ret) |
1054 | goto out_free_bd; | 1045 | goto out_free_bd; |
1055 | 1046 | ||
1056 | printk(KERN_INFO "%s: fs_enet: %pM\n", ndev->name, ndev->dev_addr); | 1047 | pr_info("%s: fs_enet: %pM\n", ndev->name, ndev->dev_addr); |
1057 | 1048 | ||
1058 | return 0; | 1049 | return 0; |
1059 | 1050 | ||
diff --git a/drivers/net/fs_enet/mac-fcc.c b/drivers/net/fs_enet/mac-fcc.c index a761d31e3d6..cf4f674f9e2 100644 --- a/drivers/net/fs_enet/mac-fcc.c +++ b/drivers/net/fs_enet/mac-fcc.c | |||
@@ -476,8 +476,9 @@ static void clear_int_events(struct net_device *dev, u32 int_events) | |||
476 | 476 | ||
477 | static void ev_error(struct net_device *dev, u32 int_events) | 477 | static void ev_error(struct net_device *dev, u32 int_events) |
478 | { | 478 | { |
479 | printk(KERN_WARNING DRV_MODULE_NAME | 479 | struct fs_enet_private *fep = netdev_priv(dev); |
480 | ": %s FS_ENET ERROR(s) 0x%x\n", dev->name, int_events); | 480 | |
481 | dev_warn(fep->dev, "FS_ENET ERROR(s) 0x%x\n", int_events); | ||
481 | } | 482 | } |
482 | 483 | ||
483 | static int get_regs(struct net_device *dev, void *p, int *sizep) | 484 | static int get_regs(struct net_device *dev, void *p, int *sizep) |
diff --git a/drivers/net/fs_enet/mac-fec.c b/drivers/net/fs_enet/mac-fec.c index ca806d1ab3f..8a632f668c1 100644 --- a/drivers/net/fs_enet/mac-fec.c +++ b/drivers/net/fs_enet/mac-fec.c | |||
@@ -257,8 +257,7 @@ static void restart(struct net_device *dev) | |||
257 | 257 | ||
258 | r = whack_reset(fep->fec.fecp); | 258 | r = whack_reset(fep->fec.fecp); |
259 | if (r != 0) | 259 | if (r != 0) |
260 | printk(KERN_ERR DRV_MODULE_NAME | 260 | dev_err(fep->dev, "FEC Reset FAILED!\n"); |
261 | ": %s FEC Reset FAILED!\n", dev->name); | ||
262 | /* | 261 | /* |
263 | * Set station address. | 262 | * Set station address. |
264 | */ | 263 | */ |
@@ -355,9 +354,7 @@ static void stop(struct net_device *dev) | |||
355 | udelay(1); | 354 | udelay(1); |
356 | 355 | ||
357 | if (i == FEC_RESET_DELAY) | 356 | if (i == FEC_RESET_DELAY) |
358 | printk(KERN_WARNING DRV_MODULE_NAME | 357 | dev_warn(fep->dev, "FEC timeout on graceful transmit stop\n"); |
359 | ": %s FEC timeout on graceful transmit stop\n", | ||
360 | dev->name); | ||
361 | /* | 358 | /* |
362 | * Disable FEC. Let only MII interrupts. | 359 | * Disable FEC. Let only MII interrupts. |
363 | */ | 360 | */ |
@@ -433,8 +430,9 @@ static void clear_int_events(struct net_device *dev, u32 int_events) | |||
433 | 430 | ||
434 | static void ev_error(struct net_device *dev, u32 int_events) | 431 | static void ev_error(struct net_device *dev, u32 int_events) |
435 | { | 432 | { |
436 | printk(KERN_WARNING DRV_MODULE_NAME | 433 | struct fs_enet_private *fep = netdev_priv(dev); |
437 | ": %s FEC ERROR(s) 0x%x\n", dev->name, int_events); | 434 | |
435 | dev_warn(fep->dev, "FEC ERROR(s) 0x%x\n", int_events); | ||
438 | } | 436 | } |
439 | 437 | ||
440 | static int get_regs(struct net_device *dev, void *p, int *sizep) | 438 | static int get_regs(struct net_device *dev, void *p, int *sizep) |
diff --git a/drivers/net/fs_enet/mac-scc.c b/drivers/net/fs_enet/mac-scc.c index 5bfc99b9475..c490a466cae 100644 --- a/drivers/net/fs_enet/mac-scc.c +++ b/drivers/net/fs_enet/mac-scc.c | |||
@@ -367,9 +367,7 @@ static void stop(struct net_device *dev) | |||
367 | udelay(1); | 367 | udelay(1); |
368 | 368 | ||
369 | if (i == SCC_RESET_DELAY) | 369 | if (i == SCC_RESET_DELAY) |
370 | printk(KERN_WARNING DRV_MODULE_NAME | 370 | dev_warn(fep->dev, "SCC timeout on graceful transmit stop\n"); |
371 | ": %s SCC timeout on graceful transmit stop\n", | ||
372 | dev->name); | ||
373 | 371 | ||
374 | W16(sccp, scc_sccm, 0); | 372 | W16(sccp, scc_sccm, 0); |
375 | C32(sccp, scc_gsmrl, SCC_GSMRL_ENR | SCC_GSMRL_ENT); | 373 | C32(sccp, scc_gsmrl, SCC_GSMRL_ENR | SCC_GSMRL_ENT); |
@@ -429,8 +427,9 @@ static void clear_int_events(struct net_device *dev, u32 int_events) | |||
429 | 427 | ||
430 | static void ev_error(struct net_device *dev, u32 int_events) | 428 | static void ev_error(struct net_device *dev, u32 int_events) |
431 | { | 429 | { |
432 | printk(KERN_WARNING DRV_MODULE_NAME | 430 | struct fs_enet_private *fep = netdev_priv(dev); |
433 | ": %s SCC ERROR(s) 0x%x\n", dev->name, int_events); | 431 | |
432 | dev_warn(fep->dev, "SCC ERROR(s) 0x%x\n", int_events); | ||
434 | } | 433 | } |
435 | 434 | ||
436 | static int get_regs(struct net_device *dev, void *p, int *sizep) | 435 | static int get_regs(struct net_device *dev, void *p, int *sizep) |