diff options
author | Joe Perches <joe@perches.com> | 2010-02-17 10:30:23 +0000 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2010-02-17 13:35:40 -0800 |
commit | 60b86755929e1a7e9038c8d860a8491cfdf8d93a (patch) | |
tree | 97062c7136ead4adcdbf2bd3280143da1fabbe20 /drivers/net/usb/dm9601.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/dm9601.c')
-rw-r--r-- | drivers/net/usb/dm9601.c | 49 |
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) void *buf; int err = -ENOMEM; - devdbg(dev, "dm_read() reg=0x%02x length=%d", reg, length); + netdev_dbg(dev->net, "dm_read() reg=0x%02x length=%d\n", reg, length); buf = kmalloc(length, GFP_KERNEL); if (!buf) @@ -89,7 +89,7 @@ static int dm_write(struct usbnet *dev, u8 reg, u16 length, void *data) void *buf = NULL; int err = -ENOMEM; - devdbg(dev, "dm_write() reg=0x%02x, length=%d", reg, length); + netdev_dbg(dev->net, "dm_write() reg=0x%02x, length=%d\n", reg, length); if (data) { buf = kmalloc(length, GFP_KERNEL); @@ -112,7 +112,8 @@ static int dm_write(struct usbnet *dev, u8 reg, u16 length, void *data) static int dm_write_reg(struct usbnet *dev, u8 reg, u8 value) { - devdbg(dev, "dm_write_reg() reg=0x%02x, value=0x%02x", reg, value); + netdev_dbg(dev->net, "dm_write_reg() reg=0x%02x, value=0x%02x\n", + reg, value); return usb_control_msg(dev->udev, usb_sndctrlpipe(dev->udev, 0), DM_WRITE_REG, @@ -142,13 +143,13 @@ static void dm_write_async_helper(struct usbnet *dev, u8 reg, u8 value, urb = usb_alloc_urb(0, GFP_ATOMIC); if (!urb) { - deverr(dev, "Error allocating URB in dm_write_async_helper!"); + netdev_err(dev->net, "Error allocating URB in dm_write_async_helper!\n"); return; } req = kmalloc(sizeof(struct usb_ctrlrequest), GFP_ATOMIC); if (!req) { - deverr(dev, "Failed to allocate memory for control request"); + netdev_err(dev->net, "Failed to allocate memory for control request\n"); usb_free_urb(urb); return; } @@ -166,8 +167,8 @@ static void dm_write_async_helper(struct usbnet *dev, u8 reg, u8 value, status = usb_submit_urb(urb, GFP_ATOMIC); if (status < 0) { - deverr(dev, "Error submitting the control message: status=%d", - status); + netdev_err(dev->net, "Error submitting the control message: status=%d\n", + status); kfree(req); usb_free_urb(urb); } @@ -175,15 +176,15 @@ static void dm_write_async_helper(struct usbnet *dev, u8 reg, u8 value, static void dm_write_async(struct usbnet *dev, u8 reg, u16 length, void *data) { - devdbg(dev, "dm_write_async() reg=0x%02x length=%d", reg, length); + netdev_dbg(dev->net, "dm_write_async() reg=0x%02x length=%d\n", reg, length); dm_write_async_helper(dev, reg, 0, length, data); } static void dm_write_reg_async(struct usbnet *dev, u8 reg, u8 value) { - devdbg(dev, "dm_write_reg_async() reg=0x%02x value=0x%02x", - reg, value); + netdev_dbg(dev->net, "dm_write_reg_async() reg=0x%02x value=0x%02x\n", + reg, value); dm_write_async_helper(dev, reg, value, 0, NULL); } @@ -211,7 +212,7 @@ static int dm_read_shared_word(struct usbnet *dev, int phy, u8 reg, __le16 *valu } if (i == DM_TIMEOUT) { - deverr(dev, "%s read timed out!", phy ? "phy" : "eeprom"); + netdev_err(dev->net, "%s read timed out!\n", phy ? "phy" : "eeprom"); ret = -EIO; goto out; } @@ -219,8 +220,8 @@ static int dm_read_shared_word(struct usbnet *dev, int phy, u8 reg, __le16 *valu dm_write_reg(dev, DM_SHARED_CTRL, 0x0); ret = dm_read(dev, DM_SHARED_DATA, 2, value); - devdbg(dev, "read shared %d 0x%02x returned 0x%04x, %d", - phy, reg, *value, ret); + netdev_dbg(dev->net, "read shared %d 0x%02x returned 0x%04x, %d\n", + phy, reg, *value, ret); out: mutex_unlock(&dev->phy_mutex); @@ -254,7 +255,7 @@ static int dm_write_shared_word(struct usbnet *dev, int phy, u8 reg, __le16 valu } if (i == DM_TIMEOUT) { - deverr(dev, "%s write timed out!", phy ? "phy" : "eeprom"); + netdev_err(dev->net, "%s write timed out!\n", phy ? "phy" : "eeprom"); ret = -EIO; goto out; } @@ -304,15 +305,15 @@ static int dm9601_mdio_read(struct net_device *netdev, int phy_id, int loc) __le16 res; if (phy_id) { - devdbg(dev, "Only internal phy supported"); + netdev_dbg(dev->net, "Only internal phy supported\n"); return 0; } dm_read_shared_word(dev, 1, loc, &res); - devdbg(dev, - "dm9601_mdio_read() phy_id=0x%02x, loc=0x%02x, returns=0x%04x", - phy_id, loc, le16_to_cpu(res)); + netdev_dbg(dev->net, + "dm9601_mdio_read() phy_id=0x%02x, loc=0x%02x, returns=0x%04x\n", + phy_id, loc, le16_to_cpu(res)); return le16_to_cpu(res); } @@ -324,12 +325,12 @@ static void dm9601_mdio_write(struct net_device *netdev, int phy_id, int loc, __le16 res = cpu_to_le16(val); if (phy_id) { - devdbg(dev, "Only internal phy supported"); + netdev_dbg(dev->net, "Only internal phy supported\n"); return; } - devdbg(dev,"dm9601_mdio_write() phy_id=0x%02x, loc=0x%02x, val=0x%04x", - phy_id, loc, val); + netdev_dbg(dev->net, "dm9601_mdio_write() phy_id=0x%02x, loc=0x%02x, val=0x%04x\n", + phy_id, loc, val); dm_write_shared_word(dev, 1, loc, res); } @@ -592,7 +593,7 @@ static void dm9601_status(struct usbnet *dev, struct urb *urb) } else netif_carrier_off(dev->net); - devdbg(dev, "Link Status is: %d", link); + netdev_dbg(dev->net, "Link Status is: %d\n", link); } } @@ -603,8 +604,8 @@ static int dm9601_link_reset(struct usbnet *dev) mii_check_media(&dev->mii, 1, 1); mii_ethtool_gset(&dev->mii, &ecmd); - devdbg(dev, "link_reset() speed: %d duplex: %d", - ecmd.speed, ecmd.duplex); + netdev_dbg(dev->net, "link_reset() speed: %d duplex: %d\n", + ecmd.speed, ecmd.duplex); return 0; } |