Commit 99d9806f authored by Andy Shevchenko's avatar Andy Shevchenko Committed by Linus Walleij

pinctrl: broxton: Convert to use intel_pinctrl_probe_by_uid()

Get rid of code duplication by converting to use intel_pinctrl_probe_by_uid().

No functional change intended.
Signed-off-by: default avatarAndy Shevchenko <andriy.shevchenko@linux.intel.com>
Acked-by: default avatarMika Westerberg <mika.westerberg@linux.intel.com>
Signed-off-by: default avatarLinus Walleij <linus.walleij@linaro.org>
parent 924cf800
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
* Author: Mika Westerberg <mika.westerberg@linux.intel.com> * Author: Mika Westerberg <mika.westerberg@linux.intel.com>
*/ */
#include <linux/acpi.h> #include <linux/mod_devicetable.h>
#include <linux/module.h> #include <linux/module.h>
#include <linux/platform_device.h> #include <linux/platform_device.h>
#include <linux/pm.h> #include <linux/pm.h>
...@@ -1008,44 +1008,7 @@ static const struct platform_device_id bxt_pinctrl_platform_ids[] = { ...@@ -1008,44 +1008,7 @@ static const struct platform_device_id bxt_pinctrl_platform_ids[] = {
static int bxt_pinctrl_probe(struct platform_device *pdev) static int bxt_pinctrl_probe(struct platform_device *pdev)
{ {
const struct intel_pinctrl_soc_data *soc_data = NULL; return intel_pinctrl_probe_by_uid(pdev);
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);
} }
static const struct dev_pm_ops bxt_pinctrl_pm_ops = { static const struct dev_pm_ops bxt_pinctrl_pm_ops = {
......
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