diff options
author | Joe Perches <joe@perches.com> | 2010-02-17 05:30:23 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2010-02-17 16:35:40 -0500 |
commit | 60b86755929e1a7e9038c8d860a8491cfdf8d93a (patch) | |
tree | 97062c7136ead4adcdbf2bd3280143da1fabbe20 /drivers/net/usb/net1080.c | |
parent | 82456b031e3c3b5bf95a7e49bd9b68b146446e76 (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/net1080.c')
-rw-r--r-- | drivers/net/usb/net1080.c | 101 |
1 files changed, 49 insertions, 52 deletions
diff --git a/drivers/net/usb/net1080.c b/drivers/net/usb/net1080.c index aeb1ab03a9ee..f6994053c101 100644 --- a/drivers/net/usb/net1080.c +++ b/drivers/net/usb/net1080.c | |||
@@ -205,23 +205,24 @@ static inline void nc_dump_usbctl(struct usbnet *dev, u16 usbctl) | |||
205 | { | 205 | { |
206 | if (!netif_msg_link(dev)) | 206 | if (!netif_msg_link(dev)) |
207 | return; | 207 | return; |
208 | devdbg(dev, "net1080 %s-%s usbctl 0x%x:%s%s%s%s%s;" | 208 | netdev_dbg(dev->net, "net1080 %s-%s usbctl 0x%x:%s%s%s%s%s;" |
209 | " this%s%s;" | 209 | " this%s%s;" |
210 | " other%s%s; r/o 0x%x", | 210 | " other%s%s; r/o 0x%x\n", |
211 | dev->udev->bus->bus_name, dev->udev->devpath, | 211 | dev->udev->bus->bus_name, dev->udev->devpath, |
212 | usbctl, | 212 | usbctl, |
213 | (usbctl & USBCTL_ENABLE_LANG) ? " lang" : "", | 213 | (usbctl & USBCTL_ENABLE_LANG) ? " lang" : "", |
214 | (usbctl & USBCTL_ENABLE_MFGR) ? " mfgr" : "", | 214 | (usbctl & USBCTL_ENABLE_MFGR) ? " mfgr" : "", |
215 | (usbctl & USBCTL_ENABLE_PROD) ? " prod" : "", | 215 | (usbctl & USBCTL_ENABLE_PROD) ? " prod" : "", |
216 | (usbctl & USBCTL_ENABLE_SERIAL) ? " serial" : "", | 216 | (usbctl & USBCTL_ENABLE_SERIAL) ? " serial" : "", |
217 | (usbctl & USBCTL_ENABLE_DEFAULTS) ? " defaults" : "", | 217 | (usbctl & USBCTL_ENABLE_DEFAULTS) ? " defaults" : "", |
218 | 218 | ||
219 | (usbctl & USBCTL_FLUSH_OTHER) ? " FLUSH" : "", | 219 | (usbctl & USBCTL_FLUSH_THIS) ? " FLUSH" : "", |
220 | (usbctl & USBCTL_DISCONN_OTHER) ? " DIS" : "", | 220 | (usbctl & USBCTL_DISCONN_THIS) ? " DIS" : "", |
221 | (usbctl & USBCTL_FLUSH_THIS) ? " FLUSH" : "", | 221 | |
222 | (usbctl & USBCTL_DISCONN_THIS) ? " DIS" : "", | 222 | (usbctl & USBCTL_FLUSH_OTHER) ? " FLUSH" : "", |
223 | usbctl & ~USBCTL_WRITABLE_MASK | 223 | (usbctl & USBCTL_DISCONN_OTHER) ? " DIS" : "", |
224 | ); | 224 | |
225 | usbctl & ~USBCTL_WRITABLE_MASK); | ||
225 | } | 226 | } |
226 | 227 | ||
227 | /*-------------------------------------------------------------------------*/ | 228 | /*-------------------------------------------------------------------------*/ |
@@ -250,28 +251,25 @@ static inline void nc_dump_status(struct usbnet *dev, u16 status) | |||
250 | { | 251 | { |
251 | if (!netif_msg_link(dev)) | 252 | if (!netif_msg_link(dev)) |
252 | return; | 253 | return; |
253 | devdbg(dev, "net1080 %s-%s status 0x%x:" | 254 | netdev_dbg(dev->net, "net1080 %s-%s status 0x%x: this (%c) PKT=%d%s%s%s; other PKT=%d%s%s%s; unspec 0x%x\n", |
254 | " this (%c) PKT=%d%s%s%s;" | 255 | dev->udev->bus->bus_name, dev->udev->devpath, |
255 | " other PKT=%d%s%s%s; unspec 0x%x", | 256 | status, |
256 | dev->udev->bus->bus_name, dev->udev->devpath, | 257 | |
257 | status, | 258 | // XXX the packet counts don't seem right |
258 | 259 | // (1 at reset, not 0); maybe UNSPEC too | |
259 | // XXX the packet counts don't seem right | 260 | |
260 | // (1 at reset, not 0); maybe UNSPEC too | 261 | (status & STATUS_PORT_A) ? 'A' : 'B', |
261 | 262 | STATUS_PACKETS_THIS(status), | |
262 | (status & STATUS_PORT_A) ? 'A' : 'B', | 263 | (status & STATUS_CONN_THIS) ? " CON" : "", |
263 | STATUS_PACKETS_THIS(status), | 264 | (status & STATUS_SUSPEND_THIS) ? " SUS" : "", |
264 | (status & STATUS_CONN_THIS) ? " CON" : "", | 265 | (status & STATUS_MAILBOX_THIS) ? " MBOX" : "", |
265 | (status & STATUS_SUSPEND_THIS) ? " SUS" : "", | 266 | |
266 | (status & STATUS_MAILBOX_THIS) ? " MBOX" : "", | 267 | STATUS_PACKETS_OTHER(status), |
267 | 268 | (status & STATUS_CONN_OTHER) ? " CON" : "", | |
268 | STATUS_PACKETS_OTHER(status), | 269 | (status & STATUS_SUSPEND_OTHER) ? " SUS" : "", |
269 | (status & STATUS_CONN_OTHER) ? " CON" : "", | 270 | (status & STATUS_MAILBOX_OTHER) ? " MBOX" : "", |
270 | (status & STATUS_SUSPEND_OTHER) ? " SUS" : "", | 271 | |
271 | (status & STATUS_MAILBOX_OTHER) ? " MBOX" : "", | 272 | status & STATUS_UNSPEC_MASK); |
272 | |||
273 | status & STATUS_UNSPEC_MASK | ||
274 | ); | ||
275 | } | 273 | } |
276 | 274 | ||
277 | /*-------------------------------------------------------------------------*/ | 275 | /*-------------------------------------------------------------------------*/ |
@@ -287,9 +285,9 @@ static inline void nc_dump_status(struct usbnet *dev, u16 status) | |||
287 | static inline void nc_dump_ttl(struct usbnet *dev, u16 ttl) | 285 | static inline void nc_dump_ttl(struct usbnet *dev, u16 ttl) |
288 | { | 286 | { |
289 | if (netif_msg_link(dev)) | 287 | if (netif_msg_link(dev)) |
290 | devdbg(dev, "net1080 %s-%s ttl 0x%x this = %d, other = %d", | 288 | netdev_dbg(dev->net, "net1080 %s-%s ttl 0x%x this = %d, other = %d\n", |
291 | dev->udev->bus->bus_name, dev->udev->devpath, | 289 | dev->udev->bus->bus_name, dev->udev->devpath, |
292 | ttl, TTL_THIS(ttl), TTL_OTHER(ttl)); | 290 | ttl, TTL_THIS(ttl), TTL_OTHER(ttl)); |
293 | } | 291 | } |
294 | 292 | ||
295 | /*-------------------------------------------------------------------------*/ | 293 | /*-------------------------------------------------------------------------*/ |
@@ -335,10 +333,9 @@ static int net1080_reset(struct usbnet *dev) | |||
335 | dbg("%s: assigned TTL, %d ms", dev->net->name, NC_READ_TTL_MS); | 333 | dbg("%s: assigned TTL, %d ms", dev->net->name, NC_READ_TTL_MS); |
336 | 334 | ||
337 | if (netif_msg_link(dev)) | 335 | if (netif_msg_link(dev)) |
338 | devinfo(dev, "port %c, peer %sconnected", | 336 | netdev_info(dev->net, "port %c, peer %sconnected\n", |
339 | (status & STATUS_PORT_A) ? 'A' : 'B', | 337 | (status & STATUS_PORT_A) ? 'A' : 'B', |
340 | (status & STATUS_CONN_OTHER) ? "" : "dis" | 338 | (status & STATUS_CONN_OTHER) ? "" : "dis"); |
341 | ); | ||
342 | retval = 0; | 339 | retval = 0; |
343 | 340 | ||
344 | done: | 341 | done: |
@@ -416,7 +413,7 @@ static void nc_ensure_sync(struct usbnet *dev) | |||
416 | } | 413 | } |
417 | 414 | ||
418 | if (netif_msg_rx_err(dev)) | 415 | if (netif_msg_rx_err(dev)) |
419 | devdbg(dev, "flush net1080; too many framing errors"); | 416 | netdev_dbg(dev->net, "flush net1080; too many framing errors\n"); |
420 | dev->frame_errors = 0; | 417 | dev->frame_errors = 0; |
421 | } | 418 | } |
422 | } | 419 | } |
@@ -486,8 +483,8 @@ static int net1080_rx_fixup(struct usbnet *dev, struct sk_buff *skb) | |||
486 | return 0; | 483 | return 0; |
487 | } | 484 | } |
488 | #if 0 | 485 | #if 0 |
489 | devdbg(dev, "frame <rx h %d p %d id %d", header->hdr_len, | 486 | netdev_dbg(dev->net, "frame <rx h %d p %d id %d\n", header->hdr_len, |
490 | header->packet_len, header->packet_id); | 487 | header->packet_len, header->packet_id); |
491 | #endif | 488 | #endif |
492 | dev->frame_errors = 0; | 489 | dev->frame_errors = 0; |
493 | return 1; | 490 | return 1; |
@@ -547,9 +544,9 @@ encapsulate: | |||
547 | trailer = (struct nc_trailer *) skb_put(skb, sizeof *trailer); | 544 | trailer = (struct nc_trailer *) skb_put(skb, sizeof *trailer); |
548 | put_unaligned(header->packet_id, &trailer->packet_id); | 545 | put_unaligned(header->packet_id, &trailer->packet_id); |
549 | #if 0 | 546 | #if 0 |
550 | devdbg(dev, "frame >tx h %d p %d id %d", | 547 | netdev_dbg(dev->net, "frame >tx h %d p %d id %d\n", |
551 | header->hdr_len, header->packet_len, | 548 | header->hdr_len, header->packet_len, |
552 | header->packet_id); | 549 | header->packet_id); |
553 | #endif | 550 | #endif |
554 | return skb; | 551 | return skb; |
555 | } | 552 | } |