linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/2] mfd: omap-usb-host: Convert to devm_ioremap_resource()
@ 2013-04-04  9:45 Sachin Kamat
  2013-04-04  9:45 ` [PATCH 2/2] mfd: omap-usb-tll: " Sachin Kamat
                   ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: Sachin Kamat @ 2013-04-04  9:45 UTC (permalink / raw)
  To: linux-kernel; +Cc: sameo, sachin.kamat, Roger Quadros

Use the newly introduced devm_ioremap_resource() instead of
devm_request_and_ioremap() 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: Sachin Kamat <sachin.kamat@linaro.org>
Cc: Roger Quadros <rogerq@ti.com>
---
 drivers/mfd/omap-usb-host.c |    9 ++++-----
 1 file changed, 4 insertions(+), 5 deletions(-)

diff --git a/drivers/mfd/omap-usb-host.c b/drivers/mfd/omap-usb-host.c
index 4febc5c..1b49b21 100644
--- a/drivers/mfd/omap-usb-host.c
+++ b/drivers/mfd/omap-usb-host.c
@@ -27,6 +27,7 @@
 #include <linux/platform_device.h>
 #include <linux/platform_data/usb-omap.h>
 #include <linux/pm_runtime.h>
+#include <linux/err.h>
 
 #include "omap-usb.h"
 
@@ -534,11 +535,9 @@ static int usbhs_omap_probe(struct platform_device *pdev)
 	}
 
 	res = platform_get_resource_byname(pdev, IORESOURCE_MEM, "uhh");
-	omap->uhh_base = devm_request_and_ioremap(dev, res);
-	if (!omap->uhh_base) {
-		dev_err(dev, "Resource request/ioremap failed\n");
-		return -EADDRNOTAVAIL;
-	}
+	omap->uhh_base = devm_ioremap_resource(dev, res);
+	if (IS_ERR(omap->uhh_base))
+		return PTR_ERR(omap->uhh_base);
 
 	omap->pdata = pdata;
 
-- 
1.7.9.5


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

* [PATCH 2/2] mfd: omap-usb-tll: Convert to devm_ioremap_resource()
  2013-04-04  9:45 [PATCH 1/2] mfd: omap-usb-host: Convert to devm_ioremap_resource() Sachin Kamat
@ 2013-04-04  9:45 ` Sachin Kamat
  2013-04-04 10:06   ` Roger Quadros
  2013-04-04 10:05 ` [PATCH 1/2] mfd: omap-usb-host: " Roger Quadros
  2013-04-09 10:13 ` Samuel Ortiz
  2 siblings, 1 reply; 6+ messages in thread
From: Sachin Kamat @ 2013-04-04  9:45 UTC (permalink / raw)
  To: linux-kernel; +Cc: sameo, sachin.kamat, Roger Quadros

Use the newly introduced devm_ioremap_resource() instead of
devm_request_and_ioremap() 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: Sachin Kamat <sachin.kamat@linaro.org>
Cc: Roger Quadros <rogerq@ti.com>
---
 drivers/mfd/omap-usb-tll.c |    9 +++------
 1 file changed, 3 insertions(+), 6 deletions(-)

diff --git a/drivers/mfd/omap-usb-tll.c b/drivers/mfd/omap-usb-tll.c
index 0aef1a7..f3b0365 100644
--- a/drivers/mfd/omap-usb-tll.c
+++ b/drivers/mfd/omap-usb-tll.c
@@ -235,12 +235,9 @@ static int usbtll_omap_probe(struct platform_device *pdev)
 	tll->pdata = pdata;
 
 	res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
-	base = devm_request_and_ioremap(dev, res);
-	if (!base) {
-		ret = -EADDRNOTAVAIL;
-		dev_err(dev, "Resource request/ioremap failed:%d\n", ret);
-		return ret;
-	}
+	base = devm_ioremap_resource(dev, res);
+	if (IS_ERR(base))
+		return PTR_ERR(base);
 
 	platform_set_drvdata(pdev, tll);
 	pm_runtime_enable(dev);
-- 
1.7.9.5


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

* Re: [PATCH 1/2] mfd: omap-usb-host: Convert to devm_ioremap_resource()
  2013-04-04  9:45 [PATCH 1/2] mfd: omap-usb-host: Convert to devm_ioremap_resource() Sachin Kamat
  2013-04-04  9:45 ` [PATCH 2/2] mfd: omap-usb-tll: " Sachin Kamat
@ 2013-04-04 10:05 ` Roger Quadros
  2013-04-09 10:13 ` Samuel Ortiz
  2 siblings, 0 replies; 6+ messages in thread
From: Roger Quadros @ 2013-04-04 10:05 UTC (permalink / raw)
  To: Sachin Kamat; +Cc: linux-kernel, sameo

On 04/04/2013 12:45 PM, Sachin Kamat wrote:
> Use the newly introduced devm_ioremap_resource() instead of
> devm_request_and_ioremap() 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: Sachin Kamat <sachin.kamat@linaro.org>
> Cc: Roger Quadros <rogerq@ti.com>

Acked-by: Roger Quadros <rogerq@ti.com>

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

* Re: [PATCH 2/2] mfd: omap-usb-tll: Convert to devm_ioremap_resource()
  2013-04-04  9:45 ` [PATCH 2/2] mfd: omap-usb-tll: " Sachin Kamat
@ 2013-04-04 10:06   ` Roger Quadros
  0 siblings, 0 replies; 6+ messages in thread
From: Roger Quadros @ 2013-04-04 10:06 UTC (permalink / raw)
  To: Sachin Kamat; +Cc: linux-kernel, sameo

On 04/04/2013 12:45 PM, Sachin Kamat wrote:
> Use the newly introduced devm_ioremap_resource() instead of
> devm_request_and_ioremap() 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: Sachin Kamat <sachin.kamat@linaro.org>
> Cc: Roger Quadros <rogerq@ti.com>
> ---
>  drivers/mfd/omap-usb-tll.c |    9 +++------
>  1 file changed, 3 insertions(+), 6 deletions(-)
> 
Acked-by: Roger Quadros <rogerq@ti.com>


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

* Re: [PATCH 1/2] mfd: omap-usb-host: Convert to devm_ioremap_resource()
  2013-04-04  9:45 [PATCH 1/2] mfd: omap-usb-host: Convert to devm_ioremap_resource() Sachin Kamat
  2013-04-04  9:45 ` [PATCH 2/2] mfd: omap-usb-tll: " Sachin Kamat
  2013-04-04 10:05 ` [PATCH 1/2] mfd: omap-usb-host: " Roger Quadros
@ 2013-04-09 10:13 ` Samuel Ortiz
  2013-04-09 10:23   ` Sachin Kamat
  2 siblings, 1 reply; 6+ messages in thread
From: Samuel Ortiz @ 2013-04-09 10:13 UTC (permalink / raw)
  To: Sachin Kamat; +Cc: linux-kernel, Roger Quadros

Hi Sachin,

On Thu, Apr 04, 2013 at 03:15:14PM +0530, Sachin Kamat wrote:
> Use the newly introduced devm_ioremap_resource() instead of
> devm_request_and_ioremap() 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: Sachin Kamat <sachin.kamat@linaro.org>
> Cc: Roger Quadros <rogerq@ti.com>
> ---
>  drivers/mfd/omap-usb-host.c |    9 ++++-----
>  1 file changed, 4 insertions(+), 5 deletions(-)
The 2 patches make sense to me, but they don't apply cleanly on top of
mfd-next. Would you mind sending me a rebased version ?

Cheers,
Samuel.

-- 
Intel Open Source Technology Centre
http://oss.intel.com/

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

* Re: [PATCH 1/2] mfd: omap-usb-host: Convert to devm_ioremap_resource()
  2013-04-09 10:13 ` Samuel Ortiz
@ 2013-04-09 10:23   ` Sachin Kamat
  0 siblings, 0 replies; 6+ messages in thread
From: Sachin Kamat @ 2013-04-09 10:23 UTC (permalink / raw)
  To: Samuel Ortiz; +Cc: linux-kernel, Roger Quadros

Hi Samuel,

On 9 April 2013 15:43, Samuel Ortiz <sameo@linux.intel.com> wrote:
> Hi Sachin,
>
> On Thu, Apr 04, 2013 at 03:15:14PM +0530, Sachin Kamat wrote:
>> Use the newly introduced devm_ioremap_resource() instead of
>> devm_request_and_ioremap() 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: Sachin Kamat <sachin.kamat@linaro.org>
>> Cc: Roger Quadros <rogerq@ti.com>
>> ---
>>  drivers/mfd/omap-usb-host.c |    9 ++++-----
>>  1 file changed, 4 insertions(+), 5 deletions(-)
> The 2 patches make sense to me, but they don't apply cleanly on top of
> mfd-next. Would you mind sending me a rebased version ?

Sure, I will.


-- 
With warm regards,
Sachin

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

end of thread, other threads:[~2013-04-09 10:23 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-04-04  9:45 [PATCH 1/2] mfd: omap-usb-host: Convert to devm_ioremap_resource() Sachin Kamat
2013-04-04  9:45 ` [PATCH 2/2] mfd: omap-usb-tll: " Sachin Kamat
2013-04-04 10:06   ` Roger Quadros
2013-04-04 10:05 ` [PATCH 1/2] mfd: omap-usb-host: " Roger Quadros
2013-04-09 10:13 ` Samuel Ortiz
2013-04-09 10:23   ` Sachin Kamat

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