aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/phy
diff options
context:
space:
mode:
authorJoe Perches <joe@perches.com>2012-06-09 03:49:07 -0400
committerDavid S. Miller <davem@davemloft.net>2012-06-11 19:58:24 -0400
commit8d242488ce4627dd7e6333caab56df11ea25e239 (patch)
tree61d464de218ba9cb22d15735a54b49d230068c16 /drivers/net/phy
parentde74e92aa8a44d0b80a53601dc4f6dd6afcb8453 (diff)
phy: Use pr_<level>
Use a more current logging style. Add pr_fmt and missing newlines. Remove embedded prefixes. Neaten phy_print_status to avoid using KERN_CONT. Signed-off-by: Joe Perches <joe@perches.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/phy')
-rw-r--r--drivers/net/phy/dp83640.c23
-rw-r--r--drivers/net/phy/fixed.c4
-rw-r--r--drivers/net/phy/mdio_bus.c5
-rw-r--r--drivers/net/phy/national.c8
-rw-r--r--drivers/net/phy/phy.c35
-rw-r--r--drivers/net/phy/phy_device.c7
-rw-r--r--drivers/net/phy/spi_ks8995.c4
7 files changed, 50 insertions, 36 deletions
diff --git a/drivers/net/phy/dp83640.c b/drivers/net/phy/dp83640.c
index 940b29022d0c..b0da0226661f 100644
--- a/drivers/net/phy/dp83640.c
+++ b/drivers/net/phy/dp83640.c
@@ -17,6 +17,9 @@
17 * along with this program; if not, write to the Free Software 17 * along with this program; if not, write to the Free Software
18 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 18 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
19 */ 19 */
20
21#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
22
20#include <linux/ethtool.h> 23#include <linux/ethtool.h>
21#include <linux/kernel.h> 24#include <linux/kernel.h>
22#include <linux/list.h> 25#include <linux/list.h>
@@ -453,16 +456,16 @@ static void enable_status_frames(struct phy_device *phydev, bool on)
453 ext_write(0, phydev, PAGE6, PSF_CFG1, ver); 456 ext_write(0, phydev, PAGE6, PSF_CFG1, ver);
454 457
455 if (!phydev->attached_dev) { 458 if (!phydev->attached_dev) {
456 pr_warning("dp83640: expected to find an attached netdevice\n"); 459 pr_warn("expected to find an attached netdevice\n");
457 return; 460 return;
458 } 461 }
459 462
460 if (on) { 463 if (on) {
461 if (dev_mc_add(phydev->attached_dev, status_frame_dst)) 464 if (dev_mc_add(phydev->attached_dev, status_frame_dst))
462 pr_warning("dp83640: failed to add mc address\n"); 465 pr_warn("failed to add mc address\n");
463 } else { 466 } else {
464 if (dev_mc_del(phydev->attached_dev, status_frame_dst)) 467 if (dev_mc_del(phydev->attached_dev, status_frame_dst))
465 pr_warning("dp83640: failed to delete mc address\n"); 468 pr_warn("failed to delete mc address\n");
466 } 469 }
467} 470}
468 471
@@ -582,9 +585,9 @@ static void recalibrate(struct dp83640_clock *clock)
582 * read out and correct offsets 585 * read out and correct offsets
583 */ 586 */
584 val = ext_read(master, PAGE4, PTP_STS); 587 val = ext_read(master, PAGE4, PTP_STS);
585 pr_info("master PTP_STS 0x%04hx", val); 588 pr_info("master PTP_STS 0x%04hx\n", val);
586 val = ext_read(master, PAGE4, PTP_ESTS); 589 val = ext_read(master, PAGE4, PTP_ESTS);
587 pr_info("master PTP_ESTS 0x%04hx", val); 590 pr_info("master PTP_ESTS 0x%04hx\n", val);
588 event_ts.ns_lo = ext_read(master, PAGE4, PTP_EDATA); 591 event_ts.ns_lo = ext_read(master, PAGE4, PTP_EDATA);
589 event_ts.ns_hi = ext_read(master, PAGE4, PTP_EDATA); 592 event_ts.ns_hi = ext_read(master, PAGE4, PTP_EDATA);
590 event_ts.sec_lo = ext_read(master, PAGE4, PTP_EDATA); 593 event_ts.sec_lo = ext_read(master, PAGE4, PTP_EDATA);
@@ -594,9 +597,9 @@ static void recalibrate(struct dp83640_clock *clock)
594 list_for_each(this, &clock->phylist) { 597 list_for_each(this, &clock->phylist) {
595 tmp = list_entry(this, struct dp83640_private, list); 598 tmp = list_entry(this, struct dp83640_private, list);
596 val = ext_read(tmp->phydev, PAGE4, PTP_STS); 599 val = ext_read(tmp->phydev, PAGE4, PTP_STS);
597 pr_info("slave PTP_STS 0x%04hx", val); 600 pr_info("slave PTP_STS 0x%04hx\n", val);
598 val = ext_read(tmp->phydev, PAGE4, PTP_ESTS); 601 val = ext_read(tmp->phydev, PAGE4, PTP_ESTS);
599 pr_info("slave PTP_ESTS 0x%04hx", val); 602 pr_info("slave PTP_ESTS 0x%04hx\n", val);
600 event_ts.ns_lo = ext_read(tmp->phydev, PAGE4, PTP_EDATA); 603 event_ts.ns_lo = ext_read(tmp->phydev, PAGE4, PTP_EDATA);
601 event_ts.ns_hi = ext_read(tmp->phydev, PAGE4, PTP_EDATA); 604 event_ts.ns_hi = ext_read(tmp->phydev, PAGE4, PTP_EDATA);
602 event_ts.sec_lo = ext_read(tmp->phydev, PAGE4, PTP_EDATA); 605 event_ts.sec_lo = ext_read(tmp->phydev, PAGE4, PTP_EDATA);
@@ -686,7 +689,7 @@ static void decode_rxts(struct dp83640_private *dp83640,
686 prune_rx_ts(dp83640); 689 prune_rx_ts(dp83640);
687 690
688 if (list_empty(&dp83640->rxpool)) { 691 if (list_empty(&dp83640->rxpool)) {
689 pr_debug("dp83640: rx timestamp pool is empty\n"); 692 pr_debug("rx timestamp pool is empty\n");
690 goto out; 693 goto out;
691 } 694 }
692 rxts = list_first_entry(&dp83640->rxpool, struct rxts, list); 695 rxts = list_first_entry(&dp83640->rxpool, struct rxts, list);
@@ -709,7 +712,7 @@ static void decode_txts(struct dp83640_private *dp83640,
709 skb = skb_dequeue(&dp83640->tx_queue); 712 skb = skb_dequeue(&dp83640->tx_queue);
710 713
711 if (!skb) { 714 if (!skb) {
712 pr_debug("dp83640: have timestamp but tx_queue empty\n"); 715 pr_debug("have timestamp but tx_queue empty\n");
713 return; 716 return;
714 } 717 }
715 ns = phy2txts(phy_txts); 718 ns = phy2txts(phy_txts);
@@ -847,7 +850,7 @@ static void dp83640_free_clocks(void)
847 list_for_each_safe(this, next, &phyter_clocks) { 850 list_for_each_safe(this, next, &phyter_clocks) {
848 clock = list_entry(this, struct dp83640_clock, list); 851 clock = list_entry(this, struct dp83640_clock, list);
849 if (!list_empty(&clock->phylist)) { 852 if (!list_empty(&clock->phylist)) {
850 pr_warning("phy list non-empty while unloading"); 853 pr_warn("phy list non-empty while unloading\n");
851 BUG(); 854 BUG();
852 } 855 }
853 list_del(&clock->list); 856 list_del(&clock->list);
diff --git a/drivers/net/phy/fixed.c b/drivers/net/phy/fixed.c
index 633680d0828e..ba55adfc7aae 100644
--- a/drivers/net/phy/fixed.c
+++ b/drivers/net/phy/fixed.c
@@ -70,7 +70,7 @@ static int fixed_phy_update_regs(struct fixed_phy *fp)
70 lpa |= LPA_10FULL; 70 lpa |= LPA_10FULL;
71 break; 71 break;
72 default: 72 default:
73 printk(KERN_WARNING "fixed phy: unknown speed\n"); 73 pr_warn("fixed phy: unknown speed\n");
74 return -EINVAL; 74 return -EINVAL;
75 } 75 }
76 } else { 76 } else {
@@ -90,7 +90,7 @@ static int fixed_phy_update_regs(struct fixed_phy *fp)
90 lpa |= LPA_10HALF; 90 lpa |= LPA_10HALF;
91 break; 91 break;
92 default: 92 default:
93 printk(KERN_WARNING "fixed phy: unknown speed\n"); 93 pr_warn("fixed phy: unknown speed\n");
94 return -EINVAL; 94 return -EINVAL;
95 } 95 }
96 } 96 }
diff --git a/drivers/net/phy/mdio_bus.c b/drivers/net/phy/mdio_bus.c
index 683ef1ce5519..d4a4992b4935 100644
--- a/drivers/net/phy/mdio_bus.c
+++ b/drivers/net/phy/mdio_bus.c
@@ -13,6 +13,9 @@
13 * option) any later version. 13 * option) any later version.
14 * 14 *
15 */ 15 */
16
17#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
18
16#include <linux/kernel.h> 19#include <linux/kernel.h>
17#include <linux/string.h> 20#include <linux/string.h>
18#include <linux/errno.h> 21#include <linux/errno.h>
@@ -148,7 +151,7 @@ int mdiobus_register(struct mii_bus *bus)
148 151
149 err = device_register(&bus->dev); 152 err = device_register(&bus->dev);
150 if (err) { 153 if (err) {
151 printk(KERN_ERR "mii_bus %s failed to register\n", bus->id); 154 pr_err("mii_bus %s failed to register\n", bus->id);
152 return -EINVAL; 155 return -EINVAL;
153 } 156 }
154 157
diff --git a/drivers/net/phy/national.c b/drivers/net/phy/national.c
index 04bb8fcc0cb5..9a5f234d95b0 100644
--- a/drivers/net/phy/national.c
+++ b/drivers/net/phy/national.c
@@ -15,6 +15,8 @@
15 * 15 *
16 */ 16 */
17 17
18#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
19
18#include <linux/kernel.h> 20#include <linux/kernel.h>
19#include <linux/module.h> 21#include <linux/module.h>
20#include <linux/mii.h> 22#include <linux/mii.h>
@@ -22,6 +24,8 @@
22#include <linux/phy.h> 24#include <linux/phy.h>
23#include <linux/netdevice.h> 25#include <linux/netdevice.h>
24 26
27#define DEBUG
28
25/* DP83865 phy identifier values */ 29/* DP83865 phy identifier values */
26#define DP83865_PHY_ID 0x20005c7a 30#define DP83865_PHY_ID 0x20005c7a
27 31
@@ -112,8 +116,8 @@ static void ns_10_base_t_hdx_loopack(struct phy_device *phydev, int disable)
112 ns_exp_write(phydev, 0x1c0, 116 ns_exp_write(phydev, 0x1c0,
113 ns_exp_read(phydev, 0x1c0) & 0xfffe); 117 ns_exp_read(phydev, 0x1c0) & 0xfffe);
114 118
115 printk(KERN_DEBUG "DP83865 PHY: 10BASE-T HDX loopback %s\n", 119 pr_debug("10BASE-T HDX loopback %s\n",
116 (ns_exp_read(phydev, 0x1c0) & 0x0001) ? "off" : "on"); 120 (ns_exp_read(phydev, 0x1c0) & 0x0001) ? "off" : "on");
117} 121}
118 122
119static int ns_config_init(struct phy_device *phydev) 123static int ns_config_init(struct phy_device *phydev)
diff --git a/drivers/net/phy/phy.c b/drivers/net/phy/phy.c
index 3cbda0851f83..2e1c23731ded 100644
--- a/drivers/net/phy/phy.c
+++ b/drivers/net/phy/phy.c
@@ -15,6 +15,9 @@
15 * option) any later version. 15 * option) any later version.
16 * 16 *
17 */ 17 */
18
19#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
20
18#include <linux/kernel.h> 21#include <linux/kernel.h>
19#include <linux/string.h> 22#include <linux/string.h>
20#include <linux/errno.h> 23#include <linux/errno.h>
@@ -44,18 +47,16 @@
44 */ 47 */
45void phy_print_status(struct phy_device *phydev) 48void phy_print_status(struct phy_device *phydev)
46{ 49{
47 pr_info("PHY: %s - Link is %s", dev_name(&phydev->dev),
48 phydev->link ? "Up" : "Down");
49 if (phydev->link) 50 if (phydev->link)
50 printk(KERN_CONT " - %d/%s", phydev->speed, 51 pr_info("%s - Link is Up - %d/%s\n",
51 DUPLEX_FULL == phydev->duplex ? 52 dev_name(&phydev->dev),
52 "Full" : "Half"); 53 phydev->speed,
53 54 DUPLEX_FULL == phydev->duplex ? "Full" : "Half");
54 printk(KERN_CONT "\n"); 55 else
56 pr_info("%s - Link is Down\n", dev_name(&phydev->dev));
55} 57}
56EXPORT_SYMBOL(phy_print_status); 58EXPORT_SYMBOL(phy_print_status);
57 59
58
59/** 60/**
60 * phy_clear_interrupt - Ack the phy device's interrupt 61 * phy_clear_interrupt - Ack the phy device's interrupt
61 * @phydev: the phy_device struct 62 * @phydev: the phy_device struct
@@ -482,9 +483,8 @@ static void phy_force_reduction(struct phy_device *phydev)
482 phydev->speed = settings[idx].speed; 483 phydev->speed = settings[idx].speed;
483 phydev->duplex = settings[idx].duplex; 484 phydev->duplex = settings[idx].duplex;
484 485
485 pr_info("Trying %d/%s\n", phydev->speed, 486 pr_info("Trying %d/%s\n",
486 DUPLEX_FULL == phydev->duplex ? 487 phydev->speed, DUPLEX_FULL == phydev->duplex ? "FULL" : "HALF");
487 "FULL" : "HALF");
488} 488}
489 489
490 490
@@ -598,9 +598,8 @@ int phy_start_interrupts(struct phy_device *phydev)
598 IRQF_SHARED, 598 IRQF_SHARED,
599 "phy_interrupt", 599 "phy_interrupt",
600 phydev) < 0) { 600 phydev) < 0) {
601 printk(KERN_WARNING "%s: Can't get IRQ %d (PHY)\n", 601 pr_warn("%s: Can't get IRQ %d (PHY)\n",
602 phydev->bus->name, 602 phydev->bus->name, phydev->irq);
603 phydev->irq);
604 phydev->irq = PHY_POLL; 603 phydev->irq = PHY_POLL;
605 return 0; 604 return 0;
606 } 605 }
@@ -838,10 +837,10 @@ void phy_state_machine(struct work_struct *work)
838 837
839 phydev->autoneg = AUTONEG_DISABLE; 838 phydev->autoneg = AUTONEG_DISABLE;
840 839
841 pr_info("Trying %d/%s\n", phydev->speed, 840 pr_info("Trying %d/%s\n",
842 DUPLEX_FULL == 841 phydev->speed,
843 phydev->duplex ? 842 DUPLEX_FULL == phydev->duplex ?
844 "FULL" : "HALF"); 843 "FULL" : "HALF");
845 } 844 }
846 break; 845 break;
847 case PHY_NOLINK: 846 case PHY_NOLINK:
diff --git a/drivers/net/phy/phy_device.c b/drivers/net/phy/phy_device.c
index de86a5582224..18ab0daf4490 100644
--- a/drivers/net/phy/phy_device.c
+++ b/drivers/net/phy/phy_device.c
@@ -14,6 +14,9 @@
14 * option) any later version. 14 * option) any later version.
15 * 15 *
16 */ 16 */
17
18#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
19
17#include <linux/kernel.h> 20#include <linux/kernel.h>
18#include <linux/string.h> 21#include <linux/string.h>
19#include <linux/errno.h> 22#include <linux/errno.h>
@@ -975,8 +978,8 @@ int phy_driver_register(struct phy_driver *new_driver)
975 retval = driver_register(&new_driver->driver); 978 retval = driver_register(&new_driver->driver);
976 979
977 if (retval) { 980 if (retval) {
978 printk(KERN_ERR "%s: Error %d in registering driver\n", 981 pr_err("%s: Error %d in registering driver\n",
979 new_driver->name, retval); 982 new_driver->name, retval);
980 983
981 return retval; 984 return retval;
982 } 985 }
diff --git a/drivers/net/phy/spi_ks8995.c b/drivers/net/phy/spi_ks8995.c
index 4eb98bc52a0a..1c3abce78b6a 100644
--- a/drivers/net/phy/spi_ks8995.c
+++ b/drivers/net/phy/spi_ks8995.c
@@ -11,6 +11,8 @@
11 * by the Free Software Foundation. 11 * by the Free Software Foundation.
12 */ 12 */
13 13
14#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
15
14#include <linux/types.h> 16#include <linux/types.h>
15#include <linux/kernel.h> 17#include <linux/kernel.h>
16#include <linux/init.h> 18#include <linux/init.h>
@@ -356,7 +358,7 @@ static struct spi_driver ks8995_driver = {
356 358
357static int __init ks8995_init(void) 359static int __init ks8995_init(void)
358{ 360{
359 printk(KERN_INFO DRV_DESC " version " DRV_VERSION"\n"); 361 pr_info(DRV_DESC " version " DRV_VERSION "\n");
360 362
361 return spi_register_driver(&ks8995_driver); 363 return spi_register_driver(&ks8995_driver);
362} 364}