From 14485de431b0a860d3a117fe518ce9ede8c76732 Mon Sep 17 00:00:00 2001 From: Rob Herring Date: Mon, 9 Oct 2023 16:13:46 -0500 Subject: usb: Use device_get_match_data() Use preferred device_get_match_data() instead of of_match_device() to get the driver match data. With this, adjust the includes to explicitly include the correct headers. Signed-off-by: Rob Herring Link: https://lore.kernel.org/r/20231009211356.3242037-16-robh@kernel.org Signed-off-by: Greg Kroah-Hartman --- drivers/usb/gadget/udc/fsl_qe_udc.c | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) (limited to 'drivers/usb/gadget/udc') diff --git a/drivers/usb/gadget/udc/fsl_qe_udc.c b/drivers/usb/gadget/udc/fsl_qe_udc.c index 4aae86b47edf..4e88681a79b6 100644 --- a/drivers/usb/gadget/udc/fsl_qe_udc.c +++ b/drivers/usb/gadget/udc/fsl_qe_udc.c @@ -27,9 +27,10 @@ #include #include #include +#include #include #include -#include +#include #include #include #include @@ -2471,17 +2472,12 @@ static const struct of_device_id qe_udc_match[]; static int qe_udc_probe(struct platform_device *ofdev) { struct qe_udc *udc; - const struct of_device_id *match; struct device_node *np = ofdev->dev.of_node; struct qe_ep *ep; unsigned int ret = 0; unsigned int i; const void *prop; - match = of_match_device(qe_udc_match, &ofdev->dev); - if (!match) - return -EINVAL; - prop = of_get_property(np, "mode", NULL); if (!prop || strcmp(prop, "peripheral")) return -ENODEV; @@ -2493,7 +2489,7 @@ static int qe_udc_probe(struct platform_device *ofdev) return -ENOMEM; } - udc->soc_type = (unsigned long)match->data; + udc->soc_type = (unsigned long)device_get_match_data(&ofdev->dev); udc->usb_regs = of_iomap(np, 0); if (!udc->usb_regs) { ret = -ENOMEM; -- cgit v1.2.3