Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

authored by

Tian Tao and committed by
Bartosz Golaszewski
ca40daf3 0d82fb11

+2 -3
+2 -3
drivers/gpio/gpio-omap.c
··· 1364 1364 { 1365 1365 struct device *dev = &pdev->dev; 1366 1366 struct device_node *node = dev->of_node; 1367 - const struct of_device_id *match; 1368 1367 const struct omap_gpio_platform_data *pdata; 1369 1368 struct gpio_bank *bank; 1370 1369 struct irq_chip *irqc; 1371 1370 int ret; 1372 1371 1373 - match = of_match_device(of_match_ptr(omap_gpio_match), dev); 1372 + pdata = device_get_match_data(dev); 1374 1373 1375 - pdata = match ? match->data : dev_get_platdata(dev); 1374 + pdata = pdata ?: dev_get_platdata(dev); 1376 1375 if (!pdata) 1377 1376 return -EINVAL; 1378 1377