1 From 27cd321a365fecac857e41ad1681062994142e4a Mon Sep 17 00:00:00 2001
2 From: Linus Walleij <linus.walleij@linaro.org>
3 Date: Mon, 14 Nov 2022 12:51:58 +0100
4 Subject: [PATCH 08/29] fotg210-udc: Use dev pointer in probe and dev_messages
6 Add a local struct device *dev pointer and use dev_err()
9 Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
10 Link: https://lore.kernel.org/r/20221114115201.302887-1-linus.walleij@linaro.org
11 Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
13 --- a/drivers/usb/fotg210/fotg210-udc.c
14 +++ b/drivers/usb/fotg210/fotg210-udc.c
15 @@ -1104,6 +1104,7 @@ int fotg210_udc_probe(struct platform_de
16 struct resource *res, *ires;
17 struct fotg210_udc *fotg210 = NULL;
18 struct fotg210_ep *_ep[FOTG210_MAX_NUM_EP];
19 + struct device *dev = &pdev->dev;
23 @@ -1135,7 +1136,7 @@ int fotg210_udc_probe(struct platform_de
25 fotg210->reg = ioremap(res->start, resource_size(res));
26 if (fotg210->reg == NULL) {
27 - pr_err("ioremap error.\n");
28 + dev_err(dev, "ioremap error\n");
32 @@ -1146,8 +1147,8 @@ int fotg210_udc_probe(struct platform_de
33 fotg210->gadget.ops = &fotg210_gadget_ops;
35 fotg210->gadget.max_speed = USB_SPEED_HIGH;
36 - fotg210->gadget.dev.parent = &pdev->dev;
37 - fotg210->gadget.dev.dma_mask = pdev->dev.dma_mask;
38 + fotg210->gadget.dev.parent = dev;
39 + fotg210->gadget.dev.dma_mask = dev->dma_mask;
40 fotg210->gadget.name = udc_name;
42 INIT_LIST_HEAD(&fotg210->gadget.ep_list);
43 @@ -1195,15 +1196,15 @@ int fotg210_udc_probe(struct platform_de
44 ret = request_irq(ires->start, fotg210_irq, IRQF_SHARED,
47 - pr_err("request_irq error (%d)\n", ret);
48 + dev_err(dev, "request_irq error (%d)\n", ret);
52 - ret = usb_add_gadget_udc(&pdev->dev, &fotg210->gadget);
53 + ret = usb_add_gadget_udc(dev, &fotg210->gadget);
57 - dev_info(&pdev->dev, "version %s\n", DRIVER_VERSION);
58 + dev_info(dev, "version %s\n", DRIVER_VERSION);