Skip to content

Commit ce7793e

Browse files
committed
pinctrl: baytrail: 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>
1 parent ff360d6 commit ce7793e

2 files changed

Lines changed: 6 additions & 24 deletions

File tree

‎drivers/pinctrl/intel/Kconfig‎

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,7 @@ if (X86 || COMPILE_TEST)
66
config PINCTRL_BAYTRAIL
77
bool "Intel Baytrail GPIO pin control"
88
depends on ACPI
9-
select GPIOLIB
10-
select GPIOLIB_IRQCHIP
11-
select PINMUX
12-
select PINCONF
13-
select GENERIC_PINCONF
9+
select PINCTRL_INTEL
1410
help
1511
driver for memory mapped GPIO functionality on Intel Baytrail
1612
platforms. Supports 3 banks with 102, 28 and 44 gpios.

‎drivers/pinctrl/intel/pinctrl-baytrail.c‎

Lines changed: 5 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1635,28 +1635,14 @@ static const struct acpi_device_id byt_gpio_acpi_match[] = {
16351635

16361636
static int byt_pinctrl_probe(struct platform_device *pdev)
16371637
{
1638-
const struct intel_pinctrl_soc_data *soc_data = NULL;
1639-
const struct intel_pinctrl_soc_data **soc_table;
1638+
const struct intel_pinctrl_soc_data *soc_data;
16401639
struct device *dev = &pdev->dev;
1641-
struct acpi_device *acpi_dev;
16421640
struct intel_pinctrl *vg;
1643-
int i, ret;
1644-
1645-
acpi_dev = ACPI_COMPANION(dev);
1646-
if (!acpi_dev)
1647-
return -ENODEV;
1648-
1649-
soc_table = (const struct intel_pinctrl_soc_data **)device_get_match_data(dev);
1650-
1651-
for (i = 0; soc_table[i]; i++) {
1652-
if (!strcmp(acpi_dev->pnp.unique_id, soc_table[i]->uid)) {
1653-
soc_data = soc_table[i];
1654-
break;
1655-
}
1656-
}
1641+
int ret;
16571642

1658-
if (!soc_data)
1659-
return -ENODEV;
1643+
soc_data = intel_pinctrl_get_soc_data(pdev);
1644+
if (IS_ERR(soc_data))
1645+
return PTR_ERR(soc_data);
16601646

16611647
vg = devm_kzalloc(dev, sizeof(*vg), GFP_KERNEL);
16621648
if (!vg)

0 commit comments

Comments
 (0)