From patchwork Fri Nov 23 05:59:09 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tushar Behera X-Patchwork-Id: 13118 Return-Path: X-Original-To: patchwork@peony.canonical.com Delivered-To: patchwork@peony.canonical.com Received: from fiordland.canonical.com (fiordland.canonical.com [91.189.94.145]) by peony.canonical.com (Postfix) with ESMTP id 292F724252 for ; Fri, 23 Nov 2012 06:05:46 +0000 (UTC) Received: from mail-ie0-f180.google.com (mail-ie0-f180.google.com [209.85.223.180]) by fiordland.canonical.com (Postfix) with ESMTP id CBC52A18970 for ; Fri, 23 Nov 2012 06:05:45 +0000 (UTC) Received: by mail-ie0-f180.google.com with SMTP id c10so1416885ieb.11 for ; Thu, 22 Nov 2012 22:05:45 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-forwarded-to:x-forwarded-for:delivered-to:received-spf:from:to:cc :subject:date:message-id:x-mailer:in-reply-to:references :x-gm-message-state; bh=B+K31tIjJqjhLLoVaZZTY74VkFXcL82Fg0dXMBVf2pY=; b=avEOtmu+Wo134pXjtA6BXDOR6XLwHYBI9Tfna2PujKXV/tnYKzIOLRwVSX62v1pLU7 t9jzpR6Yv3tNQXr6vDaEz0dusnVAFIzid2cgwyYylncPwYsbY8ADn3a1rfWWHKzaPyKp GroCFUWdtdzjK6VpTLsRhKCmSAi+QHWESP11BEl+U9//ESmGveb+TTRmasr6QFBo1xWl xwAdHz7btel5iOH56drldTZsS5FFWaERlrt/3RAKfcndwjythybwnBCPfebPdH0sLXBn pxZM5/3L92wNvHJcNaDSPSr6+tLe/7s6/xzjvhXNFEdwe/EvPltg9APMr0UFuStr03gO HYvA== Received: by 10.50.173.34 with SMTP id bh2mr2541475igc.70.1353650745529; Thu, 22 Nov 2012 22:05:45 -0800 (PST) X-Forwarded-To: linaro-patchwork@canonical.com X-Forwarded-For: patch@linaro.org linaro-patchwork@canonical.com Delivered-To: patches@linaro.org Received: by 10.50.67.148 with SMTP id n20csp307425igt; Thu, 22 Nov 2012 22:05:45 -0800 (PST) Received: by 10.68.235.208 with SMTP id uo16mr11360719pbc.65.1353650745010; Thu, 22 Nov 2012 22:05:45 -0800 (PST) Received: from mail-pb0-f53.google.com (mail-pb0-f53.google.com [209.85.160.53]) by mx.google.com with ESMTPS id j9si7105060pay.115.2012.11.22.22.05.44 (version=TLSv1/SSLv3 cipher=OTHER); Thu, 22 Nov 2012 22:05:45 -0800 (PST) Received-SPF: neutral (google.com: 209.85.160.53 is neither permitted nor denied by best guess record for domain of tushar.behera@linaro.org) client-ip=209.85.160.53; Authentication-Results: mx.google.com; spf=neutral (google.com: 209.85.160.53 is neither permitted nor denied by best guess record for domain of tushar.behera@linaro.org) smtp.mail=tushar.behera@linaro.org Received: by mail-pb0-f53.google.com with SMTP id jt11so6084660pbb.40 for ; Thu, 22 Nov 2012 22:05:44 -0800 (PST) Received: by 10.68.189.38 with SMTP id gf6mr11306003pbc.145.1353650744784; Thu, 22 Nov 2012 22:05:44 -0800 (PST) Received: from localhost.localdomain ([115.113.119.130]) by mx.google.com with ESMTPS id oi3sm3271920pbb.1.2012.11.22.22.05.40 (version=TLSv1/SSLv3 cipher=OTHER); Thu, 22 Nov 2012 22:05:43 -0800 (PST) From: Tushar Behera To: linux-kernel@vger.kernel.org, linux-i2c@vger.kernel.org, linux-samsung-soc@vger.kernel.org Cc: w.sang@pengutronix.de, kgene.kim@samsung.com, patches@linaro.org Subject: [PATCH 3/7] i2c: s3c2410: Convert to use devm_request_mem_region() Date: Fri, 23 Nov 2012 11:29:09 +0530 Message-Id: <1353650353-17576-4-git-send-email-tushar.behera@linaro.org> X-Mailer: git-send-email 1.7.4.1 In-Reply-To: <1353650353-17576-1-git-send-email-tushar.behera@linaro.org> References: <1353650353-17576-1-git-send-email-tushar.behera@linaro.org> X-Gm-Message-State: ALoCoQnMQMsbeZ9+Mh8fOOIn8iiS6ytnV6/1B2Ek9H/NN89kvIkj8E9HKFyb2DkltNxBtOp+fNZw Signed-off-by: Tushar Behera --- drivers/i2c/busses/i2c-s3c2410.c | 12 +++--------- 1 files changed, 3 insertions(+), 9 deletions(-) diff --git a/drivers/i2c/busses/i2c-s3c2410.c b/drivers/i2c/busses/i2c-s3c2410.c index 019c3d7..a274ef7 100644 --- a/drivers/i2c/busses/i2c-s3c2410.c +++ b/drivers/i2c/busses/i2c-s3c2410.c @@ -987,8 +987,8 @@ static int s3c24xx_i2c_probe(struct platform_device *pdev) goto err_clk; } - i2c->ioarea = request_mem_region(res->start, resource_size(res), - pdev->name); + i2c->ioarea = devm_request_mem_region(&pdev->dev, res->start, + resource_size(res), pdev->name); if (i2c->ioarea == NULL) { dev_err(&pdev->dev, "cannot request IO\n"); @@ -1001,7 +1001,7 @@ static int s3c24xx_i2c_probe(struct platform_device *pdev) if (i2c->regs == NULL) { dev_err(&pdev->dev, "cannot map IO\n"); ret = -ENXIO; - goto err_ioarea; + goto err_clk; } dev_dbg(&pdev->dev, "registers %p (%p, %p)\n", @@ -1076,10 +1076,6 @@ static int s3c24xx_i2c_probe(struct platform_device *pdev) err_iomap: iounmap(i2c->regs); - err_ioarea: - release_resource(i2c->ioarea); - kfree(i2c->ioarea); - err_clk: clk_disable_unprepare(i2c->clk); return ret; @@ -1106,9 +1102,7 @@ static int s3c24xx_i2c_remove(struct platform_device *pdev) iounmap(i2c->regs); - release_resource(i2c->ioarea); s3c24xx_i2c_dt_gpio_free(i2c); - kfree(i2c->ioarea); return 0; }