aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/usb/dm9601.c
diff options
context:
space:
mode:
authorJoe Perches <joe@perches.com>2010-02-17 05:30:23 -0500
committerDavid S. Miller <davem@davemloft.net>2010-02-17 16:35:40 -0500
commit60b86755929e1a7e9038c8d860a8491cfdf8d93a (patch)
tree97062c7136ead4adcdbf2bd3280143da1fabbe20 /drivers/net/usb/dm9601.c
parent82456b031e3c3b5bf95a7e49bd9b68b146446e76 (diff)
usbnet: Convert dev(dbg|err|warn|info) macros to netdev_<level>
These macros are too similar to the dev_<level> equivalents but take a usbnet * argument. Convert them to the recently introduced netdev_<level> macros and remove the old macros. The old macros had "\n" appended to the format string. Add the "\n" to the converted uses. Some existing uses of the dev<foo> macros in cdc_eem.c probably mistakenly had trailing "\n". No "\n" added there. Fix net1080 this/other log message inversion. Signed-off-by: Joe Perches <joe@perches.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/usb/dm9601.c')
-rw-r--r--drivers/net/usb/dm9601.c49
1 files changed, 25 insertions, 24 deletions
diff --git a/drivers/net/usb/dm9601.c b/drivers/net/usb/dm9601.c
index c820fec62041..269339769f47 100644
--- a/drivers/net/usb/dm9601.c
+++ b/drivers/net/usb/dm9601.c
@@ -58,7 +58,7 @@ static int dm_read(struct usbnet *dev, u8 reg, u16 length, void *data)
58 void *buf; 58 void *buf;
59 int err = -ENOMEM; 59 int err = -ENOMEM;
60 60
61 devdbg(dev, "dm_read() reg=0x%02x length=%d", reg, length); 61 netdev_dbg(dev->net, "dm_read() reg=0x%02x length=%d\n", reg, length);
62 62
63 buf = kmalloc(length, GFP_KERNEL); 63 buf = kmalloc(length, GFP_KERNEL);
64 if (!buf) 64 if (!buf)
@@ -89,7 +89,7 @@ static int dm_write(struct usbnet *dev, u8 reg, u16 length, void *data)
89 void *buf = NULL; 89 void *buf = NULL;
90 int err = -ENOMEM; 90 int err = -ENOMEM;
91 91
92 devdbg(dev, "dm_write() reg=0x%02x, length=%d", reg, length); 92 netdev_dbg(dev->net, "dm_write() reg=0x%02x, length=%d\n", reg, length);
93 93
94 if (data) { 94 if (data) {
95 buf = kmalloc(length, GFP_KERNEL); 95 buf = kmalloc(length, GFP_KERNEL);
@@ -112,7 +112,8 @@ static int dm_write(struct usbnet *dev, u8 reg, u16 length, void *data)
112 112
113static int dm_write_reg(struct usbnet *dev, u8 reg, u8 value) 113static int dm_write_reg(struct usbnet *dev, u8 reg, u8 value)
114{ 114{
115 devdbg(dev, "dm_write_reg() reg=0x%02x, value=0x%02x", reg, value); 115 netdev_dbg(dev->net, "dm_write_reg() reg=0x%02x, value=0x%02x\n",
116 reg, value);
116 return usb_control_msg(dev->udev, 117 return usb_control_msg(dev->udev,
117 usb_sndctrlpipe(dev->udev, 0), 118 usb_sndctrlpipe(dev->udev, 0),
118 DM_WRITE_REG, 119 DM_WRITE_REG,
@@ -142,13 +143,13 @@ static void dm_write_async_helper(struct usbnet *dev, u8 reg, u8 value,
142 143
143 urb = usb_alloc_urb(0, GFP_ATOMIC); 144 urb = usb_alloc_urb(0, GFP_ATOMIC);
144 if (!urb) { 145 if (!urb) {
145 deverr(dev, "Error allocating URB in dm_write_async_helper!"); 146 netdev_err(dev->net, "Error allocating URB in dm_write_async_helper!\n");
146 return; 147 return;
147 } 148 }
148 149
149 req = kmalloc(sizeof(struct usb_ctrlrequest), GFP_ATOMIC); 150 req = kmalloc(sizeof(struct usb_ctrlrequest), GFP_ATOMIC);
150 if (!req) { 151 if (!req) {
151 deverr(dev, "Failed to allocate memory for control request"); 152 netdev_err(dev->net, "Failed to allocate memory for control request\n");
152 usb_free_urb(urb); 153 usb_free_urb(urb);
153 return; 154 return;
154 } 155 }
@@ -166,8 +167,8 @@ static void dm_write_async_helper(struct usbnet *dev, u8 reg, u8 value,
166 167
167 status = usb_submit_urb(urb, GFP_ATOMIC); 168 status = usb_submit_urb(urb, GFP_ATOMIC);
168 if (status < 0) { 169 if (status < 0) {
169 deverr(dev, "Error submitting the control message: status=%d", 170 netdev_err(dev->net, "Error submitting the control message: status=%d\n",
170 status); 171 status);
171 kfree(req); 172 kfree(req);
172 usb_free_urb(urb); 173 usb_free_urb(urb);
173 } 174 }
@@ -175,15 +176,15 @@ static void dm_write_async_helper(struct usbnet *dev, u8 reg, u8 value,
175 176
176static void dm_write_async(struct usbnet *dev, u8 reg, u16 length, void *data) 177static void dm_write_async(struct usbnet *dev, u8 reg, u16 length, void *data)
177{ 178{
178 devdbg(dev, "dm_write_async() reg=0x%02x length=%d", reg, length); 179 netdev_dbg(dev->net, "dm_write_async() reg=0x%02x length=%d\n", reg, length);
179 180
180 dm_write_async_helper(dev, reg, 0, length, data); 181 dm_write_async_helper(dev, reg, 0, length, data);
181} 182}
182 183
183static void dm_write_reg_async(struct usbnet *dev, u8 reg, u8 value) 184static void dm_write_reg_async(struct usbnet *dev, u8 reg, u8 value)
184{ 185{
185 devdbg(dev, "dm_write_reg_async() reg=0x%02x value=0x%02x", 186 netdev_dbg(dev->net, "dm_write_reg_async() reg=0x%02x value=0x%02x\n",
186 reg, value); 187 reg, value);
187 188
188 dm_write_async_helper(dev, reg, value, 0, NULL); 189 dm_write_async_helper(dev, reg, value, 0, NULL);
189} 190}
@@ -211,7 +212,7 @@ static int dm_read_shared_word(struct usbnet *dev, int phy, u8 reg, __le16 *valu
211 } 212 }
212 213
213 if (i == DM_TIMEOUT) { 214 if (i == DM_TIMEOUT) {
214 deverr(dev, "%s read timed out!", phy ? "phy" : "eeprom"); 215 netdev_err(dev->net, "%s read timed out!\n", phy ? "phy" : "eeprom");
215 ret = -EIO; 216 ret = -EIO;
216 goto out; 217 goto out;
217 } 218 }
@@ -219,8 +220,8 @@ static int dm_read_shared_word(struct usbnet *dev, int phy, u8 reg, __le16 *valu
219 dm_write_reg(dev, DM_SHARED_CTRL, 0x0); 220 dm_write_reg(dev, DM_SHARED_CTRL, 0x0);
220 ret = dm_read(dev, DM_SHARED_DATA, 2, value); 221 ret = dm_read(dev, DM_SHARED_DATA, 2, value);
221 222
222 devdbg(dev, "read shared %d 0x%02x returned 0x%04x, %d", 223 netdev_dbg(dev->net, "read shared %d 0x%02x returned 0x%04x, %d\n",
223 phy, reg, *value, ret); 224 phy, reg, *value, ret);
224 225
225 out: 226 out:
226 mutex_unlock(&dev->phy_mutex); 227 mutex_unlock(&dev->phy_mutex);
@@ -254,7 +255,7 @@ static int dm_write_shared_word(struct usbnet *dev, int phy, u8 reg, __le16 valu
254 } 255 }
255 256
256 if (i == DM_TIMEOUT) { 257 if (i == DM_TIMEOUT) {
257 deverr(dev, "%s write timed out!", phy ? "phy" : "eeprom"); 258 netdev_err(dev->net, "%s write timed out!\n", phy ? "phy" : "eeprom");
258 ret = -EIO; 259 ret = -EIO;
259 goto out; 260 goto out;
260 } 261 }
@@ -304,15 +305,15 @@ static int dm9601_mdio_read(struct net_device *netdev, int phy_id, int loc)
304 __le16 res; 305 __le16 res;
305 306
306 if (phy_id) { 307 if (phy_id) {
307 devdbg(dev, "Only internal phy supported"); 308 netdev_dbg(dev->net, "Only internal phy supported\n");
308 return 0; 309 return 0;
309 } 310 }
310 311
311 dm_read_shared_word(dev, 1, loc, &res); 312 dm_read_shared_word(dev, 1, loc, &res);
312 313
313 devdbg(dev, 314 netdev_dbg(dev->net,
314 "dm9601_mdio_read() phy_id=0x%02x, loc=0x%02x, returns=0x%04x", 315 "dm9601_mdio_read() phy_id=0x%02x, loc=0x%02x, returns=0x%04x\n",
315 phy_id, loc, le16_to_cpu(res)); 316 phy_id, loc, le16_to_cpu(res));
316 317
317 return le16_to_cpu(res); 318 return le16_to_cpu(res);
318} 319}
@@ -324,12 +325,12 @@ static void dm9601_mdio_write(struct net_device *netdev, int phy_id, int loc,
324 __le16 res = cpu_to_le16(val); 325 __le16 res = cpu_to_le16(val);
325 326
326 if (phy_id) { 327 if (phy_id) {
327 devdbg(dev, "Only internal phy supported"); 328 netdev_dbg(dev->net, "Only internal phy supported\n");
328 return; 329 return;
329 } 330 }
330 331
331 devdbg(dev,"dm9601_mdio_write() phy_id=0x%02x, loc=0x%02x, val=0x%04x", 332 netdev_dbg(dev->net, "dm9601_mdio_write() phy_id=0x%02x, loc=0x%02x, val=0x%04x\n",
332 phy_id, loc, val); 333 phy_id, loc, val);
333 334
334 dm_write_shared_word(dev, 1, loc, res); 335 dm_write_shared_word(dev, 1, loc, res);
335} 336}
@@ -592,7 +593,7 @@ static void dm9601_status(struct usbnet *dev, struct urb *urb)
592 } 593 }
593 else 594 else
594 netif_carrier_off(dev->net); 595 netif_carrier_off(dev->net);
595 devdbg(dev, "Link Status is: %d", link); 596 netdev_dbg(dev->net, "Link Status is: %d\n", link);
596 } 597 }
597} 598}
598 599
@@ -603,8 +604,8 @@ static int dm9601_link_reset(struct usbnet *dev)
603 mii_check_media(&dev->mii, 1, 1); 604 mii_check_media(&dev->mii, 1, 1);
604 mii_ethtool_gset(&dev->mii, &ecmd); 605 mii_ethtool_gset(&dev->mii, &ecmd);
605 606
606 devdbg(dev, "link_reset() speed: %d duplex: %d", 607 netdev_dbg(dev->net, "link_reset() speed: %d duplex: %d\n",
607 ecmd.speed, ecmd.duplex); 608 ecmd.speed, ecmd.duplex);
608 609
609 return 0; 610 return 0;
610} 611}