summaryrefslogtreecommitdiff
path: root/drivers/usb
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
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')
-rw-r--r--drivers/usb/common/common.c2
-rw-r--r--drivers/usb/eth/mcs7830.c12
-rw-r--r--drivers/usb/gadget/at91_udc.c4
-rw-r--r--drivers/usb/gadget/atmel_usba_udc.c6
-rw-r--r--drivers/usb/gadget/dwc2_udc_otg.c2
-rw-r--r--drivers/usb/gadget/ether.c42
-rw-r--r--drivers/usb/gadget/f_fastboot.c10
-rw-r--r--drivers/usb/gadget/f_sdp.c16
-rw-r--r--drivers/usb/gadget/f_thor.c26
-rw-r--r--drivers/usb/host/dwc2.c2
-rw-r--r--drivers/usb/host/dwc3-sti-glue.c28
-rw-r--r--drivers/usb/host/ehci-generic.c18
-rw-r--r--drivers/usb/host/ohci-generic.c18
-rw-r--r--drivers/usb/host/xhci-dwc3.c6
-rw-r--r--drivers/usb/host/xhci-rockchip.c12
-rw-r--r--drivers/usb/musb-new/ti-musb.c12
16 files changed, 108 insertions, 108 deletions
diff --git a/drivers/usb/common/common.c b/drivers/usb/common/common.c
index 35c2dc18d9..e8432bb016 100644
--- a/drivers/usb/common/common.c
+++ b/drivers/usb/common/common.c
@@ -28,7 +28,7 @@ enum usb_dr_mode usb_get_dr_mode(int node)
dr_mode = fdt_getprop(fdt, node, "dr_mode", NULL);
if (!dr_mode) {
- error("usb dr_mode not found\n");
+ pr_err("usb dr_mode not found\n");
return USB_DR_MODE_UNKNOWN;
}
diff --git a/drivers/usb/eth/mcs7830.c b/drivers/usb/eth/mcs7830.c
index 4abef5d5c8..941d612a68 100644
--- a/drivers/usb/eth/mcs7830.c
+++ b/drivers/usb/eth/mcs7830.c
@@ -418,25 +418,25 @@ static int mcs7830_basic_reset(struct usb_device *udev,
rc = mcs7830_set_autoneg(udev);
if (rc < 0) {
- error("setting autoneg failed\n");
+ pr_err("setting autoneg failed\n");
return rc;
}
rc = mcs7830_write_mchash(udev, priv);
if (rc < 0) {
- error("failed to set multicast hash\n");
+ pr_err("failed to set multicast hash\n");
return rc;
}
rc = mcs7830_write_config(udev, priv);
if (rc < 0) {
- error("failed to set configuration\n");
+ pr_err("failed to set configuration\n");
return rc;
}
rc = mcs7830_apply_fixup(udev);
if (rc < 0) {
- error("fixup application failed\n");
+ pr_err("fixup application failed\n");
return rc;
}
@@ -541,11 +541,11 @@ static int mcs7830_recv_common(struct ueth_data *ueth, uint8_t *buf)
debug("%s() RX want len %d, got len %d, rc %d\n",
__func__, wantlen, gotlen, rc);
if (rc != 0) {
- error("RX: failed to receive\n");
+ pr_err("RX: failed to receive\n");
return rc;
}
if (gotlen > wantlen) {
- error("RX: got too many bytes (%d)\n", gotlen);
+ pr_err("RX: got too many bytes (%d)\n", gotlen);
return -EIO;
}
diff --git a/drivers/usb/gadget/at91_udc.c b/drivers/usb/gadget/at91_udc.c
index 9df6d32c65..ad2f606b78 100644
--- a/drivers/usb/gadget/at91_udc.c
+++ b/drivers/usb/gadget/at91_udc.c
@@ -1456,7 +1456,7 @@ int usb_gadget_register_driver(struct usb_gadget_driver *driver)
ret = driver->bind(&udc->gadget);
if (ret) {
- error("driver->bind() returned %d\n", ret);
+ pr_err("driver->bind() returned %d\n", ret);
udc->driver = NULL;
}
@@ -1468,7 +1468,7 @@ int usb_gadget_unregister_driver(struct usb_gadget_driver *driver)
struct at91_udc *udc = controller;
if (!driver || !driver->unbind || !driver->disconnect) {
- error("bad paramter\n");
+ pr_err("bad paramter\n");
return -EINVAL;
}
diff --git a/drivers/usb/gadget/atmel_usba_udc.c b/drivers/usb/gadget/atmel_usba_udc.c
index ad31703c73..c0a95a97c9 100644
--- a/drivers/usb/gadget/atmel_usba_udc.c
+++ b/drivers/usb/gadget/atmel_usba_udc.c
@@ -1228,7 +1228,7 @@ int usb_gadget_register_driver(struct usb_gadget_driver *driver)
ret = driver->bind(&udc->gadget);
if (ret) {
- error("driver->bind() returned %d\n", ret);
+ pr_err("driver->bind() returned %d\n", ret);
udc->driver = NULL;
}
@@ -1240,7 +1240,7 @@ int usb_gadget_unregister_driver(struct usb_gadget_driver *driver)
struct usba_udc *udc = &controller;
if (!driver || !driver->unbind || !driver->disconnect) {
- error("bad paramter\n");
+ pr_err("bad paramter\n");
return -EINVAL;
}
@@ -1261,7 +1261,7 @@ static struct usba_ep *usba_udc_pdata(struct usba_platform_data *pdata,
eps = malloc(sizeof(struct usba_ep) * pdata->num_ep);
if (!eps) {
- error("failed to alloc eps\n");
+ pr_err("failed to alloc eps\n");
return NULL;
}
diff --git a/drivers/usb/gadget/dwc2_udc_otg.c b/drivers/usb/gadget/dwc2_udc_otg.c
index cb44374e81..088811c191 100644
--- a/drivers/usb/gadget/dwc2_udc_otg.c
+++ b/drivers/usb/gadget/dwc2_udc_otg.c
@@ -835,7 +835,7 @@ int dwc2_udc_probe(struct dwc2_plat_otg_data *pdata)
ROUND(sizeof(struct usb_ctrlrequest),
CONFIG_SYS_CACHELINE_SIZE));
if (!usb_ctrl) {
- error("No memory available for UDC!\n");
+ pr_err("No memory available for UDC!\n");
return -ENOMEM;
}
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;
}
diff --git a/drivers/usb/gadget/f_fastboot.c b/drivers/usb/gadget/f_fastboot.c
index f3382a965b..7acffb6c87 100644
--- a/drivers/usb/gadget/f_fastboot.c
+++ b/drivers/usb/gadget/f_fastboot.c
@@ -410,7 +410,7 @@ static void cb_getvar(struct usb_ep *ep, struct usb_request *req)
strsep(&cmd, ":");
if (!cmd) {
- error("missing variable");
+ pr_err("missing variable");
fastboot_tx_write_str("FAILmissing var");
return;
}
@@ -593,7 +593,7 @@ static void cb_flash(struct usb_ep *ep, struct usb_request *req)
strsep(&cmd, ":");
if (!cmd) {
- error("missing partition name");
+ pr_err("missing partition name");
fastboot_tx_write_str("FAILmissing partition name");
return;
}
@@ -645,7 +645,7 @@ static void cb_erase(struct usb_ep *ep, struct usb_request *req)
strsep(&cmd, ":");
if (!cmd) {
- error("missing partition name");
+ pr_err("missing partition name");
fastboot_tx_write_str("FAILmissing partition name");
return;
}
@@ -718,7 +718,7 @@ static void rx_handler_command(struct usb_ep *ep, struct usb_request *req)
}
if (!func_cb) {
- error("unknown command: %.*s", req->actual, cmdbuf);
+ pr_err("unknown command: %.*s", req->actual, cmdbuf);
fastboot_tx_write_str("FAILunknown command");
} else {
if (req->actual < req->length) {
@@ -726,7 +726,7 @@ static void rx_handler_command(struct usb_ep *ep, struct usb_request *req)
buf[req->actual] = 0;
func_cb(ep, req);
} else {
- error("buffer overflow");
+ pr_err("buffer overflow");
fastboot_tx_write_str("FAILbuffer overflow");
}
}
diff --git a/drivers/usb/gadget/f_sdp.c b/drivers/usb/gadget/f_sdp.c
index 0fae66beab..fd3da922a6 100644
--- a/drivers/usb/gadget/f_sdp.c
+++ b/drivers/usb/gadget/f_sdp.c
@@ -237,12 +237,12 @@ static void sdp_rx_command_complete(struct usb_ep *ep, struct usb_request *req)
u8 report = data[0];
if (status != 0) {
- error("Status: %d", status);
+ pr_err("Status: %d", status);
return;
}
if (report != 1) {
- error("Unexpected report %d", report);
+ pr_err("Unexpected report %d", report);
return;
}
@@ -309,7 +309,7 @@ static void sdp_rx_command_complete(struct usb_ep *ep, struct usb_request *req)
sdp->next_state = SDP_STATE_IDLE;
break;
default:
- error("Unknown command: %04x\n", be16_to_cpu(cmd->cmd));
+ pr_err("Unknown command: %04x\n", be16_to_cpu(cmd->cmd));
}
}
@@ -322,12 +322,12 @@ static void sdp_rx_data_complete(struct usb_ep *ep, struct usb_request *req)
int datalen = req->length - 1;
if (status != 0) {
- error("Status: %d", status);
+ pr_err("Status: %d", status);
return;
}
if (report != 2) {
- error("Unexpected report %d", report);
+ pr_err("Unexpected report %d", report);
return;
}
@@ -360,7 +360,7 @@ static void sdp_rx_data_complete(struct usb_ep *ep, struct usb_request *req)
sdp->state = SDP_STATE_TX_SEC_CONF;
break;
default:
- error("Invalid state: %d", sdp->state);
+ pr_err("Invalid state: %d", sdp->state);
}
}
@@ -370,7 +370,7 @@ static void sdp_tx_complete(struct usb_ep *ep, struct usb_request *req)
int status = req->status;
if (status != 0) {
- error("Status: %d", status);
+ pr_err("Status: %d", status);
return;
}
@@ -393,7 +393,7 @@ static void sdp_tx_complete(struct usb_ep *ep, struct usb_request *req)
sdp->state = SDP_STATE_IDLE;
break;
default:
- error("Wrong State: %d", sdp->state);
+ pr_err("Wrong State: %d", sdp->state);
sdp->state = SDP_STATE_IDLE;
break;
}
diff --git a/drivers/usb/gadget/f_thor.c b/drivers/usb/gadget/f_thor.c
index cd4d9e659a..18f233ab58 100644
--- a/drivers/usb/gadget/f_thor.c
+++ b/drivers/usb/gadget/f_thor.c
@@ -174,7 +174,7 @@ static long long int download_head(unsigned long long total,
transfer_buffer, THOR_STORE_UNIT_SIZE,
(*cnt)++);
if (ret) {
- error("DFU write failed [%d] cnt: %d",
+ pr_err("DFU write failed [%d] cnt: %d",
ret, *cnt);
return ret;
}
@@ -218,20 +218,20 @@ static int download_tail(long long int left, int cnt)
dfu_entity = dfu_get_entity(alt_setting_num);
if (!dfu_entity) {
- error("Alt setting: %d entity not found!\n", alt_setting_num);
+ pr_err("Alt setting: %d entity not found!\n", alt_setting_num);
return -ENOENT;
}
transfer_buffer = dfu_get_buf(dfu_entity);
if (!transfer_buffer) {
- error("Transfer buffer not allocated!");
+ pr_err("Transfer buffer not allocated!");
return -ENXIO;
}
if (left) {
ret = dfu_write(dfu_entity, transfer_buffer, left, cnt++);
if (ret) {
- error("DFU write failed [%d]: left: %llu", ret, left);
+ pr_err("DFU write failed [%d]: left: %llu", ret, left);
return ret;
}
}
@@ -245,7 +245,7 @@ static int download_tail(long long int left, int cnt)
*/
ret = dfu_flush(dfu_entity, transfer_buffer, 0, cnt);
if (ret)
- error("DFU flush failed!");
+ pr_err("DFU flush failed!");
return ret;
}
@@ -285,7 +285,7 @@ static long long int process_rqt_download(const struct rqt_box *rqt)
alt_setting_num = dfu_get_alt(f_name);
if (alt_setting_num < 0) {
- error("Alt setting [%d] to write not found!",
+ pr_err("Alt setting [%d] to write not found!",
alt_setting_num);
rsp->ack = -ENODEV;
ret = rsp->ack;
@@ -311,7 +311,7 @@ static long long int process_rqt_download(const struct rqt_box *rqt)
debug("DL EXIT\n");
break;
default:
- error("Operation not supported: %d", rqt->rqt_data);
+ pr_err("Operation not supported: %d", rqt->rqt_data);
ret = -ENOTSUPP;
}
@@ -342,7 +342,7 @@ static int process_data(void)
puts("RQT: UPLOAD not supported!\n");
break;
default:
- error("unknown request (%d)", rqt->rqt);
+ pr_err("unknown request (%d)", rqt->rqt);
}
return ret;
@@ -541,7 +541,7 @@ static int thor_rx_data(void)
status = usb_ep_queue(dev->out_ep, dev->out_req, 0);
if (status) {
- error("kill %s: resubmit %d bytes --> %d",
+ pr_err("kill %s: resubmit %d bytes --> %d",
dev->out_ep->name, dev->out_req->length, status);
usb_ep_set_halt(dev->out_ep);
return -EAGAIN;
@@ -575,7 +575,7 @@ static void thor_tx_data(unsigned char *data, int len)
status = usb_ep_queue(dev->in_ep, dev->in_req, 0);
if (status) {
- error("kill %s: resubmit %d bytes --> %d",
+ pr_err("kill %s: resubmit %d bytes --> %d",
dev->in_ep->name, dev->in_req->length, status);
usb_ep_set_halt(dev->in_ep);
}
@@ -608,7 +608,7 @@ static void thor_rx_tx_complete(struct usb_ep *ep, struct usb_request *req)
case -ESHUTDOWN: /* disconnect from host */
case -EREMOTEIO: /* short read */
case -EOVERFLOW:
- error("ERROR:%d", status);
+ pr_err("ERROR:%d", status);
break;
}
@@ -664,7 +664,7 @@ thor_func_setup(struct usb_function *f, const struct usb_ctrlrequest *ctrl)
break;
default:
- error("thor_setup: unknown request: %d", ctrl->bRequest);
+ pr_err("thor_setup: unknown request: %d", ctrl->bRequest);
}
if (value >= 0) {
@@ -973,7 +973,7 @@ static int thor_func_set_alt(struct usb_function *f,
debug("Communication Data interface\n");
result = thor_eps_setup(f);
if (result)
- error("%s: EPs setup failed!", __func__);
+ pr_err("%s: EPs setup failed!", __func__);
dev->configuration_done = 1;
break;
}
diff --git a/drivers/usb/host/dwc2.c b/drivers/usb/host/dwc2.c
index 0ed72d5ae7..1293e18f75 100644
--- a/drivers/usb/host/dwc2.c
+++ b/drivers/usb/host/dwc2.c
@@ -179,7 +179,7 @@ static int dwc_vbus_supply_init(struct udevice *dev)
ret = regulator_set_enable(vbus_supply, true);
if (ret) {
- error("Error enabling vbus supply\n");
+ pr_err("Error enabling vbus supply\n");
return ret;
}
diff --git a/drivers/usb/host/dwc3-sti-glue.c b/drivers/usb/host/dwc3-sti-glue.c
index 02ad3115df..6dc656af89 100644
--- a/drivers/usb/host/dwc3-sti-glue.c
+++ b/drivers/usb/host/dwc3-sti-glue.c
@@ -71,7 +71,7 @@ static int sti_dwc3_glue_drd_init(struct sti_dwc3_glue_platdata *plat)
break;
default:
- error("Unsupported mode of operation %d\n", plat->mode);
+ pr_err("Unsupported mode of operation %d\n", plat->mode);
return -EINVAL;
}
writel(val, plat->syscfg_base + plat->syscfg_offset);
@@ -113,7 +113,7 @@ static int sti_dwc3_glue_ofdata_to_platdata(struct udevice *dev)
ret = fdtdec_get_int_array(gd->fdt_blob, dev_of_offset(dev),
"reg", reg, ARRAY_SIZE(reg));
if (ret) {
- error("unable to find st,stih407-dwc3 reg property(%d)\n", ret);
+ pr_err("unable to find st,stih407-dwc3 reg property(%d)\n", ret);
return ret;
}
@@ -124,14 +124,14 @@ static int sti_dwc3_glue_ofdata_to_platdata(struct udevice *dev)
ret = uclass_get_device_by_phandle(UCLASS_SYSCON, dev, "st,syscfg",
&syscon);
if (ret) {
- error("unable to find syscon device (%d)\n", ret);
+ pr_err("unable to find syscon device (%d)\n", ret);
return ret;
}
/* get syscfg-reg base address */
regmap = syscon_get_regmap(syscon);
if (!regmap) {
- error("unable to find regmap\n");
+ pr_err("unable to find regmap\n");
return -ENODEV;
}
plat->syscfg_base = regmap->base;
@@ -139,14 +139,14 @@ static int sti_dwc3_glue_ofdata_to_platdata(struct udevice *dev)
/* get powerdown reset */
ret = reset_get_by_name(dev, "powerdown", &plat->powerdown_ctl);
if (ret) {
- error("can't get powerdown reset for %s (%d)", dev->name, ret);
+ pr_err("can't get powerdown reset for %s (%d)", dev->name, ret);
return ret;
}
/* get softreset reset */
ret = reset_get_by_name(dev, "softreset", &plat->softreset_ctl);
if (ret)
- error("can't get soft reset for %s (%d)", dev->name, ret);
+ pr_err("can't get soft reset for %s (%d)", dev->name, ret);
return ret;
};
@@ -159,14 +159,14 @@ static int sti_dwc3_glue_bind(struct udevice *dev)
/* check if one subnode is present */
dwc3_node = fdt_first_subnode(gd->fdt_blob, dev_of_offset(dev));
if (dwc3_node <= 0) {
- error("Can't find subnode for %s\n", dev->name);
+ pr_err("Can't find subnode for %s\n", dev->name);
return -ENODEV;
}
/* check if the subnode compatible string is the dwc3 one*/
if (fdt_node_check_compatible(gd->fdt_blob, dwc3_node,
"snps,dwc3") != 0) {
- error("Can't find dwc3 subnode for %s\n", dev->name);
+ pr_err("Can't find dwc3 subnode for %s\n", dev->name);
return -ENODEV;
}
@@ -187,13 +187,13 @@ static int sti_dwc3_glue_probe(struct udevice *dev)
/* deassert both powerdown and softreset */
ret = reset_deassert(&plat->powerdown_ctl);
if (ret < 0) {
- error("DWC3 powerdown reset deassert failed: %d", ret);
+ pr_err("DWC3 powerdown reset deassert failed: %d", ret);
return ret;
}
ret = reset_deassert(&plat->softreset_ctl);
if (ret < 0) {
- error("DWC3 soft reset deassert failed: %d", ret);
+ pr_err("DWC3 soft reset deassert failed: %d", ret);
goto softreset_err;
}
@@ -208,14 +208,14 @@ static int sti_dwc3_glue_probe(struct udevice *dev)
init_err:
ret = reset_assert(&plat->softreset_ctl);
if (ret < 0) {
- error("DWC3 soft reset deassert failed: %d", ret);
+ pr_err("DWC3 soft reset deassert failed: %d", ret);
return ret;
}
softreset_err:
ret = reset_assert(&plat->powerdown_ctl);
if (ret < 0)
- error("DWC3 powerdown reset deassert failed: %d", ret);
+ pr_err("DWC3 powerdown reset deassert failed: %d", ret);
return ret;
}
@@ -228,13 +228,13 @@ static int sti_dwc3_glue_remove(struct udevice *dev)
/* assert both powerdown and softreset */
ret = reset_assert(&plat->powerdown_ctl);
if (ret < 0) {
- error("DWC3 powerdown reset deassert failed: %d", ret);
+ pr_err("DWC3 powerdown reset deassert failed: %d", ret);
return ret;
}
ret = reset_assert(&plat->softreset_ctl);
if (ret < 0)
- error("DWC3 soft reset deassert failed: %d", ret);
+ pr_err("DWC3 soft reset deassert failed: %d", ret);
return ret;
}
diff --git a/drivers/usb/host/ehci-generic.c b/drivers/usb/host/ehci-generic.c
index 18e1e0ee88..1cb92c0338 100644
--- a/drivers/usb/host/ehci-generic.c
+++ b/drivers/usb/host/ehci-generic.c
@@ -51,7 +51,7 @@ static int ehci_usb_probe(struct udevice *dev)
break;
err = clk_enable(&priv->clocks[i]);
if (err) {
- error("failed to enable clock %d\n", i);
+ pr_err("failed to enable clock %d\n", i);
clk_free(&priv->clocks[i]);
goto clk_err;
}
@@ -59,7 +59,7 @@ static int ehci_usb_probe(struct udevice *dev)
}
} else {
if (clock_nb != -ENOENT) {
- error("failed to get clock phandle(%d)\n", clock_nb);
+ pr_err("failed to get clock phandle(%d)\n", clock_nb);
return clock_nb;
}
}
@@ -80,7 +80,7 @@ static int ehci_usb_probe(struct udevice *dev)
break;
if (reset_deassert(&priv->resets[i])) {
- error("failed to deassert reset %d\n", i);
+ pr_err("failed to deassert reset %d\n", i);
reset_free(&priv->resets[i]);
goto reset_err;
}
@@ -88,7 +88,7 @@ static int ehci_usb_probe(struct udevice *dev)
}
} else {
if (reset_nb != -ENOENT) {
- error("failed to get reset phandle(%d)\n", reset_nb);
+ pr_err("failed to get reset phandle(%d)\n", reset_nb);
goto clk_err;
}
}
@@ -96,14 +96,14 @@ static int ehci_usb_probe(struct udevice *dev)
err = generic_phy_get_by_index(dev, 0, &priv->phy);
if (err) {
if (err != -ENOENT) {
- error("failed to get usb phy\n");
+ pr_err("failed to get usb phy\n");
goto reset_err;
}
} else {
err = generic_phy_init(&priv->phy);
if (err) {
- error("failed to init usb phy\n");
+ pr_err("failed to init usb phy\n");
goto reset_err;
}
}
@@ -122,17 +122,17 @@ phy_err:
if (generic_phy_valid(&priv->phy)) {
ret = generic_phy_exit(&priv->phy);
if (ret)
- error("failed to release phy\n");
+ pr_err("failed to release phy\n");
}
reset_err:
ret = reset_release_all(priv->resets, priv->reset_count);
if (ret)
- error("failed to assert all resets\n");
+ pr_err("failed to assert all resets\n");
clk_err:
ret = clk_release_all(priv->clocks, priv->clock_count);
if (ret)
- error("failed to disable all clocks\n");
+ pr_err("failed to disable all clocks\n");
return err;
}
diff --git a/drivers/usb/host/ohci-generic.c b/drivers/usb/host/ohci-generic.c
index e22ee97939..bf55a71d66 100644
--- a/drivers/usb/host/ohci-generic.c
+++ b/drivers/usb/host/ohci-generic.c
@@ -47,14 +47,14 @@ static int ohci_usb_probe(struct udevice *dev)
err = clk_enable(&priv->clocks[i]);
if (err) {
- error("failed to enable clock %d\n", i);
+ pr_err("failed to enable clock %d\n", i);
clk_free(&priv->clocks[i]);
goto clk_err;
}
priv->clock_count++;
}
} else if (clock_nb != -ENOENT) {
- error("failed to get clock phandle(%d)\n", clock_nb);
+ pr_err("failed to get clock phandle(%d)\n", clock_nb);
return clock_nb;
}
@@ -74,28 +74,28 @@ static int ohci_usb_probe(struct udevice *dev)
err = reset_deassert(&priv->resets[i]);
if (err) {
- error("failed to deassert reset %d\n", i);
+ pr_err("failed to deassert reset %d\n", i);
reset_free(&priv->resets[i]);
goto reset_err;
}
priv->reset_count++;
}
} else if (reset_nb != -ENOENT) {
- error("failed to get reset phandle(%d)\n", reset_nb);
+ pr_err("failed to get reset phandle(%d)\n", reset_nb);
goto clk_err;
}
err = generic_phy_get_by_index(dev, 0, &priv->phy);
if (err) {
if (err != -ENOENT) {
- error("failed to get usb phy\n");
+ pr_err("failed to get usb phy\n");
goto reset_err;
}
} else {
err = generic_phy_init(&priv->phy);
if (err) {
- error("failed to init usb phy\n");
+ pr_err("failed to init usb phy\n");
goto reset_err;
}
}
@@ -110,17 +110,17 @@ phy_err:
if (generic_phy_valid(&priv->phy)) {
ret = generic_phy_exit(&priv->phy);
if (ret)
- error("failed to release phy\n");
+ pr_err("failed to release phy\n");
}
reset_err:
ret = reset_release_all(priv->resets, priv->reset_count);
if (ret)
- error("failed to assert all resets\n");
+ pr_err("failed to assert all resets\n");
clk_err:
ret = clk_release_all(priv->clocks, priv->clock_count);
if (ret)
- error("failed to disable all clocks\n");
+ pr_err("failed to disable all clocks\n");
return err;
}
diff --git a/drivers/usb/host/xhci-dwc3.c b/drivers/usb/host/xhci-dwc3.c
index 4191a89421..258d1cd00a 100644
--- a/drivers/usb/host/xhci-dwc3.c
+++ b/drivers/usb/host/xhci-dwc3.c
@@ -128,13 +128,13 @@ static int xhci_dwc3_probe(struct udevice *dev)
ret = generic_phy_get_by_index(dev, 0, &plat->usb_phy);
if (ret) {
if (ret != -ENOENT) {
- error("Failed to get USB PHY for %s\n", dev->name);
+ pr_err("Failed to get USB PHY for %s\n", dev->name);
return ret;
}
} else {
ret = generic_phy_init(&plat->usb_phy);
if (ret) {
- error("Can't init USB PHY for %s\n", dev->name);
+ pr_err("Can't init USB PHY for %s\n", dev->name);
return ret;
}
}
@@ -161,7 +161,7 @@ static int xhci_dwc3_remove(struct udevice *dev)
if (generic_phy_valid(&plat->usb_phy)) {
ret = generic_phy_exit(&plat->usb_phy);
if (ret) {
- error("Can't deinit USB PHY for %s\n", dev->name);
+ pr_err("Can't deinit USB PHY for %s\n", dev->name);
return ret;
}
}
diff --git a/drivers/usb/host/xhci-rockchip.c b/drivers/usb/host/xhci-rockchip.c
index ca3abffba0..b1f9884273 100644
--- a/drivers/usb/host/xhci-rockchip.c
+++ b/drivers/usb/host/xhci-rockchip.c
@@ -46,7 +46,7 @@ static int xhci_usb_ofdata_to_platdata(struct udevice *dev)
*/
plat->hcd_base = dev_read_addr(dev);
if (plat->hcd_base == FDT_ADDR_T_NONE) {
- error("Can't get the XHCI register base address\n");
+ pr_err("Can't get the XHCI register base address\n");
return -ENXIO;
}
@@ -60,7 +60,7 @@ static int xhci_usb_ofdata_to_platdata(struct udevice *dev)
}
if (plat->phy_base == FDT_ADDR_T_NONE) {
- error("Can't get the usbphy register address\n");
+ pr_err("Can't get the usbphy register address\n");
return -ENXIO;
}
@@ -117,7 +117,7 @@ static int rockchip_xhci_core_init(struct rockchip_xhci *rkxhci,
ret = dwc3_core_init(rkxhci->dwc3_reg);
if (ret) {
- error("failed to initialize core\n");
+ pr_err("failed to initialize core\n");
return ret;
}
@@ -149,14 +149,14 @@ static int xhci_usb_probe(struct udevice *dev)
if (plat->vbus_supply) {
ret = regulator_set_enable(plat->vbus_supply, true);
if (ret) {
- error("XHCI: failed to set VBus supply\n");
+ pr_err("XHCI: failed to set VBus supply\n");
return ret;
}
}
ret = rockchip_xhci_core_init(ctx, dev);
if (ret) {
- error("XHCI: failed to initialize controller\n");
+ pr_err("XHCI: failed to initialize controller\n");
return ret;
}
@@ -179,7 +179,7 @@ static int xhci_usb_remove(struct udevice *dev)
if (plat->vbus_supply) {
ret = regulator_set_enable(plat->vbus_supply, false);
if (ret)
- error("XHCI: failed to set VBus supply\n");
+ pr_err("XHCI: failed to set VBus supply\n");
}
return ret;
diff --git a/drivers/usb/musb-new/ti-musb.c b/drivers/usb/musb-new/ti-musb.c
index de101319cd..233857ad7a 100644
--- a/drivers/usb/musb-new/ti-musb.c
+++ b/drivers/usb/musb-new/ti-musb.c
@@ -106,7 +106,7 @@ static int ti_musb_ofdata_to_platdata(struct udevice *dev)
"mentor,multipoint",
-1);
if (platdata->musb_config.multipoint < 0) {
- error("MUSB multipoint DT entry missing\n");
+ pr_err("MUSB multipoint DT entry missing\n");
return -ENOENT;
}
@@ -115,14 +115,14 @@ static int ti_musb_ofdata_to_platdata(struct udevice *dev)
platdata->musb_config.num_eps = fdtdec_get_int(fdt, node,
"mentor,num-eps", -1);
if (platdata->musb_config.num_eps < 0) {
- error("MUSB num-eps DT entry missing\n");
+ pr_err("MUSB num-eps DT entry missing\n");
return -ENOENT;
}
platdata->musb_config.ram_bits = fdtdec_get_int(fdt, node,
"mentor,ram-bits", -1);
if (platdata->musb_config.ram_bits < 0) {
- error("MUSB ram-bits DT entry missing\n");
+ pr_err("MUSB ram-bits DT entry missing\n");
return -ENOENT;
}
@@ -132,7 +132,7 @@ static int ti_musb_ofdata_to_platdata(struct udevice *dev)
platdata->plat.power = fdtdec_get_int(fdt, node, "mentor,power", -1);
if (platdata->plat.power < 0) {
- error("MUSB mentor,power DT entry missing\n");
+ pr_err("MUSB mentor,power DT entry missing\n");
return -ENOENT;
}
@@ -183,7 +183,7 @@ static int ti_musb_host_ofdata_to_platdata(struct udevice *dev)
ret = ti_musb_ofdata_to_platdata(dev);
if (ret) {
- error("platdata dt parse error\n");
+ pr_err("platdata dt parse error\n");
return ret;
}
@@ -229,7 +229,7 @@ static int ti_musb_wrapper_bind(struct udevice *parent)
ret = device_bind_driver_to_node(parent, "ti-musb-host",
name, offset_to_ofnode(node), &dev);
if (ret) {
- error("musb - not able to bind usb host node\n");
+ pr_err("musb - not able to bind usb host node\n");
return ret;
}
break;