pinctrl: baytrail: Switch to use intel_pinctrl_get_soc_data()
authorAndy Shevchenko <andriy.shevchenko@linux.intel.com>
Wed, 29 Jul 2020 11:57:07 +0000 (14:57 +0300)
committerAndy Shevchenko <andriy.shevchenko@linux.intel.com>
Thu, 20 Aug 2020 09:37:07 +0000 (12:37 +0300)
Since we have common helper to retrieve SoC data from driver data
we may switch to use it.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Acked-by: Mika Westerberg <mika.westerberg@linux.intel.com>
drivers/pinctrl/intel/Kconfig
drivers/pinctrl/intel/pinctrl-baytrail.c

index b3e6060db52d6dbf8c10389ece5f7d33dc377c1e..c7f0d5d9d9d367f2f1fe15373819a7f40526ac5c 100644 (file)
@@ -6,11 +6,7 @@ if (X86 || COMPILE_TEST)
 config PINCTRL_BAYTRAIL
        bool "Intel Baytrail GPIO pin control"
        depends on ACPI
-       select GPIOLIB
-       select GPIOLIB_IRQCHIP
-       select PINMUX
-       select PINCONF
-       select GENERIC_PINCONF
+       select PINCTRL_INTEL
        help
          driver for memory mapped GPIO functionality on Intel Baytrail
          platforms. Supports 3 banks with 102, 28 and 44 gpios.
index d6e35cba3065a4cef60bce240ac7d99dca29d27b..d49aab3cfbaa3cb17dbb0bc18bf6c6c9a342eb16 100644 (file)
@@ -1635,28 +1635,14 @@ static const struct acpi_device_id byt_gpio_acpi_match[] = {
 
 static int byt_pinctrl_probe(struct platform_device *pdev)
 {
-       const struct intel_pinctrl_soc_data *soc_data = NULL;
-       const struct intel_pinctrl_soc_data **soc_table;
+       const struct intel_pinctrl_soc_data *soc_data;
        struct device *dev = &pdev->dev;
-       struct acpi_device *acpi_dev;
        struct intel_pinctrl *vg;
-       int i, ret;
-
-       acpi_dev = ACPI_COMPANION(dev);
-       if (!acpi_dev)
-               return -ENODEV;
-
-       soc_table = (const struct intel_pinctrl_soc_data **)device_get_match_data(dev);
-
-       for (i = 0; soc_table[i]; i++) {
-               if (!strcmp(acpi_dev->pnp.unique_id, soc_table[i]->uid)) {
-                       soc_data = soc_table[i];
-                       break;
-               }
-       }
+       int ret;
 
-       if (!soc_data)
-               return -ENODEV;
+       soc_data = intel_pinctrl_get_soc_data(pdev);
+       if (IS_ERR(soc_data))
+               return PTR_ERR(soc_data);
 
        vg = devm_kzalloc(dev, sizeof(*vg), GFP_KERNEL);
        if (!vg)