public inbox for linux-arm-kernel@lists.infradead.org
 help / color / mirror / Atom feed
* [PATCH] i2c: xiic: Use devm_platform_get_and_ioremap_resource()
@ 2023-01-28  6:53 ye.xingchen
  2023-01-31 12:22 ` Michal Simek
  2023-02-12 21:14 ` Wolfram Sang
  0 siblings, 2 replies; 3+ messages in thread
From: ye.xingchen @ 2023-01-28  6:53 UTC (permalink / raw)
  To: michal.simek; +Cc: linux-arm-kernel, linux-i2c, linux-kernel

From: ye xingchen <ye.xingchen@zte.com.cn>

Convert platform_get_resource(), devm_ioremap_resource() to a single
call to devm_platform_get_and_ioremap_resource(), as this is exactly
what this function does.

Signed-off-by: ye xingchen <ye.xingchen@zte.com.cn>
---
 drivers/i2c/busses/i2c-xiic.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/drivers/i2c/busses/i2c-xiic.c b/drivers/i2c/busses/i2c-xiic.c
index bee5a2ef1f22..5114888f2916 100644
--- a/drivers/i2c/busses/i2c-xiic.c
+++ b/drivers/i2c/busses/i2c-xiic.c
@@ -752,7 +752,6 @@ static int xiic_i2c_probe(struct platform_device *pdev)
 {
 	struct xiic_i2c *i2c;
 	struct xiic_i2c_platform_data *pdata;
-	struct resource *res;
 	int ret, irq;
 	u8 i;
 	u32 sr;
@@ -761,8 +760,7 @@ static int xiic_i2c_probe(struct platform_device *pdev)
 	if (!i2c)
 		return -ENOMEM;

-	res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
-	i2c->base = devm_ioremap_resource(&pdev->dev, res);
+	i2c->base = devm_platform_get_and_ioremap_resource(pdev, 0, NULL);
 	if (IS_ERR(i2c->base))
 		return PTR_ERR(i2c->base);

-- 
2.25.1

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* Re: [PATCH] i2c: xiic: Use devm_platform_get_and_ioremap_resource()
  2023-01-28  6:53 [PATCH] i2c: xiic: Use devm_platform_get_and_ioremap_resource() ye.xingchen
@ 2023-01-31 12:22 ` Michal Simek
  2023-02-12 21:14 ` Wolfram Sang
  1 sibling, 0 replies; 3+ messages in thread
From: Michal Simek @ 2023-01-31 12:22 UTC (permalink / raw)
  To: ye.xingchen, michal.simek; +Cc: linux-arm-kernel, linux-i2c, linux-kernel



On 1/28/23 07:53, ye.xingchen@zte.com.cn wrote:
> 
> From: ye xingchen <ye.xingchen@zte.com.cn>
> 
> Convert platform_get_resource(), devm_ioremap_resource() to a single
> call to devm_platform_get_and_ioremap_resource(), as this is exactly
> what this function does.
> 
> Signed-off-by: ye xingchen <ye.xingchen@zte.com.cn>

note: in my part of world name is starting with upper letter

> ---
>   drivers/i2c/busses/i2c-xiic.c | 4 +---
>   1 file changed, 1 insertion(+), 3 deletions(-)
> 
> diff --git a/drivers/i2c/busses/i2c-xiic.c b/drivers/i2c/busses/i2c-xiic.c
> index bee5a2ef1f22..5114888f2916 100644
> --- a/drivers/i2c/busses/i2c-xiic.c
> +++ b/drivers/i2c/busses/i2c-xiic.c
> @@ -752,7 +752,6 @@ static int xiic_i2c_probe(struct platform_device *pdev)
>   {
>          struct xiic_i2c *i2c;
>          struct xiic_i2c_platform_data *pdata;
> -       struct resource *res;
>          int ret, irq;
>          u8 i;
>          u32 sr;
> @@ -761,8 +760,7 @@ static int xiic_i2c_probe(struct platform_device *pdev)
>          if (!i2c)
>                  return -ENOMEM;
> 
> -       res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
> -       i2c->base = devm_ioremap_resource(&pdev->dev, res);
> +       i2c->base = devm_platform_get_and_ioremap_resource(pdev, 0, NULL);
>          if (IS_ERR(i2c->base))
>                  return PTR_ERR(i2c->base);
> 
> --
> 2.25.1

Reviewed-by: Michal Simek <michal.simek@amd.com>

Thanks,
Michal

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* Re: [PATCH] i2c: xiic: Use devm_platform_get_and_ioremap_resource()
  2023-01-28  6:53 [PATCH] i2c: xiic: Use devm_platform_get_and_ioremap_resource() ye.xingchen
  2023-01-31 12:22 ` Michal Simek
@ 2023-02-12 21:14 ` Wolfram Sang
  1 sibling, 0 replies; 3+ messages in thread
From: Wolfram Sang @ 2023-02-12 21:14 UTC (permalink / raw)
  To: ye.xingchen; +Cc: michal.simek, linux-arm-kernel, linux-i2c, linux-kernel


[-- Attachment #1.1: Type: text/plain, Size: 488 bytes --]

On Sat, Jan 28, 2023 at 02:53:12PM +0800, ye.xingchen@zte.com.cn wrote:
> From: ye xingchen <ye.xingchen@zte.com.cn>
> 
> Convert platform_get_resource(), devm_ioremap_resource() to a single
> call to devm_platform_get_and_ioremap_resource(), as this is exactly
> what this function does.
> 
> Signed-off-by: ye xingchen <ye.xingchen@zte.com.cn>

Could you kindly rebase this to i2c/for-next or i2c/for-mergewindow? An
earlier series for xiic has been applied there. Thanks!


[-- Attachment #1.2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

[-- Attachment #2: Type: text/plain, Size: 176 bytes --]

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

end of thread, other threads:[~2023-02-12 21:15 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-01-28  6:53 [PATCH] i2c: xiic: Use devm_platform_get_and_ioremap_resource() ye.xingchen
2023-01-31 12:22 ` Michal Simek
2023-02-12 21:14 ` Wolfram Sang

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox