From patchwork Mon Mar 11 07:38:23 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Silviu-Mihai Popescu X-Patchwork-Id: 2247211 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork1.kernel.org Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) by patchwork1.kernel.org (Postfix) with ESMTP id F1E513FC8F for ; Mon, 11 Mar 2013 07:42:09 +0000 (UTC) Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1UExJf-0008CO-H9; Mon, 11 Mar 2013 07:38:39 +0000 Received: from mail-wi0-x234.google.com ([2a00:1450:400c:c05::234]) by merlin.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1UExJa-0008Bb-Je for linux-arm-kernel@lists.infradead.org; Mon, 11 Mar 2013 07:38:35 +0000 Received: by mail-wi0-f180.google.com with SMTP id hi8so732762wib.7 for ; Mon, 11 Mar 2013 00:38:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=x-received:from:to:cc:subject:date:message-id:x-mailer; bh=PCXvFA3QSDZWHa5dDCuvFtgXiFZHPNrPD7/m+M5K2DQ=; b=V6r1KWX+9b6jfm1wnIXBaV7nujfH4v8C4YEVMccv8JXzxLHTQK6B6ZkxXUC+yEJg7b RqGk9qFgpedvvB9Ye/lkuZ+EFwL3QWNkJz+GKQECEN2lnDEdzyJloZ9RfzRHV9hDfLkX Nr44hFN8D8udI0uDAyUEMfW6M3UstHtXUydYtcU5l5sGpBgjvcykXoc2d9a7qUa/OfMc NVFM1zLYpka3JPHxWkRnAbF6jFuoDkXQ5icidEWOgamaXXNUaXDcu96MvPfC+OZ3Zu5O 9a5u5pM2d7Flht5qrpmpxF0AWURKeKGBrKqaZklr4xbBGmsTobmNdtDjmtub2K/Ippj4 RGnw== X-Received: by 10.194.172.71 with SMTP id ba7mr16884135wjc.26.1362987507189; Mon, 11 Mar 2013 00:38:27 -0700 (PDT) Received: from localhost.localdomain (p5.eregie.pub.ro. [141.85.0.105]) by mx.google.com with ESMTPS id bs6sm15214023wib.4.2013.03.11.00.38.25 (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 11 Mar 2013 00:38:26 -0700 (PDT) From: Silviu-Mihai Popescu To: linux-watchdog@vger.kernel.org Subject: [PATCH] watchdog: convert to devm_ioremap_resource() Date: Mon, 11 Mar 2013 09:38:23 +0200 Message-Id: <1362987503-6449-1-git-send-email-silviupopescu1990@gmail.com> X-Mailer: git-send-email 1.7.9.5 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20130311_033834_826504_15F68C1C X-CRM114-Status: GOOD ( 12.16 ) X-Spam-Score: -1.8 (-) X-Spam-Report: SpamAssassin version 3.3.2 on merlin.infradead.org summary: Content analysis details: (-1.8 points) pts rule name description ---- ---------------------- -------------------------------------------------- 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider (silviupopescu1990[at]gmail.com) -0.0 SPF_PASS SPF: sender matches SPF record 0.2 FREEMAIL_ENVFROM_END_DIGIT Envelope-from freemail username ends in digit (silviupopescu1990[at]gmail.com) -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature Cc: linux-samsung-soc@vger.kernel.org, Silviu-Mihai Popescu , linux-kernel@vger.kernel.org, wim@iguana.be, kgene.kim@samsung.com, ben-linux@fluff.org, linux-arm-kernel@lists.infradead.org X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org Convert all uses of devm_request_and_ioremap() to the newly introduced devm_ioremap_resource() which provides more consistent error handling. devm_ioremap_resource() provides its own error messages so all explicit error messages can be removed from the failure code paths. Signed-off-by: Silviu-Mihai Popescu --- drivers/watchdog/ath79_wdt.c | 8 +++----- drivers/watchdog/davinci_wdt.c | 8 +++----- drivers/watchdog/s3c2410_wdt.c | 9 +++------ 3 files changed, 9 insertions(+), 16 deletions(-) diff --git a/drivers/watchdog/ath79_wdt.c b/drivers/watchdog/ath79_wdt.c index 8987990..d184c48 100644 --- a/drivers/watchdog/ath79_wdt.c +++ b/drivers/watchdog/ath79_wdt.c @@ -253,11 +253,9 @@ static int ath79_wdt_probe(struct platform_device *pdev) return -EINVAL; } - wdt_base = devm_request_and_ioremap(&pdev->dev, res); - if (!wdt_base) { - dev_err(&pdev->dev, "unable to remap memory region\n"); - return -ENOMEM; - } + wdt_base = devm_ioremap_resource(&pdev->dev, res); + if (IS_ERR(wdt_base)) + return PTR_ERR(wdt_base); wdt_clk = devm_clk_get(&pdev->dev, "wdt"); if (IS_ERR(wdt_clk)) diff --git a/drivers/watchdog/davinci_wdt.c b/drivers/watchdog/davinci_wdt.c index 7df1fdc..005fd71 100644 --- a/drivers/watchdog/davinci_wdt.c +++ b/drivers/watchdog/davinci_wdt.c @@ -221,11 +221,9 @@ static int davinci_wdt_probe(struct platform_device *pdev) return -ENOENT; } - wdt_base = devm_request_and_ioremap(dev, wdt_mem); - if (!wdt_base) { - dev_err(dev, "ioremap failed\n"); - return -EADDRNOTAVAIL; - } + wdt_base = devm_ioremap_resource(dev, wdt_mem); + if (IS_ERR(wdt_base)) + return PTR_ERR(wdt_base); ret = misc_register(&davinci_wdt_miscdev); if (ret < 0) { diff --git a/drivers/watchdog/s3c2410_wdt.c b/drivers/watchdog/s3c2410_wdt.c index c1a221c..393496c 100644 --- a/drivers/watchdog/s3c2410_wdt.c +++ b/drivers/watchdog/s3c2410_wdt.c @@ -330,12 +330,9 @@ static int s3c2410wdt_probe(struct platform_device *pdev) } /* get the memory region for the watchdog timer */ - wdt_base = devm_request_and_ioremap(dev, wdt_mem); - if (wdt_base == NULL) { - dev_err(dev, "failed to devm_request_and_ioremap() region\n"); - ret = -ENOMEM; - goto err; - } + wdt_base = devm_ioremap_resource(dev, wdt_mem); + if (IS_ERR(wdt_base)) + return PTR_ERR(wdt_base); DBG("probe: mapped wdt_base=%p\n", wdt_base);