Re: [PATCH] watchdog: gpio_wdt: Fix missing platform_set_drvdata() in gpio_wdt_probe()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue, Jul 26, 2016 at 02:50:14PM +0000, Wei Yongjun wrote:
> 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@xxxxxxxxx>

Reviewed-by: Guenter Roeck <linux@xxxxxxxxxxxx>

> ---
>  drivers/watchdog/gpio_wdt.c | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/drivers/watchdog/gpio_wdt.c b/drivers/watchdog/gpio_wdt.c
> index ba066e4..93457ca 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;
> 
--
To unsubscribe from this list: send the line "unsubscribe linux-watchdog" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Security]     [Bugtraq]     [Linux]     [Linux OMAP]     [Linux MIPS]     [eCos]     [Asterisk Internet PBX]     [Linux API]

  Powered by Linux