* [2/2] USB: gadget: pxa25x: Add DT probing
@ 2019-02-06 21:31 Robert Jarzmik
0 siblings, 0 replies; 2+ messages in thread
From: Robert Jarzmik @ 2019-02-06 21:31 UTC (permalink / raw)
To: Linus Walleij; +Cc: Greg Kroah-Hartman, Felipe Balbi, linux-usb
Linus Walleij <linus.walleij@linaro.org> writes:
> This makes it possible to instantiate the PXA25x UDC
> driver from the device tree.
>
> Cc: Robert Jarzmik <robert.jarzmik@free.fr>
> Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
> ---
> drivers/usb/gadget/udc/pxa25x_udc.c | 11 +++++++++++
> 1 file changed, 11 insertions(+)
Mmmh it's a good start, but I don't think it's complete.
The kind of errors that bother me are lines such as :
> static int pxa25x_udc_probe(struct platform_device *pdev)
> ...
> if (gpio_is_valid(dev->mach->gpio_pullup)) {
I think this will be a NULL deref and kernel crash ...
From memory this driver relies on an always filled mach platform_data structure,
so the port to devicetree should be a bit more painful.
This makes me think that either :
- you have not run tested the patch
- or I'm late in the last patches and I'm missing some information
Cheers.
---
Robert
^ permalink raw reply [flat|nested] 2+ messages in thread
* [2/2] USB: gadget: pxa25x: Add DT probing
@ 2019-02-02 23:59 Linus Walleij
0 siblings, 0 replies; 2+ messages in thread
From: Linus Walleij @ 2019-02-02 23:59 UTC (permalink / raw)
To: Greg Kroah-Hartman, Felipe Balbi; +Cc: linux-usb, Linus Walleij, Robert Jarzmik
This makes it possible to instantiate the PXA25x UDC
driver from the device tree.
Cc: Robert Jarzmik <robert.jarzmik@free.fr>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
---
drivers/usb/gadget/udc/pxa25x_udc.c | 11 +++++++++++
1 file changed, 11 insertions(+)
diff --git a/drivers/usb/gadget/udc/pxa25x_udc.c b/drivers/usb/gadget/udc/pxa25x_udc.c
index d4be53559f2e..480828b76059 100644
--- a/drivers/usb/gadget/udc/pxa25x_udc.c
+++ b/drivers/usb/gadget/udc/pxa25x_udc.c
@@ -2529,6 +2529,16 @@ static int pxa25x_udc_resume(struct platform_device *dev)
/*-------------------------------------------------------------------------*/
+static const struct of_device_id udc_of_match[] = {
+ {
+ .compatible = "intel,ixp4xx-udc",
+ },
+ {
+ .compatible = "marvell,pxa25x-udc",
+ },
+ {},
+};
+
static struct platform_driver udc_driver = {
.shutdown = pxa25x_udc_shutdown,
.probe = pxa25x_udc_probe,
@@ -2537,6 +2547,7 @@ static struct platform_driver udc_driver = {
.resume = pxa25x_udc_resume,
.driver = {
.name = "pxa25x-udc",
+ .of_match_table = of_match_ptr(udc_of_match),
},
};
^ permalink raw reply related [flat|nested] 2+ messages in thread
end of thread, other threads:[~2019-02-06 21:31 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-02-06 21:31 [2/2] USB: gadget: pxa25x: Add DT probing Robert Jarzmik
-- strict thread matches above, loose matches on Subject: below --
2019-02-02 23:59 Linus Walleij
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.