[PATCH 2/2] watchdog: Port RAVE SP watchdog driver from Linux kernel

Sascha Hauer s.hauer at pengutronix.de
Wed May 2 03:24:36 PDT 2018


On Fri, Apr 20, 2018 at 06:33:38PM -0700, Andrey Smirnov wrote:
> +static int rave_sp_wdt_set_timeout(struct watchdog *wdd,
> +				   unsigned int timeout)
> +{
> +	struct rave_sp_wdt *sp_wd = to_rave_sp_wdt(wdd);
> +
> +	if (timeout < sp_wd->variant->min_timeout ||
> +	    timeout > sp_wd->variant->max_timeout)
> +		return -EINVAL;
> +
> +	if (!timeout)
> +		return rave_sp_wdt_stop(wdd);

Since min_timeout is > 0 this is never reached. You should move this up.

Otherwise the patches look fine.

Sascha

-- 
Pengutronix e.K.                           |                             |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |



More information about the barebox mailing list