summaryrefslogtreecommitdiff
path: root/drivers/net/can/usb
diff options
context:
space:
mode:
authorMarc Kleine-Budde <mkl@pengutronix.de>2023-07-12 15:49:43 +0200
committerMarc Kleine-Budde <mkl@pengutronix.de>2023-07-28 08:52:03 +0200
commit1494ffe4cbe0f97af9c57a4cc37131c8efbe79fc (patch)
tree05517fb6c27d5f28f40c4121f75db15cba6a1269 /drivers/net/can/usb
parent6c8bc15f02b85bc8f47074110d8fd8caf7a1e42d (diff)
can: gs_usb: gs_can_start_xmit(), gs_can_open(): clean up printouts in error path
Remove unnecessary "out of memory" message from the error path of gs_can_start_xmit() and gs_can_open(). Convert the printout in case of a failing usb_submit_urb() in gs_can_open() from numbers to human readable error codes. Link: https://lore.kernel.org/all/20230718-gs_usb-cleanups-v1-8-c3b9154ec605@pengutronix.de Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
Diffstat (limited to 'drivers/net/can/usb')
-rw-r--r--drivers/net/can/usb/gs_usb.c9
1 files changed, 3 insertions, 6 deletions
diff --git a/drivers/net/can/usb/gs_usb.c b/drivers/net/can/usb/gs_usb.c
index e302d7d568aa..a5cab6a07002 100644
--- a/drivers/net/can/usb/gs_usb.c
+++ b/drivers/net/can/usb/gs_usb.c
@@ -741,10 +741,8 @@ static netdev_tx_t gs_can_start_xmit(struct sk_buff *skb,
goto nomem_urb;
hf = kmalloc(dev->hf_size_tx, GFP_ATOMIC);
- if (!hf) {
- netdev_err(netdev, "No memory left for USB buffer\n");
+ if (!hf)
goto nomem_hf;
- }
idx = txc->echo_id;
@@ -877,8 +875,6 @@ static int gs_can_open(struct net_device *netdev)
buf = kmalloc(dev->parent->hf_size_rx,
GFP_KERNEL);
if (!buf) {
- netdev_err(netdev,
- "No memory left for USB buffer\n");
rc = -ENOMEM;
goto out_usb_free_urb;
}
@@ -901,7 +897,8 @@ static int gs_can_open(struct net_device *netdev)
netif_device_detach(dev->netdev);
netdev_err(netdev,
- "usb_submit failed (err=%d)\n", rc);
+ "usb_submit_urb() failed, error %pe\n",
+ ERR_PTR(rc));
goto out_usb_unanchor_urb;
}