]> asedeno.scripts.mit.edu Git - linux.git/commitdiff
gpio: syscon: Use of_device_get_match_data()
authorThierry Reding <treding@nvidia.com>
Mon, 30 Apr 2018 07:38:16 +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-syscon.c

index 537cec7583fcac038865c38c8731182287fcb4b1..2512acd990279b90b2b03df7c3426e6b3f61b08b 100644 (file)
@@ -182,20 +182,15 @@ MODULE_DEVICE_TABLE(of, syscon_gpio_ids);
 static int syscon_gpio_probe(struct platform_device *pdev)
 {
        struct device *dev = &pdev->dev;
-       const struct of_device_id *of_id;
        struct syscon_gpio_priv *priv;
        struct device_node *np = dev->of_node;
        int ret;
 
-       of_id = of_match_device(syscon_gpio_ids, dev);
-       if (!of_id)
-               return -ENODEV;
-
        priv = devm_kzalloc(dev, sizeof(*priv), GFP_KERNEL);
        if (!priv)
                return -ENOMEM;
 
-       priv->data = of_id->data;
+       priv->data = of_device_get_match_data(dev);
 
        if (priv->data->compatible) {
                priv->syscon = syscon_regmap_lookup_by_compatible(