diff options
author | Rob Herring <robh@kernel.org> | 2023-10-10 00:13:46 +0300 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2023-10-10 09:55:23 +0300 |
commit | 14485de431b0a860d3a117fe518ce9ede8c76732 (patch) | |
tree | 2bc4f736da0b87977b54d8a0b3af97fd1db16291 /drivers/usb/gadget/udc | |
parent | c19473d28235a54e92821e927cb55690ad7c5279 (diff) | |
download | linux-14485de431b0a860d3a117fe518ce9ede8c76732.tar.xz |
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 <robh@kernel.org>
Link: https://lore.kernel.org/r/20231009211356.3242037-16-robh@kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/usb/gadget/udc')
-rw-r--r-- | drivers/usb/gadget/udc/fsl_qe_udc.c | 10 |
1 files changed, 3 insertions, 7 deletions
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 <linux/interrupt.h> #include <linux/io.h> #include <linux/moduleparam.h> +#include <linux/of.h> #include <linux/of_address.h> #include <linux/of_irq.h> -#include <linux/of_platform.h> +#include <linux/platform_device.h> #include <linux/dma-mapping.h> #include <linux/usb/ch9.h> #include <linux/usb/gadget.h> @@ -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; |