mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Sascha Hauer <s.hauer@pengutronix.de>
To: Markus Pargmann <mpa@pengutronix.de>
Cc: barebox@lists.infradead.org
Subject: Re: [PATCH 1/2] wdog: imx-wd: Introduce ops struct for imx21/imx1
Date: Fri, 3 Apr 2015 15:51:14 +0200	[thread overview]
Message-ID: <20150403135114.GG4946@pengutronix.de> (raw)
In-Reply-To: <1427989011-26503-1-git-send-email-mpa@pengutronix.de>

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@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 |

_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

      parent reply	other threads:[~2015-04-03 13:51 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-04-02 15:36 Markus Pargmann
2015-04-02 15:36 ` [PATCH 2/2] wdog: imx-wd: Disable watchdog powerdown counter Markus Pargmann
2015-04-03  6:16 ` [PATCH 1/2] wdog: imx-wd: Introduce ops struct for imx21/imx1 Sascha Hauer
2015-04-03 13:51 ` Sascha Hauer [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20150403135114.GG4946@pengutronix.de \
    --to=s.hauer@pengutronix.de \
    --cc=barebox@lists.infradead.org \
    --cc=mpa@pengutronix.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox