Commit 9826bbe1 authored by Andy Shevchenko's avatar Andy Shevchenko Committed by Linus Walleij

gpio: dwapb: Use device_get_match_data() to simplify code

Use device_get_match_data() here to simplify the code a bit.
Signed-off-by: default avatarAndy Shevchenko <andriy.shevchenko@linux.intel.com>
Tested-by: default avatarSerge Semin <fancer.lancer@gmail.com>
Reviewed-by: default avatarSerge Semin <fancer.lancer@gmail.com>
Link: https://lore.kernel.org/r/20200415141534.31240-8-andriy.shevchenko@linux.intel.comSigned-off-by: default avatarLinus Walleij <linus.walleij@linaro.org>
parent e092bc50
...@@ -683,18 +683,7 @@ static int dwapb_gpio_probe(struct platform_device *pdev) ...@@ -683,18 +683,7 @@ static int dwapb_gpio_probe(struct platform_device *pdev)
return err; return err;
} }
gpio->flags = 0; gpio->flags = (uintptr_t)device_get_match_data(dev);
if (dev->of_node) {
gpio->flags = (uintptr_t)of_device_get_match_data(dev);
} else if (has_acpi_companion(dev)) {
const struct acpi_device_id *acpi_id;
acpi_id = acpi_match_device(dwapb_acpi_match, dev);
if (acpi_id) {
if (acpi_id->driver_data)
gpio->flags = acpi_id->driver_data;
}
}
for (i = 0; i < gpio->nr_ports; i++) { for (i = 0; i < gpio->nr_ports; i++) {
err = dwapb_gpio_add_port(gpio, &pdata->properties[i], i); err = dwapb_gpio_add_port(gpio, &pdata->properties[i], i);
......
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