Skip to content

Commit

Permalink
watchdog: gpio_wdt: Fix missing platform_set_drvdata() in gpio_wdt_pr…
Browse files Browse the repository at this point in the history
…obe()

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>
  • Loading branch information
Wei Yongjun authored and Wim Van Sebroeck committed Jul 27, 2016
1 parent 3c10bbd commit 1ac0656
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions drivers/watchdog/gpio_wdt.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 1ac0656

Please sign in to comment.