summaryrefslogtreecommitdiff
path: root/drivers/watchdog
diff options
context:
space:
mode:
authorWei Yongjun <weiyj.lk@gmail.com>2016-07-26 17:50:14 +0300
committerWim Van Sebroeck <wim@iguana.be>2016-07-27 11:47:43 +0300
commit1ac06563434e5f3302259608d3589bf7002431fe (patch)
tree0d3f8c110403103a2023386e2e397c50a0a93fec /drivers/watchdog
parent3c10bbde10fe4dca52726e246cefa6b0a1dfbd3e (diff)
downloadlinux-1ac06563434e5f3302259608d3589bf7002431fe.tar.xz
watchdog: gpio_wdt: Fix missing platform_set_drvdata() in gpio_wdt_probe()
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 <weiyj.lk@gmail.com> Reviewed-by: Guenter Roeck <linux@roeck-us.net> Signed-off-by: Guenter Roeck <linux@roeck-us.net> Signed-off-by: Wim Van Sebroeck <wim@iguana.be>
Diffstat (limited to 'drivers/watchdog')
-rw-r--r--drivers/watchdog/gpio_wdt.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/watchdog/gpio_wdt.c b/drivers/watchdog/gpio_wdt.c
index ba066e4a707b..93457cabc178 100644
--- a/drivers/watchdog/gpio_wdt.c
+++ b/drivers/watchdog/gpio_wdt.c
@@ -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;