Re: [PATCH 3/3] watchdog: sp805_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.
> 
> Signed-off-by: Jingoo Han <jg1.han@xxxxxxxxxxx>
> ---
>  drivers/watchdog/sp805_wdt.c |   17 +++--------------
>  1 file changed, 3 insertions(+), 14 deletions(-)
> 
> diff --git a/drivers/watchdog/sp805_wdt.c b/drivers/watchdog/sp805_wdt.c
> index 3f786ce..cf35036 100644
> --- a/drivers/watchdog/sp805_wdt.c
> +++ b/drivers/watchdog/sp805_wdt.c
> @@ -209,13 +209,6 @@ sp805_wdt_probe(struct amba_device *adev, const struct amba_id *id)
>  	struct sp805_wdt *wdt;
>  	int ret = 0;
>  
> -	if (!devm_request_mem_region(&adev->dev, adev->res.start,
> -				resource_size(&adev->res), "sp805_wdt")) {
> -		dev_warn(&adev->dev, "Failed to get memory region resource\n");
> -		ret = -ENOENT;
> -		goto err;
> -	}
> -
>  	wdt = devm_kzalloc(&adev->dev, sizeof(*wdt), GFP_KERNEL);
>  	if (!wdt) {
>  		dev_warn(&adev->dev, "Kzalloc failed\n");
> @@ -223,13 +216,9 @@ sp805_wdt_probe(struct amba_device *adev, const struct amba_id *id)
>  		goto err;
>  	}
>  
> -	wdt->base = devm_ioremap(&adev->dev, adev->res.start,
> -			resource_size(&adev->res));
> -	if (!wdt->base) {
> -		ret = -ENOMEM;
> -		dev_warn(&adev->dev, "ioremap fail\n");
> -		goto err;
> -	}
> +	wdt->base = devm_ioremap_resource(&adev->dev, &adev->res);
> +	if (IS_ERR(wdt->base))
> +		return PTR_ERR(wdt->base);
>  
>  	wdt->clk = devm_clk_get(&adev->dev, NULL);
>  	if (IS_ERR(wdt->clk)) {
> -- 
> 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