# \[PATCH 1/3\] video: exynos\_mipi\_dsi: Convert to devm\_ioremap\_resource()

- Subsystems: FRAMEBUFFER LAYER, THE REST
- Maintainers: Helge Deller, Linus Torvalds
- List: linux-fbdev
- 3 messages, 2 authors
- Page: https://ratatoskr.run/linux-fbdev/2013/01/3993938/t

## \[PATCH 1/3\] video: exynos\_mipi\_dsi: Convert to devm\_ioremap\_resource()

- From: Sachin Kamat \<hidden\>
- Date: 2013-01-31 10:34:55 
- Message: https://ratatoskr.run/linux-fbdev/2013/01/3993938.md

```text
Use the newly introduced devm_ioremap_resource() instead of
devm_request_and_ioremap() which provides more consistent error handling.

Signed-off-by: Sachin Kamat <redacted>
Cc: Donghwa Lee <redacted>
Cc: Florian Tobias Schandinat <FlorianSchandinat@gmx.de>
Cc: <redacted>
---
 drivers/video/exynos/exynos_mipi_dsi.c |    7 ++++---
 1 files changed, 4 insertions(+), 3 deletions(-)

diff --git a/drivers/video/exynos/exynos_mipi_dsi.c b/drivers/video/exynos/exynos_mipi_dsi.c
index fac7df6..a29715f 100644
--- a/drivers/video/exynos/exynos_mipi_dsi.c
+++ b/drivers/video/exynos/exynos_mipi_dsi.c
@@ -32,6 +32,7 @@
 #include <linux/notifier.h>
 #include <linux/regulator/consumer.h>
 #include <linux/pm_runtime.h>
+#include <linux/err.h>
 
 #include <video/exynos_mipi_dsim.h>
 
@@ -384,10 +385,10 @@ static int exynos_mipi_dsi_probe(struct platform_device *pdev)
 
 	res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
 
-	dsim->reg_base = devm_request_and_ioremap(&pdev->dev, res);
-	if (!dsim->reg_base) {
+	dsim->reg_base = devm_ioremap_resource(&pdev->dev, res);
+	if (IS_ERR(dsim->reg_base)) {
 		dev_err(&pdev->dev, "failed to remap io region\n");
-		ret = -ENOMEM;
+		ret = PTR_ERR(dsim->reg_base);
 		goto error;
 	}
 
-- 
1.7.4.1

```

## Re: \[PATCH 1/3\] video: exynos\_mipi\_dsi: Convert to devm\_ioremap\_resource()

- From: Thierry Reding \<hidden\>
- Date: 2013-01-31 10:42:58 
- Message: https://ratatoskr.run/linux-fbdev/2013/01/3993951.md

```text
On Thu, Jan 31, 2013 at 03:55:37PM +0530, Sachin Kamat wrote:
> Use the newly introduced devm_ioremap_resource() instead of
> devm_request_and_ioremap() which provides more consistent error handling.
> 
> Signed-off-by: Sachin Kamat <redacted>
> Cc: Donghwa Lee <redacted>
> Cc: Florian Tobias Schandinat <FlorianSchandinat@gmx.de>
> Cc: <redacted>
> ---
>  drivers/video/exynos/exynos_mipi_dsi.c |    7 ++++---
>  1 files changed, 4 insertions(+), 3 deletions(-)

All of these can drop the additional error message because equivalent
error message are output by devm_ioremap_resource() itself.

Thierry
```

## Re: \[PATCH 1/3\] video: exynos\_mipi\_dsi: Convert to devm\_ioremap\_resource()

- From: Sachin Kamat \<hidden\>
- Date: 2013-01-31 11:20:12 
- Message: https://ratatoskr.run/linux-fbdev/2013/01/3993984.md

```text
On 31 January 2013 16:12, Thierry Reding
[ref] wrote:
> On Thu, Jan 31, 2013 at 03:55:37PM +0530, Sachin Kamat wrote:
>> Use the newly introduced devm_ioremap_resource() instead of
>> devm_request_and_ioremap() which provides more consistent error handling.
>>
>> Signed-off-by: Sachin Kamat <redacted>
>> Cc: Donghwa Lee <redacted>
>> Cc: Florian Tobias Schandinat <FlorianSchandinat@gmx.de>
>> Cc: <redacted>
>> ---
>>  drivers/video/exynos/exynos_mipi_dsi.c |    7 ++++---
>>  1 files changed, 4 insertions(+), 3 deletions(-)
>
> All of these can drop the additional error message because equivalent
> error message are output by devm_ioremap_resource() itself.

Ah right.. I will remove them and re-send the patches.

-- 
With warm regards,
Sachin
```
