Commit 15f5e48f authored by Ondrej Zary's avatar Ondrej Zary Committed by Jakub Kicinski

cx82310_eth: use netdev_err instead of dev_err

Use netdev_err for better device identification in syslog.
Signed-off-by: default avatarOndrej Zary <linux@zary.sk>
Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
parent ca139d76
...@@ -71,7 +71,7 @@ static int cx82310_cmd(struct usbnet *dev, enum cx82310_cmd cmd, bool reply, ...@@ -71,7 +71,7 @@ static int cx82310_cmd(struct usbnet *dev, enum cx82310_cmd cmd, bool reply,
CMD_PACKET_SIZE, &actual_len, CMD_TIMEOUT); CMD_PACKET_SIZE, &actual_len, CMD_TIMEOUT);
if (ret < 0) { if (ret < 0) {
if (cmd != CMD_GET_LINK_STATUS) if (cmd != CMD_GET_LINK_STATUS)
dev_err(&dev->udev->dev, "send command %#x: error %d\n", netdev_err(dev->net, "send command %#x: error %d\n",
cmd, ret); cmd, ret);
goto end; goto end;
} }
...@@ -84,8 +84,7 @@ static int cx82310_cmd(struct usbnet *dev, enum cx82310_cmd cmd, bool reply, ...@@ -84,8 +84,7 @@ static int cx82310_cmd(struct usbnet *dev, enum cx82310_cmd cmd, bool reply,
CMD_TIMEOUT); CMD_TIMEOUT);
if (ret < 0) { if (ret < 0) {
if (cmd != CMD_GET_LINK_STATUS) if (cmd != CMD_GET_LINK_STATUS)
dev_err(&dev->udev->dev, netdev_err(dev->net, "reply receive error %d\n",
"reply receive error %d\n",
ret); ret);
goto end; goto end;
} }
...@@ -93,21 +92,19 @@ static int cx82310_cmd(struct usbnet *dev, enum cx82310_cmd cmd, bool reply, ...@@ -93,21 +92,19 @@ static int cx82310_cmd(struct usbnet *dev, enum cx82310_cmd cmd, bool reply,
break; break;
} }
if (actual_len == 0) { if (actual_len == 0) {
dev_err(&dev->udev->dev, "no reply to command %#x\n", netdev_err(dev->net, "no reply to command %#x\n", cmd);
cmd);
ret = -EIO; ret = -EIO;
goto end; goto end;
} }
if (buf[0] != cmd) { if (buf[0] != cmd) {
dev_err(&dev->udev->dev, netdev_err(dev->net, "got reply to command %#x, expected: %#x\n",
"got reply to command %#x, expected: %#x\n",
buf[0], cmd); buf[0], cmd);
ret = -EIO; ret = -EIO;
goto end; goto end;
} }
if (buf[1] != STATUS_SUCCESS) { if (buf[1] != STATUS_SUCCESS) {
dev_err(&dev->udev->dev, "command %#x failed: %#x\n", netdev_err(dev->net, "command %#x failed: %#x\n", cmd,
cmd, buf[1]); buf[1]);
ret = -EIO; ret = -EIO;
goto end; goto end;
} }
...@@ -194,7 +191,7 @@ static int cx82310_bind(struct usbnet *dev, struct usb_interface *intf) ...@@ -194,7 +191,7 @@ static int cx82310_bind(struct usbnet *dev, struct usb_interface *intf)
msleep(500); msleep(500);
} }
if (!timeout) { if (!timeout) {
dev_err(&udev->dev, "firmware not ready in time\n"); netdev_err(dev->net, "firmware not ready in time\n");
ret = -ETIMEDOUT; ret = -ETIMEDOUT;
goto err; goto err;
} }
...@@ -207,7 +204,7 @@ static int cx82310_bind(struct usbnet *dev, struct usb_interface *intf) ...@@ -207,7 +204,7 @@ static int cx82310_bind(struct usbnet *dev, struct usb_interface *intf)
ret = cx82310_cmd(dev, CMD_GET_MAC_ADDR, true, NULL, 0, ret = cx82310_cmd(dev, CMD_GET_MAC_ADDR, true, NULL, 0,
dev->net->dev_addr, ETH_ALEN); dev->net->dev_addr, ETH_ALEN);
if (ret) { if (ret) {
dev_err(&udev->dev, "unable to read MAC address: %d\n", ret); netdev_err(dev->net, "unable to read MAC address: %d\n", ret);
goto err; goto err;
} }
...@@ -284,8 +281,7 @@ static int cx82310_rx_fixup(struct usbnet *dev, struct sk_buff *skb) ...@@ -284,8 +281,7 @@ static int cx82310_rx_fixup(struct usbnet *dev, struct sk_buff *skb)
netdev_info(dev->net, "router was rebooted, re-enabling ethernet mode"); netdev_info(dev->net, "router was rebooted, re-enabling ethernet mode");
schedule_work(&priv->reenable_work); schedule_work(&priv->reenable_work);
} else if (len > CX82310_MTU) { } else if (len > CX82310_MTU) {
dev_err(&dev->udev->dev, "RX packet too long: %d B\n", netdev_err(dev->net, "RX packet too long: %d B\n", len);
len);
return 0; return 0;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment