2023-03-21 11:44:18

by ye.xingchen

[permalink] [raw]
Subject: [PATCH] i2c: brcmstb: use devm_platform_ioremap_resource_byname()

From: Ye Xingchen <[email protected]>

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

Signed-off-by: Ye Xingchen <[email protected]>
---
drivers/i2c/busses/i2c-brcmstb.c | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/drivers/i2c/busses/i2c-brcmstb.c b/drivers/i2c/busses/i2c-brcmstb.c
index 69383be47905..ef942714642a 100644
--- a/drivers/i2c/busses/i2c-brcmstb.c
+++ b/drivers/i2c/busses/i2c-brcmstb.c
@@ -575,12 +575,10 @@ static void brcmstb_i2c_set_bsc_reg_defaults(struct brcmstb_i2c_dev *dev)
static int bcm2711_release_bsc(struct brcmstb_i2c_dev *dev)
{
struct platform_device *pdev = to_platform_device(dev->device);
- struct resource *iomem;
void __iomem *autoi2c;

/* Map hardware registers */
- iomem = platform_get_resource_byname(pdev, IORESOURCE_MEM, "auto-i2c");
- autoi2c = devm_ioremap_resource(&pdev->dev, iomem);
+ autoi2c = devm_platform_ioremap_resource_byname(pdev, "auto-i2c");
if (IS_ERR(autoi2c))
return PTR_ERR(autoi2c);

--
2.25.1


2023-03-21 16:27:28

by Florian Fainelli

[permalink] [raw]
Subject: Re: [PATCH] i2c: brcmstb: use devm_platform_ioremap_resource_byname()

On 3/21/23 04:44, [email protected] wrote:
> From: Ye Xingchen <[email protected]>
>
> Convert platform_get_resource_byname(),devm_ioremap_resource() to a single
> call to devm_platform_ioremap_resource_byname(), as this is exactly what
> this function does.
>
> Signed-off-by: Ye Xingchen <[email protected]>

Acked-by: Florian Fainelli <[email protected]>
--
Florian


2023-03-29 19:24:24

by Wolfram Sang

[permalink] [raw]
Subject: Re: [PATCH] i2c: brcmstb: use devm_platform_ioremap_resource_byname()

On Tue, Mar 21, 2023 at 07:44:06PM +0800, [email protected] wrote:
> From: Ye Xingchen <[email protected]>
>
> Convert platform_get_resource_byname(),devm_ioremap_resource() to a single
> call to devm_platform_ioremap_resource_byname(), as this is exactly what
> this function does.
>
> Signed-off-by: Ye Xingchen <[email protected]>

Applied to for-next, thanks!


Attachments:
(No filename) (393.00 B)
signature.asc (849.00 B)
Download all attachments