summaryrefslogtreecommitdiff
path: root/drivers/usb/gadget/ether.c
diff options
context:
space:
mode:
authorMasahiro Yamada <yamada.masahiro@socionext.com>2017-09-16 14:10:41 +0900
committerTom Rini <trini@konsulko.com>2017-10-04 11:59:44 -0400
commit9b643e312d528f291966c1f30b0d90bf3b1d43dc (patch)
tree35e3780c0aabb8af73ce19a60bb8973b3f2479cd /drivers/usb/gadget/ether.c
parentb44b30260ffa3dc82f4bb98b022483bb09e95353 (diff)
treewide: replace with error() with pr_err()
U-Boot widely uses error() as a bit noisier variant of printf(). This macro causes name conflict with the following line in include/linux/compiler-gcc.h: # define __compiletime_error(message) __attribute__((error(message))) This prevents us from using __compiletime_error(), and makes it difficult to fully sync BUILD_BUG macros with Linux. (Notice Linux's BUILD_BUG_ON_MSG is implemented by using compiletime_assert().) Let's convert error() into now treewide-available pr_err(). Done with the help of Coccinelle, excluing tools/ directory. The semantic patch I used is as follows: // <smpl> @@@@ -error +pr_err (...) // </smpl> Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com> Reviewed-by: Simon Glass <sjg@chromium.org> [trini: Re-run Coccinelle] Signed-off-by: Tom Rini <trini@konsulko.com>
Diffstat (limited to 'drivers/usb/gadget/ether.c')
-rw-r--r--drivers/usb/gadget/ether.c42
1 files changed, 21 insertions, 21 deletions
diff --git a/drivers/usb/gadget/ether.c b/drivers/usb/gadget/ether.c
index 2cf5c8d31e..2e0ff452d8 100644
--- a/drivers/usb/gadget/ether.c
+++ b/drivers/usb/gadget/ether.c
@@ -1059,7 +1059,7 @@ static int eth_set_config(struct eth_dev *dev, unsigned number,
&& dev->config
&& dev->tx_qlen != 0) {
/* tx fifo is full, but we can't clear it...*/
- error("can't change configurations");
+ pr_err("can't change configurations");
return -ESPIPE;
}
eth_reset_config(dev);
@@ -1233,7 +1233,7 @@ static void rndis_command_complete(struct usb_ep *ep, struct usb_request *req)
/* received RNDIS command from USB_CDC_SEND_ENCAPSULATED_COMMAND */
status = rndis_msg_parser(dev->rndis_config, (u8 *) req->buf);
if (status < 0)
- error("%s: rndis parse error %d", __func__, status);
+ pr_err("%s: rndis parse error %d", __func__, status);
}
#endif /* RNDIS */
@@ -1554,7 +1554,7 @@ static int rx_submit(struct eth_dev *dev, struct usb_request *req,
retval = usb_ep_queue(dev->out_ep, req, gfp_flags);
if (retval)
- error("rx submit --> %d", retval);
+ pr_err("rx submit --> %d", retval);
return retval;
}
@@ -1624,7 +1624,7 @@ static int alloc_requests(struct eth_dev *dev, unsigned n, gfp_t gfp_flags)
fail2:
usb_ep_free_request(dev->in_ep, dev->tx_req);
fail1:
- error("can't alloc requests");
+ pr_err("can't alloc requests");
return -1;
}
@@ -2060,7 +2060,7 @@ static int eth_bind(struct usb_gadget *gadget)
* anything less functional on CDC-capable hardware,
* so we fail in this case.
*/
- error("controller '%s' not recognized",
+ pr_err("controller '%s' not recognized",
gadget->name);
return -ENODEV;
}
@@ -2121,7 +2121,7 @@ static int eth_bind(struct usb_gadget *gadget)
in_ep = usb_ep_autoconfig(gadget, &fs_source_desc);
if (!in_ep) {
autoconf_fail:
- error("can't autoconfigure on %s\n",
+ pr_err("can't autoconfigure on %s\n",
gadget->name);
return -ENODEV;
}
@@ -2142,7 +2142,7 @@ autoconf_fail:
if (status_ep) {
status_ep->driver_data = status_ep; /* claim */
} else if (rndis) {
- error("can't run RNDIS on %s", gadget->name);
+ pr_err("can't run RNDIS on %s", gadget->name);
return -ENODEV;
#ifdef CONFIG_USB_ETH_CDC
} else if (cdc) {
@@ -2244,7 +2244,7 @@ autoconf_fail:
if (rndis) {
status = rndis_init();
if (status < 0) {
- error("can't init RNDIS, %d", status);
+ pr_err("can't init RNDIS, %d", status);
goto fail;
}
}
@@ -2335,7 +2335,7 @@ fail0:
return 0;
fail:
- error("%s failed, status = %d", __func__, status);
+ pr_err("%s failed, status = %d", __func__, status);
eth_unbind(gadget);
return status;
}
@@ -2350,7 +2350,7 @@ int dm_usb_init(struct eth_dev *e_dev)
ret = uclass_first_device(UCLASS_USB_DEV_GENERIC, &dev);
if (!dev || ret) {
- error("No USB device found\n");
+ pr_err("No USB device found\n");
return -ENODEV;
}
@@ -2369,7 +2369,7 @@ static int _usb_eth_init(struct ether_priv *priv)
#ifdef CONFIG_DM_USB
if (dm_usb_init(dev)) {
- error("USB ether not found\n");
+ pr_err("USB ether not found\n");
return -ENODEV;
}
#else
@@ -2393,11 +2393,11 @@ static int _usb_eth_init(struct ether_priv *priv)
sizeof(host_addr));
if (!is_eth_addr_valid(dev_addr)) {
- error("Need valid 'usbnet_devaddr' to be set");
+ pr_err("Need valid 'usbnet_devaddr' to be set");
goto fail;
}
if (!is_eth_addr_valid(host_addr)) {
- error("Need valid 'usbnet_hostaddr' to be set");
+ pr_err("Need valid 'usbnet_hostaddr' to be set");
goto fail;
}
@@ -2427,7 +2427,7 @@ static int _usb_eth_init(struct ether_priv *priv)
while (!dev->network_started) {
/* Handle control-c and timeouts */
if (ctrlc() || (get_timer(ts) > timeout)) {
- error("The remote end did not respond in time.");
+ pr_err("The remote end did not respond in time.");
goto fail;
}
usb_gadget_handle_interrupts(0);
@@ -2456,7 +2456,7 @@ static int _usb_eth_send(struct ether_priv *priv, void *packet, int length)
rndis_pkt = malloc(length +
sizeof(struct rndis_packet_msg_type));
if (!rndis_pkt) {
- error("No memory to alloc RNDIS packet");
+ pr_err("No memory to alloc RNDIS packet");
goto drop;
}
rndis_add_hdr(rndis_pkt, length);
@@ -2574,7 +2574,7 @@ static int usb_eth_recv(struct eth_device *netdev)
ret = _usb_eth_recv(priv);
if (ret) {
- error("error packet receive\n");
+ pr_err("error packet receive\n");
return ret;
}
@@ -2585,7 +2585,7 @@ static int usb_eth_recv(struct eth_device *netdev)
net_process_received_packet(net_rx_packets[0],
dev->rx_req->length);
} else {
- error("dev->rx_req invalid");
+ pr_err("dev->rx_req invalid");
}
packet_received = 0;
rx_submit(dev, dev->rx_req, 0);
@@ -2641,7 +2641,7 @@ static int usb_eth_recv(struct udevice *dev, int flags, uchar **packetp)
ret = _usb_eth_recv(priv);
if (ret) {
- error("error packet receive\n");
+ pr_err("error packet receive\n");
return ret;
}
@@ -2650,7 +2650,7 @@ static int usb_eth_recv(struct udevice *dev, int flags, uchar **packetp)
*packetp = (uchar *)net_rx_packets[0];
return ethdev->rx_req->length;
} else {
- error("dev->rx_req invalid");
+ pr_err("dev->rx_req invalid");
return -EFAULT;
}
}
@@ -2706,13 +2706,13 @@ int usb_ether_init(void)
ret = uclass_first_device(UCLASS_USB_DEV_GENERIC, &usb_dev);
if (!usb_dev || ret) {
- error("No USB device found\n");
+ pr_err("No USB device found\n");
return ret;
}
ret = device_bind_driver(usb_dev, "usb_ether", "usb_ether", &dev);
if (!dev || ret) {
- error("usb - not able to bind usb_ether device\n");
+ pr_err("usb - not able to bind usb_ether device\n");
return ret;
}