Commit 88689279 authored by Haneen Mohammed's avatar Haneen Mohammed Committed by Greg Kroah-Hartman

Staging: emxx_udc: Replace custom printk macro ERR with dev_err or pr_err

This patch removes the use of custom printk macros ERR and replace it
with dev_err, or pr_err in the following cases:
- if no appropriate struct device *dev field where found for dev_err.
- or dev could be null eg. "dev_err(udc->dev" not possible inside "if
  (udc == null)"
Issue addressed by checkpatch.pl.
Signed-off-by: default avatarHaneen Mohammed <hamohammed.sa@gmail.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent d45c4c65
...@@ -115,7 +115,7 @@ static void _nbu2ss_dump_register(struct nbu2ss_udc *udc) ...@@ -115,7 +115,7 @@ static void _nbu2ss_dump_register(struct nbu2ss_udc *udc)
pr_info("=== %s()\n", __func__); pr_info("=== %s()\n", __func__);
if (udc == NULL) { if (udc == NULL) {
ERR("%s udc == NULL\n", __func__); pr_err("%s udc == NULL\n", __func__);
return; return;
} }
...@@ -808,7 +808,7 @@ static int _nbu2ss_ep0_out_transfer( ...@@ -808,7 +808,7 @@ static int _nbu2ss_ep0_out_transfer(
return 0; /* Short Packet Transfer End */ return 0; /* Short Packet Transfer End */
if (req->req.actual > req->req.length) { if (req->req.actual > req->req.length) {
ERR(" *** Overrun Error\n"); dev_err(udc->dev, " *** Overrun Error\n");
return -EOVERFLOW; return -EOVERFLOW;
} }
...@@ -1026,8 +1026,8 @@ static int _nbu2ss_epn_out_transfer( ...@@ -1026,8 +1026,8 @@ static int _nbu2ss_epn_out_transfer(
} }
if (req->req.actual > req->req.length) { if (req->req.actual > req->req.length) {
ERR(" *** Overrun Error\n"); dev_err(udc->dev, " Overrun Error\n");
ERR(" *** actual = %d, length = %d\n", dev_err(udc->dev, " actual = %d, length = %d\n",
req->req.actual, req->req.length); req->req.actual, req->req.length);
result = -EOVERFLOW; result = -EOVERFLOW;
} }
...@@ -1638,7 +1638,7 @@ static int std_req_get_status(struct nbu2ss_udc *udc) ...@@ -1638,7 +1638,7 @@ static int std_req_get_status(struct nbu2ss_udc *udc)
_nbu2ss_ep0_in_transfer(udc, &udc->ep[0], &udc->ep0_req); _nbu2ss_ep0_in_transfer(udc, &udc->ep[0], &udc->ep0_req);
} else { } else {
ERR("*** Error GET_STATUS\n"); dev_err(udc->dev, " Error GET_STATUS\n");
} }
return result; return result;
...@@ -2345,7 +2345,7 @@ static int _nbu2ss_enable_controller(struct nbu2ss_udc *udc) ...@@ -2345,7 +2345,7 @@ static int _nbu2ss_enable_controller(struct nbu2ss_udc *udc)
waitcnt++; waitcnt++;
udelay(1); /* 1us wait */ udelay(1); /* 1us wait */
if (waitcnt == EPC_PLL_LOCK_COUNT) { if (waitcnt == EPC_PLL_LOCK_COUNT) {
ERR("*** Reset Cancel failed\n"); dev_err(udc->dev, "*** Reset Cancel failed\n");
return -EINVAL; return -EINVAL;
} }
}; };
...@@ -2607,13 +2607,13 @@ static int nbu2ss_ep_enable( ...@@ -2607,13 +2607,13 @@ static int nbu2ss_ep_enable(
struct nbu2ss_udc *udc; struct nbu2ss_udc *udc;
if ((_ep == NULL) || (desc == NULL)) { if ((_ep == NULL) || (desc == NULL)) {
ERR(" *** %s, bad param\n", __func__); pr_err(" *** %s, bad param\n", __func__);
return -EINVAL; return -EINVAL;
} }
ep = container_of(_ep, struct nbu2ss_ep, ep); ep = container_of(_ep, struct nbu2ss_ep, ep);
if ((ep == NULL) || (ep->udc == NULL)) { if ((ep == NULL) || (ep->udc == NULL)) {
ERR(" *** %s, ep == NULL !!\n", __func__); pr_err(" *** %s, ep == NULL !!\n", __func__);
return -EINVAL; return -EINVAL;
} }
...@@ -2621,7 +2621,7 @@ static int nbu2ss_ep_enable( ...@@ -2621,7 +2621,7 @@ static int nbu2ss_ep_enable(
if ((ep_type == USB_ENDPOINT_XFER_CONTROL) if ((ep_type == USB_ENDPOINT_XFER_CONTROL)
|| (ep_type == USB_ENDPOINT_XFER_ISOC)) { || (ep_type == USB_ENDPOINT_XFER_ISOC)) {
ERR(" *** %s, bat bmAttributes\n", __func__); pr_err(" *** %s, bat bmAttributes\n", __func__);
return -EINVAL; return -EINVAL;
} }
...@@ -2632,7 +2632,7 @@ static int nbu2ss_ep_enable( ...@@ -2632,7 +2632,7 @@ static int nbu2ss_ep_enable(
if ((udc->driver == NULL) if ((udc->driver == NULL)
|| (udc->gadget.speed == USB_SPEED_UNKNOWN)) { || (udc->gadget.speed == USB_SPEED_UNKNOWN)) {
ERR(" *** %s, udc !!\n", __func__); dev_err(ep->udc->dev, " *** %s, udc !!\n", __func__);
return -ESHUTDOWN; return -ESHUTDOWN;
} }
...@@ -2667,13 +2667,13 @@ static int nbu2ss_ep_disable(struct usb_ep *_ep) ...@@ -2667,13 +2667,13 @@ static int nbu2ss_ep_disable(struct usb_ep *_ep)
unsigned long flags; unsigned long flags;
if (_ep == NULL) { if (_ep == NULL) {
ERR(" *** %s, bad param\n", __func__); pr_err(" *** %s, bad param\n", __func__);
return -EINVAL; return -EINVAL;
} }
ep = container_of(_ep, struct nbu2ss_ep, ep); ep = container_of(_ep, struct nbu2ss_ep, ep);
if ((ep == NULL) || (ep->udc == NULL)) { if ((ep == NULL) || (ep->udc == NULL)) {
ERR(" *** %s, ep == NULL !!\n", __func__); pr_err("udc: *** %s, ep == NULL !!\n", __func__);
return -EINVAL; return -EINVAL;
} }
...@@ -2737,10 +2737,10 @@ static int nbu2ss_ep_queue( ...@@ -2737,10 +2737,10 @@ static int nbu2ss_ep_queue(
/* catch various bogus parameters */ /* catch various bogus parameters */
if ((_ep == NULL) || (_req == NULL)) { if ((_ep == NULL) || (_req == NULL)) {
if (_ep == NULL) if (_ep == NULL)
ERR("*** %s --- _ep == NULL\n", __func__); pr_err("udc: %s --- _ep == NULL\n", __func__);
if (_req == NULL) if (_req == NULL)
ERR("*** %s --- _req == NULL\n", __func__); pr_err("udc: %s --- _req == NULL\n", __func__);
return -EINVAL; return -EINVAL;
} }
...@@ -2751,13 +2751,13 @@ static int nbu2ss_ep_queue( ...@@ -2751,13 +2751,13 @@ static int nbu2ss_ep_queue(
|| !list_empty(&req->queue))) { || !list_empty(&req->queue))) {
if (!_req->complete) if (!_req->complete)
ERR("*** %s --- !_req->complete\n", __func__); pr_err("udc: %s --- !_req->complete\n", __func__);
if (!_req->buf) if (!_req->buf)
ERR("*** %s --- !_req->buf\n", __func__); pr_err("udc:%s --- !_req->buf\n", __func__);
if (!list_empty(&req->queue)) if (!list_empty(&req->queue))
ERR("*** %s --- !list_empty(&req->queue)\n", __func__); pr_err("%s --- !list_empty(&req->queue)\n", __func__);
return -EINVAL; return -EINVAL;
} }
...@@ -2773,7 +2773,8 @@ static int nbu2ss_ep_queue( ...@@ -2773,7 +2773,8 @@ static int nbu2ss_ep_queue(
} }
if (unlikely(!udc->driver)) { if (unlikely(!udc->driver)) {
ERR("%s, bogus device state %p\n", __func__, udc->driver); dev_err(udc->dev, "%s, bogus device state %p\n", __func__,
udc->driver);
return -ESHUTDOWN; return -ESHUTDOWN;
} }
...@@ -2812,7 +2813,8 @@ static int nbu2ss_ep_queue( ...@@ -2812,7 +2813,8 @@ static int nbu2ss_ep_queue(
result = _nbu2ss_start_transfer(udc, ep, req, FALSE); result = _nbu2ss_start_transfer(udc, ep, req, FALSE);
if (result < 0) { if (result < 0) {
ERR(" *** %s, result = %d\n", __func__, result); dev_err(udc->dev, " *** %s, result = %d\n", __func__,
result);
list_del(&req->queue); list_del(&req->queue);
} else if ((ep->epnum > 0) && (ep->direct == USB_DIR_OUT)) { } else if ((ep->epnum > 0) && (ep->direct == USB_DIR_OUT)) {
#ifdef USE_DMA #ifdef USE_DMA
...@@ -2844,13 +2846,13 @@ static int nbu2ss_ep_dequeue( ...@@ -2844,13 +2846,13 @@ static int nbu2ss_ep_dequeue(
/* catch various bogus parameters */ /* catch various bogus parameters */
if ((_ep == NULL) || (_req == NULL)) { if ((_ep == NULL) || (_req == NULL)) {
/* ERR("%s, bad param(1)\n", __func__); */ /* pr_err("%s, bad param(1)\n", __func__); */
return -EINVAL; return -EINVAL;
} }
ep = container_of(_ep, struct nbu2ss_ep, ep); ep = container_of(_ep, struct nbu2ss_ep, ep);
if (!ep) { if (!ep) {
ERR("%s, ep == NULL !!\n", __func__); pr_err("%s, ep == NULL !!\n", __func__);
return -EINVAL; return -EINVAL;
} }
...@@ -2890,19 +2892,19 @@ static int nbu2ss_ep_set_halt(struct usb_ep *_ep, int value) ...@@ -2890,19 +2892,19 @@ static int nbu2ss_ep_set_halt(struct usb_ep *_ep, int value)
/* INFO("=== %s()\n", __func__); */ /* INFO("=== %s()\n", __func__); */
if (!_ep) { if (!_ep) {
ERR("%s, bad param\n", __func__); pr_err("%s, bad param\n", __func__);
return -EINVAL; return -EINVAL;
} }
ep = container_of(_ep, struct nbu2ss_ep, ep); ep = container_of(_ep, struct nbu2ss_ep, ep);
if (!ep) { if (!ep) {
ERR("%s, bad ep\n", __func__); pr_err("%s, bad ep\n", __func__);
return -EINVAL; return -EINVAL;
} }
udc = ep->udc; udc = ep->udc;
if (!udc) { if (!udc) {
ERR(" *** %s, bad udc\n", __func__); dev_err(ep->udc->dev, " *** %s, bad udc\n", __func__);
return -EINVAL; return -EINVAL;
} }
...@@ -2944,19 +2946,19 @@ static int nbu2ss_ep_fifo_status(struct usb_ep *_ep) ...@@ -2944,19 +2946,19 @@ static int nbu2ss_ep_fifo_status(struct usb_ep *_ep)
/* INFO("=== %s()\n", __func__); */ /* INFO("=== %s()\n", __func__); */
if (!_ep) { if (!_ep) {
ERR("%s, bad param\n", __func__); pr_err("%s, bad param\n", __func__);
return -EINVAL; return -EINVAL;
} }
ep = container_of(_ep, struct nbu2ss_ep, ep); ep = container_of(_ep, struct nbu2ss_ep, ep);
if (!ep) { if (!ep) {
ERR("%s, bad ep\n", __func__); pr_err("%s, bad ep\n", __func__);
return -EINVAL; return -EINVAL;
} }
udc = ep->udc; udc = ep->udc;
if (!udc) { if (!udc) {
ERR("%s, bad udc\n", __func__); dev_err(ep->udc->dev, "%s, bad udc\n", __func__);
return -EINVAL; return -EINVAL;
} }
...@@ -2992,19 +2994,19 @@ static void nbu2ss_ep_fifo_flush(struct usb_ep *_ep) ...@@ -2992,19 +2994,19 @@ static void nbu2ss_ep_fifo_flush(struct usb_ep *_ep)
/* INFO("=== %s()\n", __func__); */ /* INFO("=== %s()\n", __func__); */
if (!_ep) { if (!_ep) {
ERR("%s, bad param\n", __func__); pr_err("udc: %s, bad param\n", __func__);
return; return;
} }
ep = container_of(_ep, struct nbu2ss_ep, ep); ep = container_of(_ep, struct nbu2ss_ep, ep);
if (!_ep) { if (!_ep) {
ERR("%s, bad ep\n", __func__); pr_err("udc: %s, bad ep\n", __func__);
return; return;
} }
udc = ep->udc; udc = ep->udc;
if (!udc) { if (!udc) {
ERR("%s, bad udc\n", __func__); dev_err(ep->udc->dev, "%s, bad udc\n", __func__);
return; return;
} }
...@@ -3048,13 +3050,13 @@ static int nbu2ss_gad_get_frame(struct usb_gadget *pgadget) ...@@ -3048,13 +3050,13 @@ static int nbu2ss_gad_get_frame(struct usb_gadget *pgadget)
/* INFO("=== %s()\n", __func__); */ /* INFO("=== %s()\n", __func__); */
if (pgadget == NULL) { if (pgadget == NULL) {
ERR("%s, bad param\n", __func__); pr_err("udc: %s, bad param\n", __func__);
return -EINVAL; return -EINVAL;
} }
udc = container_of(pgadget, struct nbu2ss_udc, gadget); udc = container_of(pgadget, struct nbu2ss_udc, gadget);
if (udc == NULL) { if (udc == NULL) {
ERR("%s, udc == NULL\n", __func__); dev_err(&pgadget->dev, "%s, udc == NULL\n", __func__);
return -EINVAL; return -EINVAL;
} }
...@@ -3078,13 +3080,13 @@ static int nbu2ss_gad_wakeup(struct usb_gadget *pgadget) ...@@ -3078,13 +3080,13 @@ static int nbu2ss_gad_wakeup(struct usb_gadget *pgadget)
/* INFO("=== %s()\n", __func__); */ /* INFO("=== %s()\n", __func__); */
if (pgadget == NULL) { if (pgadget == NULL) {
ERR("%s, bad param\n", __func__); pr_err("%s, bad param\n", __func__);
return -EINVAL; return -EINVAL;
} }
udc = container_of(pgadget, struct nbu2ss_udc, gadget); udc = container_of(pgadget, struct nbu2ss_udc, gadget);
if (udc == NULL) { if (udc == NULL) {
ERR("%s, udc == NULL\n", __func__); dev_err(&pgadget->dev, "%s, udc == NULL\n", __func__);
return -EINVAL; return -EINVAL;
} }
...@@ -3118,7 +3120,7 @@ static int nbu2ss_gad_set_selfpowered(struct usb_gadget *pgadget, ...@@ -3118,7 +3120,7 @@ static int nbu2ss_gad_set_selfpowered(struct usb_gadget *pgadget,
/* INFO("=== %s()\n", __func__); */ /* INFO("=== %s()\n", __func__); */
if (pgadget == NULL) { if (pgadget == NULL) {
ERR("%s, bad param\n", __func__); pr_err("%s, bad param\n", __func__);
return -EINVAL; return -EINVAL;
} }
...@@ -3147,7 +3149,7 @@ static int nbu2ss_gad_vbus_draw(struct usb_gadget *pgadget, unsigned mA) ...@@ -3147,7 +3149,7 @@ static int nbu2ss_gad_vbus_draw(struct usb_gadget *pgadget, unsigned mA)
/* INFO("=== %s()\n", __func__); */ /* INFO("=== %s()\n", __func__); */
if (pgadget == NULL) { if (pgadget == NULL) {
ERR("%s, bad param\n", __func__); pr_err("%s, bad param\n", __func__);
return -EINVAL; return -EINVAL;
} }
...@@ -3169,7 +3171,7 @@ static int nbu2ss_gad_pullup(struct usb_gadget *pgadget, int is_on) ...@@ -3169,7 +3171,7 @@ static int nbu2ss_gad_pullup(struct usb_gadget *pgadget, int is_on)
/* INFO("=== %s()\n", __func__); */ /* INFO("=== %s()\n", __func__); */
if (pgadget == NULL) { if (pgadget == NULL) {
ERR("%s, bad param\n", __func__); pr_err("%s, bad param\n", __func__);
return -EINVAL; return -EINVAL;
} }
...@@ -3340,7 +3342,7 @@ static int nbu2ss_drv_probe(struct platform_device *pdev) ...@@ -3340,7 +3342,7 @@ static int nbu2ss_drv_probe(struct platform_device *pdev)
/* USB Function Controller Interrupt */ /* USB Function Controller Interrupt */
if (status != 0) { if (status != 0) {
ERR("request_irq(USB_UDC_IRQ_1) failed\n"); dev_err(udc->dev, "request_irq(USB_UDC_IRQ_1) failed\n");
goto cleanup1; goto cleanup1;
} }
...@@ -3360,7 +3362,7 @@ static int nbu2ss_drv_probe(struct platform_device *pdev) ...@@ -3360,7 +3362,7 @@ static int nbu2ss_drv_probe(struct platform_device *pdev)
udc); udc);
if (status != 0) { if (status != 0) {
ERR("request_irq(INT_VBUS) failed\n"); dev_err(udc->dev, "request_irq(INT_VBUS) failed\n");
goto cleanup1; goto cleanup1;
} }
......
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