diff options
author | Andy Shevchenko <andriy.shevchenko@linux.intel.com> | 2020-07-29 14:57:08 +0300 |
---|---|---|
committer | Andy Shevchenko <andriy.shevchenko@linux.intel.com> | 2020-08-20 12:37:07 +0300 |
commit | 10c857f063fc63902160755a6e23fa594290c6d3 (patch) | |
tree | d58e439ac0245d468c3461e534c9cec8ffddbe00 /drivers/pinctrl/intel | |
parent | ce7793e9ef6322d236b722ada386d3bb7ecb7df2 (diff) |
pinctrl: cherryview: Switch to use intel_pinctrl_get_soc_data()
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>
Diffstat (limited to 'drivers/pinctrl/intel')
-rw-r--r-- | drivers/pinctrl/intel/Kconfig | 6 | ||||
-rw-r--r-- | drivers/pinctrl/intel/pinctrl-cherryview.c | 23 |
2 files changed, 7 insertions, 22 deletions
diff --git a/drivers/pinctrl/intel/Kconfig b/drivers/pinctrl/intel/Kconfig index c7f0d5d9d9d3..28e5f824ba45 100644 --- a/drivers/pinctrl/intel/Kconfig +++ b/drivers/pinctrl/intel/Kconfig @@ -18,11 +18,7 @@ config PINCTRL_BAYTRAIL config PINCTRL_CHERRYVIEW tristate "Intel Cherryview/Braswell pinctrl and GPIO driver" depends on ACPI - select PINMUX - select PINCONF - select GENERIC_PINCONF - select GPIOLIB - select GPIOLIB_IRQCHIP + select PINCTRL_INTEL help Cherryview/Braswell pinctrl driver provides an interface that allows configuring of SoC pins and using them as GPIOs. diff --git a/drivers/pinctrl/intel/pinctrl-cherryview.c b/drivers/pinctrl/intel/pinctrl-cherryview.c index 86e954df82d6..e48d4445e932 100644 --- a/drivers/pinctrl/intel/pinctrl-cherryview.c +++ b/drivers/pinctrl/intel/pinctrl-cherryview.c @@ -1605,28 +1605,17 @@ static acpi_status chv_pinctrl_mmio_access_handler(u32 function, static int chv_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 intel_community *community; struct device *dev = &pdev->dev; + struct acpi_device *adev = ACPI_COMPANION(dev); struct intel_pinctrl *pctrl; - struct acpi_device *adev; acpi_status status; - int ret, irq, i; + int ret, irq; - adev = ACPI_COMPANION(&pdev->dev); - if (!adev) - return -ENODEV; - - soc_table = (const struct intel_pinctrl_soc_data **)device_get_match_data(dev); - for (i = 0; soc_table[i]; i++) { - if (!strcmp(adev->pnp.unique_id, soc_table[i]->uid)) { - soc_data = soc_table[i]; - break; - } - } - if (!soc_data) - return -ENODEV; + soc_data = intel_pinctrl_get_soc_data(pdev); + if (IS_ERR(soc_data)) + return PTR_ERR(soc_data); pctrl = devm_kzalloc(dev, sizeof(*pctrl), GFP_KERNEL); if (!pctrl) |