Commit 10c857f0 authored by Andy Shevchenko's avatar Andy Shevchenko

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: default avatarAndy Shevchenko <andriy.shevchenko@linux.intel.com>
Acked-by: default avatarMika Westerberg <mika.westerberg@linux.intel.com>
parent ce7793e9
...@@ -18,11 +18,7 @@ config PINCTRL_BAYTRAIL ...@@ -18,11 +18,7 @@ config PINCTRL_BAYTRAIL
config PINCTRL_CHERRYVIEW config PINCTRL_CHERRYVIEW
tristate "Intel Cherryview/Braswell pinctrl and GPIO driver" tristate "Intel Cherryview/Braswell pinctrl and GPIO driver"
depends on ACPI depends on ACPI
select PINMUX select PINCTRL_INTEL
select PINCONF
select GENERIC_PINCONF
select GPIOLIB
select GPIOLIB_IRQCHIP
help help
Cherryview/Braswell pinctrl driver provides an interface that Cherryview/Braswell pinctrl driver provides an interface that
allows configuring of SoC pins and using them as GPIOs. allows configuring of SoC pins and using them as GPIOs.
......
...@@ -1605,28 +1605,17 @@ static acpi_status chv_pinctrl_mmio_access_handler(u32 function, ...@@ -1605,28 +1605,17 @@ static acpi_status chv_pinctrl_mmio_access_handler(u32 function,
static int chv_pinctrl_probe(struct platform_device *pdev) 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_data;
const struct intel_pinctrl_soc_data **soc_table;
struct intel_community *community; struct intel_community *community;
struct device *dev = &pdev->dev; struct device *dev = &pdev->dev;
struct acpi_device *adev = ACPI_COMPANION(dev);
struct intel_pinctrl *pctrl; struct intel_pinctrl *pctrl;
struct acpi_device *adev;
acpi_status status; acpi_status status;
int ret, irq, i; int ret, irq;
adev = ACPI_COMPANION(&pdev->dev); soc_data = intel_pinctrl_get_soc_data(pdev);
if (!adev) if (IS_ERR(soc_data))
return -ENODEV; return PTR_ERR(soc_data);
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;
pctrl = devm_kzalloc(dev, sizeof(*pctrl), GFP_KERNEL); pctrl = devm_kzalloc(dev, sizeof(*pctrl), GFP_KERNEL);
if (!pctrl) if (!pctrl)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment