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/dwc2/params.c | 21 ++++++--------------- 1 file changed, 6 insertions(+), 15 deletions(-) (limited to 'drivers/usb/dwc2') diff --git a/drivers/usb/dwc2/params.c b/drivers/usb/dwc2/params.c index 93f52e371cdd..fb03162ae9b7 100644 --- a/drivers/usb/dwc2/params.c +++ b/drivers/usb/dwc2/params.c @@ -5,7 +5,7 @@ #include #include -#include +#include #include #include #include @@ -968,26 +968,17 @@ typedef void (*set_params_cb)(struct dwc2_hsotg *data); int dwc2_init_params(struct dwc2_hsotg *hsotg) { - const struct of_device_id *match; set_params_cb set_params; dwc2_set_default_params(hsotg); dwc2_get_device_properties(hsotg); - match = of_match_device(dwc2_of_match_table, hsotg->dev); - if (match && match->data) { - set_params = match->data; + set_params = device_get_match_data(hsotg->dev); + if (set_params) { set_params(hsotg); - } else if (!match) { - const struct acpi_device_id *amatch; - const struct pci_device_id *pmatch = NULL; - - amatch = acpi_match_device(dwc2_acpi_match, hsotg->dev); - if (amatch && amatch->driver_data) { - set_params = (set_params_cb)amatch->driver_data; - set_params(hsotg); - } else if (!amatch) - pmatch = pci_match_id(dwc2_pci_ids, to_pci_dev(hsotg->dev->parent)); + } else { + const struct pci_device_id *pmatch = + pci_match_id(dwc2_pci_ids, to_pci_dev(hsotg->dev->parent)); if (pmatch && pmatch->driver_data) { set_params = (set_params_cb)pmatch->driver_data; -- cgit