gpio: palmas: Use of_device_get_match_data()
authorThierry Reding <treding@nvidia.com>
Mon, 30 Apr 2018 07:38:13 +0000 (09:38 +0200)
committerLinus Walleij <linus.walleij@linaro.org>
Wed, 16 May 2018 12:35:24 +0000 (14:35 +0200)
Use of_device_get_match_data() instead of open-coding it.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
drivers/gpio/gpio-palmas.c

index 3d81819..ceb2fef 100644 (file)
@@ -159,13 +159,9 @@ static int palmas_gpio_probe(struct platform_device *pdev)
        struct palmas_platform_data *palmas_pdata;
        struct palmas_gpio *palmas_gpio;
        int ret;
-       const struct of_device_id *match;
        const struct palmas_device_data *dev_data;
 
-       match = of_match_device(of_palmas_gpio_match, &pdev->dev);
-       if (!match)
-               return -ENODEV;
-       dev_data = match->data;
+       dev_data = of_device_get_match_data(&pdev->dev);
        if (!dev_data)
                dev_data = &palmas_dev_data;