gpio: ingenic: Use of_device_get_match_data()
authorThierry Reding <treding@nvidia.com>
Mon, 30 Apr 2018 07:38:11 +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-ingenic.c

index 15fb2bc796a849889cd8213ccf9faf4196be361f..e738e384a5ca7722756dcc3d46619e566f6811e3 100644 (file)
@@ -285,8 +285,6 @@ MODULE_DEVICE_TABLE(of, ingenic_gpio_of_match);
 static int ingenic_gpio_probe(struct platform_device *pdev)
 {
        struct device *dev = &pdev->dev;
 static int ingenic_gpio_probe(struct platform_device *pdev)
 {
        struct device *dev = &pdev->dev;
-       const struct of_device_id *of_id = of_match_device(
-                       ingenic_gpio_of_match, dev);
        struct ingenic_gpio_chip *jzgc;
        u32 bank;
        int err;
        struct ingenic_gpio_chip *jzgc;
        u32 bank;
        int err;
@@ -323,7 +321,7 @@ static int ingenic_gpio_probe(struct platform_device *pdev)
        jzgc->gc.parent = dev;
        jzgc->gc.of_node = dev->of_node;
        jzgc->gc.owner = THIS_MODULE;
        jzgc->gc.parent = dev;
        jzgc->gc.of_node = dev->of_node;
        jzgc->gc.owner = THIS_MODULE;
-       jzgc->version = (enum jz_version)of_id->data;
+       jzgc->version = (enum jz_version)of_device_get_match_data(dev);
 
        jzgc->gc.set = ingenic_gpio_set;
        jzgc->gc.get = ingenic_gpio_get;
 
        jzgc->gc.set = ingenic_gpio_set;
        jzgc->gc.get = ingenic_gpio_get;