mirror of
https://github.com/AuxXxilium/linux_dsm_epyc7002.git
synced 2025-01-20 19:57:23 +07:00
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: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Acked-by: Mika Westerberg <mika.westerberg@linux.intel.com> Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
This commit is contained in:
parent
924cf80057
commit
99d9806f85
@ -6,7 +6,7 @@
|
||||
* Author: Mika Westerberg <mika.westerberg@linux.intel.com>
|
||||
*/
|
||||
|
||||
#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 = {
|
||||
|
Loading…
Reference in New Issue
Block a user