summaryrefslogtreecommitdiff
path: root/drivers/usb/fotg210
diff options
context:
space:
mode:
authorLinus Walleij <linus.walleij@linaro.org>2022-11-14 14:51:58 +0300
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2022-11-22 19:25:23 +0300
commitd40eaada4209959264be63b21e18e15030db0a38 (patch)
treed44f414f777583e6a87ccdf11243160d7c2a1a17 /drivers/usb/fotg210
parent6d36e0e1a14ac9a382c7a157bce5354fd8b68134 (diff)
downloadlinux-d40eaada4209959264be63b21e18e15030db0a38.tar.xz
fotg210-udc: Use dev pointer in probe and dev_messages
Add a local struct device *dev pointer and use dev_err() etc to report status. Signed-off-by: Linus Walleij <linus.walleij@linaro.org> Link: https://lore.kernel.org/r/20221114115201.302887-1-linus.walleij@linaro.org Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/usb/fotg210')
-rw-r--r--drivers/usb/fotg210/fotg210-udc.c13
1 files changed, 7 insertions, 6 deletions
diff --git a/drivers/usb/fotg210/fotg210-udc.c b/drivers/usb/fotg210/fotg210-udc.c
index 3c357ce42d3b..b3106e4b3194 100644
--- a/drivers/usb/fotg210/fotg210-udc.c
+++ b/drivers/usb/fotg210/fotg210-udc.c
@@ -1091,6 +1091,7 @@ int fotg210_udc_probe(struct platform_device *pdev)
struct resource *res, *ires;
struct fotg210_udc *fotg210 = NULL;
struct fotg210_ep *_ep[FOTG210_MAX_NUM_EP];
+ struct device *dev = &pdev->dev;
int ret = 0;
int i;
@@ -1122,7 +1123,7 @@ int fotg210_udc_probe(struct platform_device *pdev)
fotg210->reg = ioremap(res->start, resource_size(res));
if (fotg210->reg == NULL) {
- pr_err("ioremap error.\n");
+ dev_err(dev, "ioremap error\n");
goto err_alloc;
}
@@ -1133,8 +1134,8 @@ int fotg210_udc_probe(struct platform_device *pdev)
fotg210->gadget.ops = &fotg210_gadget_ops;
fotg210->gadget.max_speed = USB_SPEED_HIGH;
- fotg210->gadget.dev.parent = &pdev->dev;
- fotg210->gadget.dev.dma_mask = pdev->dev.dma_mask;
+ fotg210->gadget.dev.parent = dev;
+ fotg210->gadget.dev.dma_mask = dev->dma_mask;
fotg210->gadget.name = udc_name;
INIT_LIST_HEAD(&fotg210->gadget.ep_list);
@@ -1180,15 +1181,15 @@ int fotg210_udc_probe(struct platform_device *pdev)
ret = request_irq(ires->start, fotg210_irq, IRQF_SHARED,
udc_name, fotg210);
if (ret < 0) {
- pr_err("request_irq error (%d)\n", ret);
+ dev_err(dev, "request_irq error (%d)\n", ret);
goto err_req;
}
- ret = usb_add_gadget_udc(&pdev->dev, &fotg210->gadget);
+ ret = usb_add_gadget_udc(dev, &fotg210->gadget);
if (ret)
goto err_add_udc;
- dev_info(&pdev->dev, "version %s\n", DRIVER_VERSION);
+ dev_info(dev, "version %s\n", DRIVER_VERSION);
return 0;