Get rid of code duplication by converting to use intel_pinctrl_probe_by_uid(). No functional change intended. Signed-off-by: Andy Shevchenko <andriy.shevchenko@xxxxxxxxxxxxxxx> --- drivers/pinctrl/intel/pinctrl-broxton.c | 41 ++----------------------- 1 file changed, 2 insertions(+), 39 deletions(-) diff --git a/drivers/pinctrl/intel/pinctrl-broxton.c b/drivers/pinctrl/intel/pinctrl-broxton.c index 8b1c7b59ad3e..fc615cef33a1 100644 --- a/drivers/pinctrl/intel/pinctrl-broxton.c +++ b/drivers/pinctrl/intel/pinctrl-broxton.c @@ -6,7 +6,7 @@ * Author: Mika Westerberg <mika.westerberg@xxxxxxxxxxxxxxx> */ -#include <linux/acpi.h> +#include <linux/mod_devicetable.h> #include <linux/module.h> #include <linux/platform_device.h> #include <linux/pm.h> @@ -1008,44 +1008,7 @@ static const struct platform_device_id bxt_pinctrl_platform_ids[] = { static int bxt_pinctrl_probe(struct platform_device *pdev) { - const struct intel_pinctrl_soc_data *soc_data = NULL; - const struct intel_pinctrl_soc_data **soc_table; - struct acpi_device *adev; - int i; - - adev = ACPI_COMPANION(&pdev->dev); - if (adev) { - const struct acpi_device_id *id; - - id = acpi_match_device(bxt_pinctrl_acpi_match, &pdev->dev); - if (!id) - return -ENODEV; - - soc_table = (const struct intel_pinctrl_soc_data **) - id->driver_data; - - for (i = 0; soc_table[i]; i++) { - if (!strcmp(adev->pnp.unique_id, soc_table[i]->uid)) { - soc_data = soc_table[i]; - break; - } - } - } else { - const struct platform_device_id *pid; - - pid = platform_get_device_id(pdev); - if (!pid) - return -ENODEV; - - soc_table = (const struct intel_pinctrl_soc_data **) - pid->driver_data; - soc_data = soc_table[pdev->id]; - } - - if (!soc_data) - return -ENODEV; - - return intel_pinctrl_probe(pdev, soc_data); + return intel_pinctrl_probe_by_uid(pdev); } static const struct dev_pm_ops bxt_pinctrl_pm_ops = { -- 2.18.0