From: Tushar Behera <tushar.behera-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>
To: linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
linux-i2c-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
linux-samsung-soc-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
Cc: w.sang-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org,
kgene.kim-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org,
patches-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org
Subject: [PATCH 3/7] i2c: s3c2410: Convert to use devm_request_mem_region()
Date: Fri, 23 Nov 2012 11:29:09 +0530 [thread overview]
Message-ID: <1353650353-17576-4-git-send-email-tushar.behera@linaro.org> (raw)
In-Reply-To: <1353650353-17576-1-git-send-email-tushar.behera-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>
Signed-off-by: Tushar Behera <tushar.behera-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>
---
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;
}
--
1.7.4.1
next prev parent reply other threads:[~2012-11-23 5:59 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-11-23 5:59 [PATCH 0/7] i2c: s3c2410: Add devm_* apis and cleanup Tushar Behera
2012-11-23 5:59 ` [PATCH 1/7] i2c: s3c2410: Remove unnecessary label err_noclk Tushar Behera
2012-11-23 5:59 ` [PATCH 2/7] i2c: s3c2410: Convert to use devm_clk_get() Tushar Behera
2012-11-23 5:59 ` [PATCH 4/7] i2c: s3c2410: Convert to use devm_ioremap() Tushar Behera
[not found] ` <1353650353-17576-5-git-send-email-tushar.behera-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>
2012-11-23 6:14 ` Sachin Kamat
2012-11-23 6:43 ` Tushar Behera
2012-11-23 5:59 ` [PATCH 5/7] i2c: s3c2410: Convert to use devm_request_irq() Tushar Behera
2012-11-23 5:59 ` [PATCH 6/7] i2c: s3c2410: Move location of clk_prepare_enable() call in probe function Tushar Behera
[not found] ` <1353650353-17576-1-git-send-email-tushar.behera-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>
2012-11-23 5:59 ` Tushar Behera [this message]
2012-11-23 5:59 ` [PATCH 7/7] i2c: s3c2410: Remove err_cpufreq label Tushar Behera
2012-11-23 6:15 ` [PATCH 0/7] i2c: s3c2410: Add devm_* apis and cleanup Shubhrajyoti Datta
[not found] ` <CAM=Q2cs=oYq4e17LXxUEhATiYLAjnzoTH-+nsO5KNQwGj2qSBA-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2012-11-23 6:44 ` Tushar Behera
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1353650353-17576-4-git-send-email-tushar.behera@linaro.org \
--to=tushar.behera-qsej5fyqhm4dnm+yrofe0a@public.gmane.org \
--cc=kgene.kim-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org \
--cc=linux-i2c-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=linux-samsung-soc-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=patches-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org \
--cc=w.sang-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).