* [PATCH] usb: gadget: udc: renesas_usb3: Use of_device_get_match_data() helper
@ 2017-10-04 12:23 Geert Uytterhoeven
2017-10-05 9:18 ` Simon Horman
2017-10-05 10:36 ` Yoshihiro Shimoda
0 siblings, 2 replies; 3+ messages in thread
From: Geert Uytterhoeven @ 2017-10-04 12:23 UTC (permalink / raw)
To: Felipe Balbi, Yoshihiro Shimoda
Cc: Greg Kroah-Hartman, linux-usb, linux-renesas-soc, Geert Uytterhoeven
Use the of_device_get_match_data() helper instead of open coding,
postponing the matching until when it's really needed.
Note that the renesas_usb3 driver is used with DT only, so there's
always a valid match.
Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
---
drivers/usb/gadget/udc/renesas_usb3.c | 7 +------
1 file changed, 1 insertion(+), 6 deletions(-)
diff --git a/drivers/usb/gadget/udc/renesas_usb3.c b/drivers/usb/gadget/udc/renesas_usb3.c
index df37c1e6e9d5cc3e..acbf0feb47c85942 100644
--- a/drivers/usb/gadget/udc/renesas_usb3.c
+++ b/drivers/usb/gadget/udc/renesas_usb3.c
@@ -2549,20 +2549,15 @@ static int renesas_usb3_probe(struct platform_device *pdev)
{
struct renesas_usb3 *usb3;
struct resource *res;
- const struct of_device_id *match;
int irq, ret;
const struct renesas_usb3_priv *priv;
const struct soc_device_attribute *attr;
- match = of_match_node(usb3_of_match, pdev->dev.of_node);
- if (!match)
- return -ENODEV;
-
attr = soc_device_match(renesas_usb3_quirks_match);
if (attr)
priv = attr->data;
else
- priv = match->data;
+ priv = of_device_get_match_data(&pdev->dev);
irq = platform_get_irq(pdev, 0);
if (irq < 0) {
--
2.7.4
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] usb: gadget: udc: renesas_usb3: Use of_device_get_match_data() helper
2017-10-04 12:23 [PATCH] usb: gadget: udc: renesas_usb3: Use of_device_get_match_data() helper Geert Uytterhoeven
@ 2017-10-05 9:18 ` Simon Horman
2017-10-05 10:36 ` Yoshihiro Shimoda
1 sibling, 0 replies; 3+ messages in thread
From: Simon Horman @ 2017-10-05 9:18 UTC (permalink / raw)
To: Geert Uytterhoeven
Cc: Felipe Balbi, Yoshihiro Shimoda, Greg Kroah-Hartman, linux-usb,
linux-renesas-soc
On Wed, Oct 04, 2017 at 02:23:31PM +0200, Geert Uytterhoeven wrote:
> Use the of_device_get_match_data() helper instead of open coding,
> postponing the matching until when it's really needed.
> Note that the renesas_usb3 driver is used with DT only, so there's
> always a valid match.
>
> Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
Reviewed-by: Simon Horman <horms+renesas@verge.net.au>
^ permalink raw reply [flat|nested] 3+ messages in thread
* RE: [PATCH] usb: gadget: udc: renesas_usb3: Use of_device_get_match_data() helper
2017-10-04 12:23 [PATCH] usb: gadget: udc: renesas_usb3: Use of_device_get_match_data() helper Geert Uytterhoeven
2017-10-05 9:18 ` Simon Horman
@ 2017-10-05 10:36 ` Yoshihiro Shimoda
1 sibling, 0 replies; 3+ messages in thread
From: Yoshihiro Shimoda @ 2017-10-05 10:36 UTC (permalink / raw)
To: Geert Uytterhoeven, Felipe Balbi
Cc: Greg Kroah-Hartman, linux-usb, linux-renesas-soc
Hi,
> From: Geert Uytterhoeven, Sent: Wednesday, October 4, 2017 9:24 PM
>
> Use the of_device_get_match_data() helper instead of open coding,
> postponing the matching until when it's really needed.
> Note that the renesas_usb3 driver is used with DT only, so there's
> always a valid match.
>
> Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
Thank you for the patch!
Reviewed-by: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>
Best regards,
Yoshihiro Shimoda
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2017-10-05 10:36 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-10-04 12:23 [PATCH] usb: gadget: udc: renesas_usb3: Use of_device_get_match_data() helper Geert Uytterhoeven
2017-10-05 9:18 ` Simon Horman
2017-10-05 10:36 ` Yoshihiro Shimoda
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.