[PATCH 1/2] wdog: imx-wd: Introduce ops struct for imx21/imx1

Sascha Hauer s.hauer at pengutronix.de
Fri Apr 3 06:51:14 PDT 2015


On Thu, Apr 02, 2015 at 05:36:50PM +0200, Markus Pargmann wrote:
> Replace the set_timeout function in the device platform data by an ops
> struct which stores a set_timeout and init function.
> 
> Signed-off-by: Markus Pargmann <mpa at pengutronix.de>
>  	}
>  
> -	if (fn != imx1_watchdog_set_timeout)
> -		imx_watchdog_detect_reset_source(priv);
> +	if (priv->ops->init) {
> +		ret = priv->ops->init(priv);
> +		if (ret) {
> +			dev_err(dev, "Failed to init watchdog device %d\n", ret);
> +			goto error_unregister;
> +		}
> +	}
>  
>  	dev->priv = priv;
>  
>  	return 0;
>  
> +error_unregister:
> +	watchdog_deregister(&priv->wd);

I had to revert this one because compilation fails with:

imx-iomux-v1.c:(.text.imx_wd_probe+0xb0): undefined reference to `watchdog_deregister'

This happens when watchdog support is disabled. imxwd.c is compiled
anyway because it provides the reset function. Either you have to
provide static inline wrappers or reorder the code so that
watchdog_register is called last and thus you don't have to call
watchdog_deregister().

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