diff options
author | Joe Perches <joe@perches.com> | 2014-11-09 19:32:46 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2014-11-11 13:30:57 -0500 |
commit | a2ae6007a442d6bb27d77bf20ec1b06cda9e306e (patch) | |
tree | 6bf28d8f5d0e87c274465178e7ef211f3a1c1a9f /net/dsa/dsa.c | |
parent | 008e81656c32e34c0b248bd203872d15be8770b7 (diff) |
dsa: Use netdev_<level> instead of printk
Neaten and standardize the logging output.
Other miscellanea:
o Use pr_notice_once instead of a guard flag.
o Convert existing pr_<level> uses too.
Signed-off-by: Joe Perches <joe@perches.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/dsa/dsa.c')
-rw-r--r-- | net/dsa/dsa.c | 28 |
1 files changed, 12 insertions, 16 deletions
diff --git a/net/dsa/dsa.c b/net/dsa/dsa.c index dd646a8025cb..4648f12098ad 100644 --- a/net/dsa/dsa.c +++ b/net/dsa/dsa.c | |||
@@ -192,12 +192,12 @@ dsa_switch_setup(struct dsa_switch_tree *dst, int index, | |||
192 | */ | 192 | */ |
193 | drv = dsa_switch_probe(host_dev, pd->sw_addr, &name); | 193 | drv = dsa_switch_probe(host_dev, pd->sw_addr, &name); |
194 | if (drv == NULL) { | 194 | if (drv == NULL) { |
195 | printk(KERN_ERR "%s[%d]: could not detect attached switch\n", | 195 | netdev_err(dst->master_netdev, "[%d]: could not detect attached switch\n", |
196 | dst->master_netdev->name, index); | 196 | index); |
197 | return ERR_PTR(-EINVAL); | 197 | return ERR_PTR(-EINVAL); |
198 | } | 198 | } |
199 | printk(KERN_INFO "%s[%d]: detected a %s switch\n", | 199 | netdev_info(dst->master_netdev, "[%d]: detected a %s switch\n", |
200 | dst->master_netdev->name, index, name); | 200 | index, name); |
201 | 201 | ||
202 | 202 | ||
203 | /* | 203 | /* |
@@ -225,7 +225,8 @@ dsa_switch_setup(struct dsa_switch_tree *dst, int index, | |||
225 | 225 | ||
226 | if (!strcmp(name, "cpu")) { | 226 | if (!strcmp(name, "cpu")) { |
227 | if (dst->cpu_switch != -1) { | 227 | if (dst->cpu_switch != -1) { |
228 | printk(KERN_ERR "multiple cpu ports?!\n"); | 228 | netdev_err(dst->master_netdev, |
229 | "multiple cpu ports?!\n"); | ||
229 | ret = -EINVAL; | 230 | ret = -EINVAL; |
230 | goto out; | 231 | goto out; |
231 | } | 232 | } |
@@ -320,10 +321,8 @@ dsa_switch_setup(struct dsa_switch_tree *dst, int index, | |||
320 | 321 | ||
321 | slave_dev = dsa_slave_create(ds, parent, i, pd->port_names[i]); | 322 | slave_dev = dsa_slave_create(ds, parent, i, pd->port_names[i]); |
322 | if (slave_dev == NULL) { | 323 | if (slave_dev == NULL) { |
323 | printk(KERN_ERR "%s[%d]: can't create dsa " | 324 | netdev_err(dst->master_netdev, "[%d]: can't create dsa slave device for port %d(%s)\n", |
324 | "slave device for port %d(%s)\n", | 325 | index, i, pd->port_names[i]); |
325 | dst->master_netdev->name, | ||
326 | index, i, pd->port_names[i]); | ||
327 | continue; | 326 | continue; |
328 | } | 327 | } |
329 | 328 | ||
@@ -701,15 +700,13 @@ static inline void dsa_of_remove(struct platform_device *pdev) | |||
701 | 700 | ||
702 | static int dsa_probe(struct platform_device *pdev) | 701 | static int dsa_probe(struct platform_device *pdev) |
703 | { | 702 | { |
704 | static int dsa_version_printed; | ||
705 | struct dsa_platform_data *pd = pdev->dev.platform_data; | 703 | struct dsa_platform_data *pd = pdev->dev.platform_data; |
706 | struct net_device *dev; | 704 | struct net_device *dev; |
707 | struct dsa_switch_tree *dst; | 705 | struct dsa_switch_tree *dst; |
708 | int i, ret; | 706 | int i, ret; |
709 | 707 | ||
710 | if (!dsa_version_printed++) | 708 | pr_notice_once("Distributed Switch Architecture driver version %s\n", |
711 | printk(KERN_NOTICE "Distributed Switch Architecture " | 709 | dsa_driver_version); |
712 | "driver version %s\n", dsa_driver_version); | ||
713 | 710 | ||
714 | if (pdev->dev.of_node) { | 711 | if (pdev->dev.of_node) { |
715 | ret = dsa_of_probe(pdev); | 712 | ret = dsa_of_probe(pdev); |
@@ -753,9 +750,8 @@ static int dsa_probe(struct platform_device *pdev) | |||
753 | 750 | ||
754 | ds = dsa_switch_setup(dst, i, &pdev->dev, pd->chip[i].host_dev); | 751 | ds = dsa_switch_setup(dst, i, &pdev->dev, pd->chip[i].host_dev); |
755 | if (IS_ERR(ds)) { | 752 | if (IS_ERR(ds)) { |
756 | printk(KERN_ERR "%s[%d]: couldn't create dsa switch " | 753 | netdev_err(dev, "[%d]: couldn't create dsa switch instance (error %ld)\n", |
757 | "instance (error %ld)\n", dev->name, i, | 754 | i, PTR_ERR(ds)); |
758 | PTR_ERR(ds)); | ||
759 | continue; | 755 | continue; |
760 | } | 756 | } |
761 | 757 | ||