From: Sascha Hauer <s.hauer@pengutronix.de>
To: Steffen Trumtrar <s.trumtrar@pengutronix.de>
Cc: barebox@lists.infradead.org
Subject: Re: [PATCH v3 2/3] watchdog: add designware driver
Date: Mon, 14 Nov 2016 16:14:32 +0100 [thread overview]
Message-ID: <20161114151432.jtzypouhxyse7ul7@pengutronix.de> (raw)
In-Reply-To: <20161017075052.30802-2-s.trumtrar@pengutronix.de>
On Mon, Oct 17, 2016 at 09:50:51AM +0200, Steffen Trumtrar wrote:
> Port the linux v4.8-rc1 Synopsys DesignWare watchdog driver to barebox.
>
> Signed-off-by: Steffen Trumtrar <s.trumtrar@pengutronix.de>
> ---
> +static void __noreturn dw_wdt_restart_handle(struct restart_handler *rst)
> +{
> + struct dw_wdt *dw_wdt;
> +
> + dw_wdt = container_of(rst, struct dw_wdt, restart);
> +
> + dw_wdt->wdd.set_timeout(&dw_wdt->wdd, -1);
> +
> + mdelay(1000);
> +
> + hang();
> +}
> +
> +static int dw_wdt_drv_probe(struct device_d *dev)
> +{
> + struct watchdog *wdd;
> + struct dw_wdt *dw_wdt;
> + struct resource *mem;
> + int ret;
> +
> + dw_wdt = xzalloc(sizeof(*dw_wdt));
> +
> + mem = dev_request_mem_resource(dev, 0);
> + dw_wdt->regs = IOMEM(mem->start);
> + if (IS_ERR(dw_wdt->regs))
> + return PTR_ERR(dw_wdt->regs);
Just stumbled upon this. The result of dev_request_mem_resource() must
be error checked, not the IOMEM(). If mem is valid then IOMEM() is valid
aswell.
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
next prev parent reply other threads:[~2016-11-14 15:14 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-10-17 7:50 [PATCH v3 1/3] reset: import socfpga-reset driver from linux Steffen Trumtrar
2016-10-17 7:50 ` [PATCH v3 2/3] watchdog: add designware driver Steffen Trumtrar
2016-11-14 15:14 ` Sascha Hauer [this message]
2016-10-17 7:50 ` [PATCH v3 3/3] ARM: socfpga: dtsi: add dw-wdt reset lines Steffen Trumtrar
2016-10-26 20:12 ` Trent Piepho
2016-10-27 6:58 ` Steffen Trumtrar
2016-10-28 7:20 ` Sascha Hauer
2016-10-18 5:39 ` [PATCH v3 1/3] reset: import socfpga-reset driver from linux Sascha Hauer
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=20161114151432.jtzypouhxyse7ul7@pengutronix.de \
--to=s.hauer@pengutronix.de \
--cc=barebox@lists.infradead.org \
--cc=s.trumtrar@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