linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 02/33] ARM: Convert to devm_ioremap_resource()
       [not found] <1358762966-20791-1-git-send-email-thierry.reding@avionic-design.de>
@ 2013-01-21 10:08 ` Thierry Reding
  2013-01-21 15:58   ` Russell King - ARM Linux
  0 siblings, 1 reply; 6+ messages in thread
From: Thierry Reding @ 2013-01-21 10:08 UTC (permalink / raw)
  To: linux-arm-kernel

Convert all uses of devm_request_and_ioremap() to the newly introduced
devm_ioremap_resource() which provides more consistent error handling.

Signed-off-by: Thierry Reding <thierry.reding@avionic-design.de>
Cc: Russell King <linux@arm.linux.org.uk>
Cc: linux-arm-kernel at lists.infradead.org
---
 arch/arm/mach-omap2/gpmc.c       | 8 +++-----
 arch/arm/mach-tegra/tegra2_emc.c | 8 +++-----
 arch/arm/plat-omap/dmtimer.c     | 8 +++-----
 arch/arm/plat-samsung/adc.c      | 8 +++-----
 4 files changed, 12 insertions(+), 20 deletions(-)

diff --git a/arch/arm/mach-omap2/gpmc.c b/arch/arm/mach-omap2/gpmc.c
index 8033cb7..64bac53 100644
--- a/arch/arm/mach-omap2/gpmc.c
+++ b/arch/arm/mach-omap2/gpmc.c
@@ -1134,11 +1134,9 @@ static int gpmc_probe(struct platform_device *pdev)
 	phys_base = res->start;
 	mem_size = resource_size(res);
 
-	gpmc_base = devm_request_and_ioremap(&pdev->dev, res);
-	if (!gpmc_base) {
-		dev_err(&pdev->dev, "error: request memory / ioremap\n");
-		return -EADDRNOTAVAIL;
-	}
+	gpmc_base = devm_ioremap_resource(&pdev->dev, res);
+	if (IS_ERR(gpmc_base))
+		return PTR_ERR(gpmc_base);
 
 	res = platform_get_resource(pdev, IORESOURCE_IRQ, 0);
 	if (res == NULL)
diff --git a/arch/arm/mach-tegra/tegra2_emc.c b/arch/arm/mach-tegra/tegra2_emc.c
index e18aa2f..ce7ce42 100644
--- a/arch/arm/mach-tegra/tegra2_emc.c
+++ b/arch/arm/mach-tegra/tegra2_emc.c
@@ -312,11 +312,9 @@ static int tegra_emc_probe(struct platform_device *pdev)
 		return -ENOMEM;
 	}
 
-	emc_regbase = devm_request_and_ioremap(&pdev->dev, res);
-	if (!emc_regbase) {
-		dev_err(&pdev->dev, "failed to remap registers\n");
-		return -ENOMEM;
-	}
+	emc_regbase = devm_ioremap_resource(&pdev->dev, res);
+	if (IS_ERR(emc_regbase))
+		return PTR_ERR(emc_regbase);
 
 	pdata = pdev->dev.platform_data;
 
diff --git a/arch/arm/plat-omap/dmtimer.c b/arch/arm/plat-omap/dmtimer.c
index 7b433f3..a0daa2f 100644
--- a/arch/arm/plat-omap/dmtimer.c
+++ b/arch/arm/plat-omap/dmtimer.c
@@ -808,11 +808,9 @@ static int omap_dm_timer_probe(struct platform_device *pdev)
 		return  -ENOMEM;
 	}
 
-	timer->io_base = devm_request_and_ioremap(dev, mem);
-	if (!timer->io_base) {
-		dev_err(dev, "%s: region already claimed.\n", __func__);
-		return -ENOMEM;
-	}
+	timer->io_base = devm_ioremap_resource(dev, mem);
+	if (IS_ERR(timer->io_base))
+		return PTR_ERR(timer->io_base);
 
 	if (dev->of_node) {
 		if (of_find_property(dev->of_node, "ti,timer-alwon", NULL))
diff --git a/arch/arm/plat-samsung/adc.c b/arch/arm/plat-samsung/adc.c
index 2d676ab..ca07cb1 100644
--- a/arch/arm/plat-samsung/adc.c
+++ b/arch/arm/plat-samsung/adc.c
@@ -386,11 +386,9 @@ static int s3c_adc_probe(struct platform_device *pdev)
 		return -ENXIO;
 	}
 
-	adc->regs = devm_request_and_ioremap(dev, regs);
-	if (!adc->regs) {
-		dev_err(dev, "failed to map registers\n");
-		return -ENXIO;
-	}
+	adc->regs = devm_ioremap_resource(dev, regs);
+	if (IS_ERR(adc->regs))
+		return PTR_ERR(adc->regs);
 
 	ret = regulator_enable(adc->vdd);
 	if (ret)
-- 
1.8.1.1

^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [PATCH 02/33] ARM: Convert to devm_ioremap_resource()
  2013-01-21 10:08 ` [PATCH 02/33] ARM: Convert to devm_ioremap_resource() Thierry Reding
@ 2013-01-21 15:58   ` Russell King - ARM Linux
  2013-01-21 16:05     ` Thierry Reding
  0 siblings, 1 reply; 6+ messages in thread
From: Russell King - ARM Linux @ 2013-01-21 15:58 UTC (permalink / raw)
  To: linux-arm-kernel

On Mon, Jan 21, 2013 at 11:08:55AM +0100, Thierry Reding wrote:
> Convert all uses of devm_request_and_ioremap() to the newly introduced
> devm_ioremap_resource() which provides more consistent error handling.

Does this include the resource part of the handling too?

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [PATCH 02/33] ARM: Convert to devm_ioremap_resource()
  2013-01-21 15:58   ` Russell King - ARM Linux
@ 2013-01-21 16:05     ` Thierry Reding
  2013-01-21 16:16       ` Russell King - ARM Linux
  0 siblings, 1 reply; 6+ messages in thread
From: Thierry Reding @ 2013-01-21 16:05 UTC (permalink / raw)
  To: linux-arm-kernel

On Mon, Jan 21, 2013 at 03:58:46PM +0000, Russell King - ARM Linux wrote:
> On Mon, Jan 21, 2013 at 11:08:55AM +0100, Thierry Reding wrote:
> > Convert all uses of devm_request_and_ioremap() to the newly introduced
> > devm_ioremap_resource() which provides more consistent error handling.
> 
> Does this include the resource part of the handling too?

I'm not sure I understand your question. devm_ioremap_resource() does a
devm_request_mem_region() internally if that's what you were asking.

Thierry
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 836 bytes
Desc: not available
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20130121/b1ffe047/attachment.sig>

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [PATCH 02/33] ARM: Convert to devm_ioremap_resource()
  2013-01-21 16:05     ` Thierry Reding
@ 2013-01-21 16:16       ` Russell King - ARM Linux
  2013-01-21 17:23         ` Arnd Bergmann
  2013-01-22 17:37         ` Greg Kroah-Hartman
  0 siblings, 2 replies; 6+ messages in thread
From: Russell King - ARM Linux @ 2013-01-21 16:16 UTC (permalink / raw)
  To: linux-arm-kernel

On Mon, Jan 21, 2013 at 05:05:47PM +0100, Thierry Reding wrote:
> On Mon, Jan 21, 2013 at 03:58:46PM +0000, Russell King - ARM Linux wrote:
> > On Mon, Jan 21, 2013 at 11:08:55AM +0100, Thierry Reding wrote:
> > > Convert all uses of devm_request_and_ioremap() to the newly introduced
> > > devm_ioremap_resource() which provides more consistent error handling.
> > 
> > Does this include the resource part of the handling too?
> 
> I'm not sure I understand your question. devm_ioremap_resource() does a
> devm_request_mem_region() internally if that's what you were asking.

Ah, that's fine then.  The function name is a little misleading, and as
it doesn't exist in mainline at present, it is not something I know about.

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [PATCH 02/33] ARM: Convert to devm_ioremap_resource()
  2013-01-21 16:16       ` Russell King - ARM Linux
@ 2013-01-21 17:23         ` Arnd Bergmann
  2013-01-22 17:37         ` Greg Kroah-Hartman
  1 sibling, 0 replies; 6+ messages in thread
From: Arnd Bergmann @ 2013-01-21 17:23 UTC (permalink / raw)
  To: linux-arm-kernel

On Monday 21 January 2013, Russell King - ARM Linux wrote:
> On Mon, Jan 21, 2013 at 05:05:47PM +0100, Thierry Reding wrote:
> > On Mon, Jan 21, 2013 at 03:58:46PM +0000, Russell King - ARM Linux wrote:
> > > On Mon, Jan 21, 2013 at 11:08:55AM +0100, Thierry Reding wrote:
> > > > Convert all uses of devm_request_and_ioremap() to the newly introduced
> > > > devm_ioremap_resource() which provides more consistent error handling.
> > > 
> > > Does this include the resource part of the handling too?
> > 
> > I'm not sure I understand your question. devm_ioremap_resource() does a
> > devm_request_mem_region() internally if that's what you were asking.
> 
> Ah, that's fine then.  The function name is a little misleading, and as
> it doesn't exist in mainline at present, it is not something I know about.

The usual problem with long patch series like this: The introductory mail
PATCH 0/xx explains this nicely, but it's not possible to put everyone
on Cc because then it gets rejected by vger for overly long mail headers.

We had a discussion about the function name earlier, but could not come
up with one that isn't too bulky but still carries the same meaning
as devm_request_and_ioremap() with a different symbol.

	Arnd

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [PATCH 02/33] ARM: Convert to devm_ioremap_resource()
  2013-01-21 16:16       ` Russell King - ARM Linux
  2013-01-21 17:23         ` Arnd Bergmann
@ 2013-01-22 17:37         ` Greg Kroah-Hartman
  1 sibling, 0 replies; 6+ messages in thread
From: Greg Kroah-Hartman @ 2013-01-22 17:37 UTC (permalink / raw)
  To: linux-arm-kernel

On Mon, Jan 21, 2013 at 04:16:11PM +0000, Russell King - ARM Linux wrote:
> On Mon, Jan 21, 2013 at 05:05:47PM +0100, Thierry Reding wrote:
> > On Mon, Jan 21, 2013 at 03:58:46PM +0000, Russell King - ARM Linux wrote:
> > > On Mon, Jan 21, 2013 at 11:08:55AM +0100, Thierry Reding wrote:
> > > > Convert all uses of devm_request_and_ioremap() to the newly introduced
> > > > devm_ioremap_resource() which provides more consistent error handling.
> > > 
> > > Does this include the resource part of the handling too?
> > 
> > I'm not sure I understand your question. devm_ioremap_resource() does a
> > devm_request_mem_region() internally if that's what you were asking.
> 
> Ah, that's fine then.  The function name is a little misleading, and as
> it doesn't exist in mainline at present, it is not something I know about.

Can I assume this is an Acked-by: from you for this patch so that I can
take this through my driver-core tree?

thanks,

greg k-h

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2013-01-22 17:37 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <1358762966-20791-1-git-send-email-thierry.reding@avionic-design.de>
2013-01-21 10:08 ` [PATCH 02/33] ARM: Convert to devm_ioremap_resource() Thierry Reding
2013-01-21 15:58   ` Russell King - ARM Linux
2013-01-21 16:05     ` Thierry Reding
2013-01-21 16:16       ` Russell King - ARM Linux
2013-01-21 17:23         ` Arnd Bergmann
2013-01-22 17:37         ` Greg Kroah-Hartman

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).