i2c: omap: use devm_platform_ioremap_resource()
diff mbox series

Message ID 1581755803-11242-1-git-send-email-qiwuchen55@gmail.com
State Accepted
Headers show
Series
  • i2c: omap: use devm_platform_ioremap_resource()
Related show

Commit Message

qiwuchen55@gmail.com Feb. 15, 2020, 8:36 a.m. UTC
From: chenqiwu <chenqiwu@xiaomi.com>

Use a new API devm_platform_ioremap_resource() to simplify code.

Signed-off-by: chenqiwu <chenqiwu@xiaomi.com>
---
 drivers/i2c/busses/i2c-omap.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

Comments

Luca Ceresoli Feb. 17, 2020, 8:13 a.m. UTC | #1
Hi,

On 15/02/20 09:36, qiwuchen55@gmail.com wrote:
> From: chenqiwu <chenqiwu@xiaomi.com>
> 
> Use a new API devm_platform_ioremap_resource() to simplify code.
> 
> Signed-off-by: chenqiwu <chenqiwu@xiaomi.com>

Tested-by: Luca Ceresoli <luca@lucaceresoli.net>
Reviewed-by: Luca Ceresoli <luca@lucaceresoli.net>
Vignesh Raghavendra Feb. 18, 2020, 5:58 a.m. UTC | #2
On 15/02/20 2:06 pm, qiwuchen55@gmail.com wrote:
> From: chenqiwu <chenqiwu@xiaomi.com>
> 
> Use a new API devm_platform_ioremap_resource() to simplify code.
> 
> Signed-off-by: chenqiwu <chenqiwu@xiaomi.com>
> ---

Reviewed-by: Vignesh Raghavendra <vigneshr@ti.com>

>  drivers/i2c/busses/i2c-omap.c | 4 +---
>  1 file changed, 1 insertion(+), 3 deletions(-)
> 
> diff --git a/drivers/i2c/busses/i2c-omap.c b/drivers/i2c/busses/i2c-omap.c
> index 2dfea35..47d994a 100644
> --- a/drivers/i2c/busses/i2c-omap.c
> +++ b/drivers/i2c/busses/i2c-omap.c
> @@ -1355,7 +1355,6 @@ static void omap_i2c_unprepare_recovery(struct i2c_adapter *adap)
>  {
>  	struct omap_i2c_dev	*omap;
>  	struct i2c_adapter	*adap;
> -	struct resource		*mem;
>  	const struct omap_i2c_bus_platform_data *pdata =
>  		dev_get_platdata(&pdev->dev);
>  	struct device_node	*node = pdev->dev.of_node;
> @@ -1375,8 +1374,7 @@ static void omap_i2c_unprepare_recovery(struct i2c_adapter *adap)
>  	if (!omap)
>  		return -ENOMEM;
>  
> -	mem = platform_get_resource(pdev, IORESOURCE_MEM, 0);
> -	omap->base = devm_ioremap_resource(&pdev->dev, mem);
> +	omap->base = devm_platform_ioremap_resource(pdev, 0);
>  	if (IS_ERR(omap->base))
>  		return PTR_ERR(omap->base);
>  
>
Wolfram Sang March 10, 2020, 9:51 a.m. UTC | #3
On Sat, Feb 15, 2020 at 04:36:43PM +0800, qiwuchen55@gmail.com wrote:
> From: chenqiwu <chenqiwu@xiaomi.com>
> 
> Use a new API devm_platform_ioremap_resource() to simplify code.
> 
> Signed-off-by: chenqiwu <chenqiwu@xiaomi.com>

Applied to for-next, thanks!

Patch
diff mbox series

diff --git a/drivers/i2c/busses/i2c-omap.c b/drivers/i2c/busses/i2c-omap.c
index 2dfea35..47d994a 100644
--- a/drivers/i2c/busses/i2c-omap.c
+++ b/drivers/i2c/busses/i2c-omap.c
@@ -1355,7 +1355,6 @@  static void omap_i2c_unprepare_recovery(struct i2c_adapter *adap)
 {
 	struct omap_i2c_dev	*omap;
 	struct i2c_adapter	*adap;
-	struct resource		*mem;
 	const struct omap_i2c_bus_platform_data *pdata =
 		dev_get_platdata(&pdev->dev);
 	struct device_node	*node = pdev->dev.of_node;
@@ -1375,8 +1374,7 @@  static void omap_i2c_unprepare_recovery(struct i2c_adapter *adap)
 	if (!omap)
 		return -ENOMEM;
 
-	mem = platform_get_resource(pdev, IORESOURCE_MEM, 0);
-	omap->base = devm_ioremap_resource(&pdev->dev, mem);
+	omap->base = devm_platform_ioremap_resource(pdev, 0);
 	if (IS_ERR(omap->base))
 		return PTR_ERR(omap->base);