[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <51138E41.3080708@mvista.com>
Date: Thu, 07 Feb 2013 15:21:37 +0400
From: Sergei Shtylyov <sshtylyov@...sta.com>
To: "Kumar, Anil" <anilkumar.v@...com>
CC: linux-watchdog@...r.kernel.org, linux-kernel@...r.kernel.org,
davinci-linux-open-source@...ux.davincidsp.com, wim@...ana.be
Subject: Re: [PATCH] watchdog: davinci_wdt: update to devm_* API
Hello.
On 07-02-2013 7:32, Kumar, Anil wrote:
> Update the code to use devm_* API so that driver
> core will manage resources.
> Signed-off-by: Kumar, Anil <anilkumar.v@...com>
> ---
> This patch applies on top of v3.8-rc6.
> Tested on da850 EVM.
> :100644 100644 e8e8724... 6ad76a3... M drivers/watchdog/davinci_wdt.c
> drivers/watchdog/davinci_wdt.c | 34 +++++++++-------------------------
> 1 files changed, 9 insertions(+), 25 deletions(-)
> diff --git a/drivers/watchdog/davinci_wdt.c b/drivers/watchdog/davinci_wdt.c
> index e8e8724..6ad76a3 100644
> --- a/drivers/watchdog/davinci_wdt.c
> +++ b/drivers/watchdog/davinci_wdt.c
[...]
> @@ -213,49 +212,34 @@ static int davinci_wdt_probe(struct platform_device *pdev)
[...]
> - size = resource_size(wdt_mem);
> - if (!request_mem_region(wdt_mem->start, size, pdev->name)) {
> - dev_err(dev, "failed to get memory region\n");
> - return -ENOENT;
> - }
> -
> - wdt_base = ioremap(wdt_mem->start, size);
> + wdt_base = devm_request_and_ioremap(&pdev->dev, wdt_mem);
> if (!wdt_base) {
> - dev_err(dev, "failed to map memory region\n");
> - release_mem_region(wdt_mem->start, size);
> - wdt_mem = NULL;
> + dev_err(&pdev->dev, "ioremap failed\n");
> return -ENOMEM;
Comment to devm_request_and_ioremap() suggest returning -EADDRNOTAVAIL
instead.
WBR, Sergei
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists