Commit ca40daf3 authored by Tian Tao's avatar Tian Tao Committed by Bartosz Golaszewski

gpio: omap: Use device_get_match_data() helper

Use the device_get_match_data() helper instead of open coding.
Signed-off-by: default avatarTian Tao <tiantao6@hisilicon.com>
Signed-off-by: default avatarBartosz Golaszewski <bgolaszewski@baylibre.com>
parent 0d82fb11
...@@ -1364,15 +1364,14 @@ static int omap_gpio_probe(struct platform_device *pdev) ...@@ -1364,15 +1364,14 @@ static int omap_gpio_probe(struct platform_device *pdev)
{ {
struct device *dev = &pdev->dev; struct device *dev = &pdev->dev;
struct device_node *node = dev->of_node; struct device_node *node = dev->of_node;
const struct of_device_id *match;
const struct omap_gpio_platform_data *pdata; const struct omap_gpio_platform_data *pdata;
struct gpio_bank *bank; struct gpio_bank *bank;
struct irq_chip *irqc; struct irq_chip *irqc;
int ret; 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) if (!pdata)
return -EINVAL; return -EINVAL;
......
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