]> Git Repo - linux.git/commitdiff
watchdog: gpio_wdt: Fix missing platform_set_drvdata() in gpio_wdt_probe()
authorWei Yongjun <[email protected]>
Tue, 26 Jul 2016 14:50:14 +0000 (14:50 +0000)
committerWim Van Sebroeck <[email protected]>
Wed, 27 Jul 2016 08:47:43 +0000 (10:47 +0200)
Add missing platform_set_drvdata() in gpio_wdt_probe(), otherwise
calling platform_get_drvdata() in remove returns NULL.

This is detected by Coccinelle semantic patch.

Signed-off-by: Wei Yongjun <[email protected]>
Reviewed-by: Guenter Roeck <[email protected]>
Signed-off-by: Guenter Roeck <[email protected]>
Signed-off-by: Wim Van Sebroeck <[email protected]>
drivers/watchdog/gpio_wdt.c

index ba066e4a707beb969e51d72a22e50b51431b3d9a..93457cabc17861a8d8d4743cdda6fd27ed70436e 100644 (file)
@@ -151,6 +151,8 @@ static int gpio_wdt_probe(struct platform_device *pdev)
        if (!priv)
                return -ENOMEM;
 
+       platform_set_drvdata(pdev, priv);
+
        priv->gpio = of_get_gpio_flags(pdev->dev.of_node, 0, &flags);
        if (!gpio_is_valid(priv->gpio))
                return priv->gpio;
This page took 0.056473 seconds and 4 git commands to generate.