pinctrl: madera: Use local copy of pdata
authorCharles Keepax <ckeepax@opensource.cirrus.com>
Mon, 22 Jul 2019 09:10:13 +0000 (10:10 +0100)
committerLinus Walleij <linus.walleij@linaro.org>
Mon, 5 Aug 2019 09:46:25 +0000 (11:46 +0200)
A local copy of the pdata exists and it should be used rather than
pulling a fresh copy.

Signed-off-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Link: https://lore.kernel.org/r/20190722091015.20884-1-ckeepax@opensource.cirrus.com
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
drivers/pinctrl/cirrus/pinctrl-madera-core.c

index c6b9f65..0c7fa1f 100644 (file)
@@ -986,7 +986,7 @@ static struct pinctrl_desc madera_pin_desc = {
 static int madera_pin_probe(struct platform_device *pdev)
 {
        struct madera *madera = dev_get_drvdata(pdev->dev.parent);
-       const struct madera_pdata *pdata = dev_get_platdata(madera->dev);
+       const struct madera_pdata *pdata = &madera->pdata;
        struct madera_pin_private *priv;
        int ret;
 
@@ -1037,7 +1037,7 @@ static int madera_pin_probe(struct platform_device *pdev)
        }
 
        /* if the configuration is provided through pdata, apply it */
-       if (pdata && pdata->gpio_configs) {
+       if (pdata->gpio_configs) {
                ret = pinctrl_register_mappings(pdata->gpio_configs,
                                                pdata->n_gpio_configs);
                if (ret) {