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>
This commit is contained in:
parent
ff360d62d9
commit
ce7793e9ef
@ -6,11 +6,7 @@ if (X86 || COMPILE_TEST)
|
|||||||
config PINCTRL_BAYTRAIL
|
config PINCTRL_BAYTRAIL
|
||||||
bool "Intel Baytrail GPIO pin control"
|
bool "Intel Baytrail GPIO pin control"
|
||||||
depends on ACPI
|
depends on ACPI
|
||||||
select GPIOLIB
|
select PINCTRL_INTEL
|
||||||
select GPIOLIB_IRQCHIP
|
|
||||||
select PINMUX
|
|
||||||
select PINCONF
|
|
||||||
select GENERIC_PINCONF
|
|
||||||
help
|
help
|
||||||
driver for memory mapped GPIO functionality on Intel Baytrail
|
driver for memory mapped GPIO functionality on Intel Baytrail
|
||||||
platforms. Supports 3 banks with 102, 28 and 44 gpios.
|
platforms. Supports 3 banks with 102, 28 and 44 gpios.
|
||||||
|
@ -1635,28 +1635,14 @@ static const struct acpi_device_id byt_gpio_acpi_match[] = {
|
|||||||
|
|
||||||
static int byt_pinctrl_probe(struct platform_device *pdev)
|
static int byt_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 device *dev = &pdev->dev;
|
struct device *dev = &pdev->dev;
|
||||||
struct acpi_device *acpi_dev;
|
|
||||||
struct intel_pinctrl *vg;
|
struct intel_pinctrl *vg;
|
||||||
int i, ret;
|
int ret;
|
||||||
|
|
||||||
acpi_dev = ACPI_COMPANION(dev);
|
soc_data = intel_pinctrl_get_soc_data(pdev);
|
||||||
if (!acpi_dev)
|
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(acpi_dev->pnp.unique_id, soc_table[i]->uid)) {
|
|
||||||
soc_data = soc_table[i];
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!soc_data)
|
|
||||||
return -ENODEV;
|
|
||||||
|
|
||||||
vg = devm_kzalloc(dev, sizeof(*vg), GFP_KERNEL);
|
vg = devm_kzalloc(dev, sizeof(*vg), GFP_KERNEL);
|
||||||
if (!vg)
|
if (!vg)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user