Re: [PATCH] watchdog: rt2880_wdt: minor clean up

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

 



On Thu, Oct 16, 2014 at 10:01:05PM +0200, John Crispin wrote:
> Replace device_reset() with devm_reset_control_get() + reset_control_deassert().
> Make use of watchdog_init_timeout() instead of setting the timeout manually.
> 
> Signed-off-by: John Crispin <blogic@xxxxxxxxxxx>

Reviewed-by: Guenter Roeck <linux@xxxxxxxxxxxx>

> ---
>  drivers/watchdog/rt2880_wdt.c |    9 ++++++---
>  1 file changed, 6 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/watchdog/rt2880_wdt.c b/drivers/watchdog/rt2880_wdt.c
> index d92c2d5..d2cd2bd 100644
> --- a/drivers/watchdog/rt2880_wdt.c
> +++ b/drivers/watchdog/rt2880_wdt.c
> @@ -45,6 +45,7 @@
>  static struct clk *rt288x_wdt_clk;
>  static unsigned long rt288x_wdt_freq;
>  static void __iomem *rt288x_wdt_base;
> +static struct reset_control *rt288x_wdt_reset;
>  
>  static bool nowayout = WATCHDOG_NOWAYOUT;
>  module_param(nowayout, bool, 0);
> @@ -151,16 +152,18 @@ static int rt288x_wdt_probe(struct platform_device *pdev)
>  	if (IS_ERR(rt288x_wdt_clk))
>  		return PTR_ERR(rt288x_wdt_clk);
>  
> -	device_reset(&pdev->dev);
> +	rt288x_wdt_reset = devm_reset_control_get(&pdev->dev, NULL);
> +	if (!IS_ERR(rt288x_wdt_reset))
> +		reset_control_deassert(rt288x_wdt_reset);
>  
>  	rt288x_wdt_freq = clk_get_rate(rt288x_wdt_clk) / RALINK_WDT_PRESCALE;
>  
>  	rt288x_wdt_dev.dev = &pdev->dev;
>  	rt288x_wdt_dev.bootstatus = rt288x_wdt_bootcause();
> -
>  	rt288x_wdt_dev.max_timeout = (0xfffful / rt288x_wdt_freq);
> -	rt288x_wdt_dev.timeout = rt288x_wdt_dev.max_timeout;
>  
> +	watchdog_init_timeout(&rt288x_wdt_dev, rt288x_wdt_dev.max_timeout,
> +			      &pdev->dev);
>  	watchdog_set_nowayout(&rt288x_wdt_dev, nowayout);
>  
>  	ret = watchdog_register_device(&rt288x_wdt_dev);
> -- 
> 1.7.10.4
> 
> --
> 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 MIPS Home]     [LKML Archive]     [Linux ARM Kernel]     [Linux ARM]     [Linux]     [Git]     [Yosemite News]     [Linux SCSI]     [Linux Hams]

  Powered by Linux