Return-path: Received: from mailout3.samsung.com ([203.254.224.33]:55655 "EHLO mailout3.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751116Ab3CRHfg (ORCPT ); Mon, 18 Mar 2013 03:35:36 -0400 Received: from epcpsbgr4.samsung.com (u144.gpu120.samsung.co.kr [203.254.230.144]) by mailout3.samsung.com (Oracle Communications Messaging Server 7u4-24.01 (7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTP id <0MJU0018XIEZ56T0@mailout3.samsung.com> for linux-watchdog@vger.kernel.org; Mon, 18 Mar 2013 16:35:34 +0900 (KST) Received: from DOJG1HAN02 ([12.23.120.99]) by mmp1.samsung.com (Oracle Communications Messaging Server 7u4-24.01 (7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTPA id <0MJU00EEUIF9JA00@mmp1.samsung.com> for linux-watchdog@vger.kernel.org; Mon, 18 Mar 2013 16:35:34 +0900 (KST) From: Jingoo Han To: 'Wim Van Sebroeck' Cc: linux-watchdog@vger.kernel.org, 'Jingoo Han' References: <01ad01ce23aa$e49c8b00$add5a100$%han@samsung.com> In-reply-to: <01ad01ce23aa$e49c8b00$add5a100$%han@samsung.com> Subject: [PATCH 2/7] watchdog: bcm63xx_wdt: use devm_ioremap_nocache() Date: Mon, 18 Mar 2013 16:35:33 +0900 Message-id: <01ae01ce23ab$2cce4b20$866ae160$%han@samsung.com> MIME-version: 1.0 Content-type: text/plain; charset=us-ascii Content-transfer-encoding: 7bit Content-language: ko Sender: linux-watchdog-owner@vger.kernel.org List-Id: linux-watchdog@vger.kernel.org Use devm_ioremap_nocache() to make cleanup paths simpler. Signed-off-by: Jingoo Han --- drivers/watchdog/bcm63xx_wdt.c | 9 ++++----- 1 files changed, 4 insertions(+), 5 deletions(-) diff --git a/drivers/watchdog/bcm63xx_wdt.c b/drivers/watchdog/bcm63xx_wdt.c index b2b80d4..a14a58d 100644 --- a/drivers/watchdog/bcm63xx_wdt.c +++ b/drivers/watchdog/bcm63xx_wdt.c @@ -16,6 +16,7 @@ #include #include #include +#include #include #include #include @@ -249,7 +250,8 @@ static int bcm63xx_wdt_probe(struct platform_device *pdev) return -ENODEV; } - bcm63xx_wdt_device.regs = ioremap_nocache(r->start, resource_size(r)); + bcm63xx_wdt_device.regs = devm_ioremap_nocache(&pdev->dev, r->start, + resource_size(r)); if (!bcm63xx_wdt_device.regs) { dev_err(&pdev->dev, "failed to remap I/O resources\n"); return -ENXIO; @@ -258,7 +260,7 @@ static int bcm63xx_wdt_probe(struct platform_device *pdev) ret = bcm63xx_timer_register(TIMER_WDT_ID, bcm63xx_wdt_isr, NULL); if (ret < 0) { dev_err(&pdev->dev, "failed to register wdt timer isr\n"); - goto unmap; + return ret; } if (bcm63xx_wdt_settimeout(wdt_time)) { @@ -281,8 +283,6 @@ static int bcm63xx_wdt_probe(struct platform_device *pdev) unregister_timer: bcm63xx_timer_unregister(TIMER_WDT_ID); -unmap: - iounmap(bcm63xx_wdt_device.regs); return ret; } @@ -293,7 +293,6 @@ static int bcm63xx_wdt_remove(struct platform_device *pdev) misc_deregister(&bcm63xx_wdt_miscdev); bcm63xx_timer_unregister(TIMER_WDT_ID); - iounmap(bcm63xx_wdt_device.regs); return 0; } -- 1.7.2.5