diff options
author | Andy Shevchenko <andriy.shevchenko@linux.intel.com> | 2020-04-15 17:15:27 +0300 |
---|---|---|
committer | Linus Walleij <linus.walleij@linaro.org> | 2020-04-17 13:30:06 +0300 |
commit | 9826bbe1fef0b5a2432acce0292562891b1feb57 (patch) | |
tree | c5f792568c6ac667bb7b979ac153d46204f22dd3 /drivers | |
parent | e092bc5044ca8bb7acfa2930a96a5f1dba4148aa (diff) | |
download | linux-9826bbe1fef0b5a2432acce0292562891b1feb57.tar.xz |
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: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Tested-by: Serge Semin <fancer.lancer@gmail.com>
Reviewed-by: Serge Semin <fancer.lancer@gmail.com>
Link: https://lore.kernel.org/r/20200415141534.31240-8-andriy.shevchenko@linux.intel.com
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/gpio/gpio-dwapb.c | 13 |
1 files changed, 1 insertions, 12 deletions
diff --git a/drivers/gpio/gpio-dwapb.c b/drivers/gpio/gpio-dwapb.c index 2edccc5bbc25..8b30ded9322a 100644 --- a/drivers/gpio/gpio-dwapb.c +++ b/drivers/gpio/gpio-dwapb.c @@ -683,18 +683,7 @@ static int dwapb_gpio_probe(struct platform_device *pdev) return err; } - gpio->flags = 0; - 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; - } - } + gpio->flags = (uintptr_t)device_get_match_data(dev); for (i = 0; i < gpio->nr_ports; i++) { err = dwapb_gpio_add_port(gpio, &pdata->properties[i], i); |