Re: [PATCH v3 2/3] watchdog: add designware driver

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

 



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@xxxxxxxxxxxxxx>
> ---
> +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@xxxxxxxxxxxxxxxxxxx
http://lists.infradead.org/mailman/listinfo/barebox



[Index of Archives]     [Linux Embedded]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux