diff options
author | Tian Tao <tiantao6@hisilicon.com> | 2021-03-31 16:19:11 +0800 |
---|---|---|
committer | Bartosz Golaszewski <bgolaszewski@baylibre.com> | 2021-05-05 16:07:40 +0200 |
commit | ca40daf39daf62355d87287a8732cadb62d13e2e (patch) | |
tree | b3c1ce9872d78665b6e64faf68829ff22941acf6 /drivers/gpio/gpio-omap.c | |
parent | 0d82fb1127fb7cc8287614eb0992acb0583bc323 (diff) | |
download | linux-ca40daf39daf62355d87287a8732cadb62d13e2e.tar.bz2 |
gpio: omap: Use device_get_match_data() helper
Use the device_get_match_data() helper instead of open coding.
Signed-off-by: Tian Tao <tiantao6@hisilicon.com>
Signed-off-by: Bartosz Golaszewski <bgolaszewski@baylibre.com>
Diffstat (limited to 'drivers/gpio/gpio-omap.c')
-rw-r--r-- | drivers/gpio/gpio-omap.c | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/drivers/gpio/gpio-omap.c b/drivers/gpio/gpio-omap.c index 41952bb818ad..f4df555fc39c 100644 --- a/drivers/gpio/gpio-omap.c +++ b/drivers/gpio/gpio-omap.c @@ -1364,15 +1364,14 @@ static int omap_gpio_probe(struct platform_device *pdev) { struct device *dev = &pdev->dev; struct device_node *node = dev->of_node; - const struct of_device_id *match; const struct omap_gpio_platform_data *pdata; struct gpio_bank *bank; struct irq_chip *irqc; int ret; - match = of_match_device(of_match_ptr(omap_gpio_match), dev); + pdata = device_get_match_data(dev); - pdata = match ? match->data : dev_get_platdata(dev); + pdata = pdata ?: dev_get_platdata(dev); if (!pdata) return -EINVAL; |