Re: [PATCH 1/3] watchdog: ep93xx_wdt: Use devm_ioremap_resource()

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

 



Hi Jingoo,

> Use devm_ioremap_resource() in order to make the code simpler,
> and remove redundant return value check of platform_get_resource()
> because the value is checked by devm_ioremap_resource().
> 
> Signed-off-by: Jingoo Han <jg1.han@xxxxxxxxxxx>
> ---
>  drivers/watchdog/ep93xx_wdt.c |   13 +++----------
>  1 file changed, 3 insertions(+), 10 deletions(-)
> 
> diff --git a/drivers/watchdog/ep93xx_wdt.c b/drivers/watchdog/ep93xx_wdt.c
> index d1d07f2..5e4f3de 100644
> --- a/drivers/watchdog/ep93xx_wdt.c
> +++ b/drivers/watchdog/ep93xx_wdt.c
> @@ -118,16 +118,9 @@ static int ep93xx_wdt_probe(struct platform_device *pdev)
>  	int err;
>  
>  	res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
> -	if (!res)
> -		return -ENXIO;
> -
> -	if (!devm_request_mem_region(&pdev->dev, res->start,
> -				     resource_size(res), pdev->name))
> -		return -EBUSY;
> -
> -	mmio_base = devm_ioremap(&pdev->dev, res->start, resource_size(res));
> -	if (!mmio_base)
> -		return -ENXIO;
> +	mmio_base = devm_ioremap_resource(&pdev->dev, res);
> +	if (IS_ERR(mmio_base))
> +		return PTR_ERR(mmio_base);
>  
>  	if (timeout < 1 || timeout > 3600) {
>  		timeout = WDT_TIMEOUT;
> -- 
> 1.7.10.4
> 
> 

This patch has been added to linux-watchdog-next.

Kind regards,
Wim.

--
To unsubscribe from this list: send the line "unsubscribe linux-watchdog" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Security]     [Bugtraq]     [Linux]     [Linux OMAP]     [Linux MIPS]     [eCos]     [Asterisk Internet PBX]     [Linux API]

  Powered by Linux