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 <[email protected]>
Cc: Roger Quadros <[email protected]>
---
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
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 <[email protected]>
Cc: Roger Quadros <[email protected]>
---
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
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 <[email protected]>
> Cc: Roger Quadros <[email protected]>
Acked-by: Roger Quadros <[email protected]>
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 <[email protected]>
> Cc: Roger Quadros <[email protected]>
> ---
> drivers/mfd/omap-usb-tll.c | 9 +++------
> 1 file changed, 3 insertions(+), 6 deletions(-)
>
Acked-by: Roger Quadros <[email protected]>
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 <[email protected]>
> Cc: Roger Quadros <[email protected]>
> ---
> 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/
Hi Samuel,
On 9 April 2013 15:43, Samuel Ortiz <[email protected]> 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 <[email protected]>
>> Cc: Roger Quadros <[email protected]>
>> ---
>> 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