Skip to contentSkip to conversation

spi: rockchip-sfc: Use devm_platform_ioremap_resource()

PATCH In review Yang Li 3 participants 3 messages Mar 29, 2023

Subsystems (2)
lore
Share & tools
lore

Yang Li

author
#0 lore raw

PATCH v2 1/1 spi: rockchip-sfc: Use devm_platform_ioremap_resource()

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

---

change in v2:
--According to Tudor's suggestion, use devm_platform_ioremap_resource() and
get rid of the local variable too.

 drivers/spi/spi-rockchip-sfc.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)
drivers/spi/spi-rockchip-sfc.c +1 -3
index 4fabd2e0439f..b370aade11b4 100644
@@ -558,7 +558,6 @@ static int rockchip_sfc_probe(struct platform_device *pdev)
 {
 	struct device *dev = &pdev->dev;
 	struct spi_master *master;
-	struct resource *res;
 	struct rockchip_sfc *sfc;
 	int ret;
 
@@ -576,8 +575,7 @@ static int rockchip_sfc_probe(struct platform_device *pdev)
 	sfc = spi_master_get_devdata(master);
 	sfc->dev = dev;
 
-	res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
-	sfc->regbase = devm_ioremap_resource(dev, res);
+	sfc->regbase = devm_platform_ioremap_resource(pdev, 0);
 	if (IS_ERR(sfc->regbase))
 		return PTR_ERR(sfc->regbase);
 
Signature · 1 line
2.20.1.7.g153144c
Reviewed-by on v2 1/1
#1 lore raw
Quoted 5 lines · Yang Li

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

I still prefer a single patch per subsystem, but Mark is going to decide:

Quoted 22 lines

---

change in v2:
--According to Tudor's suggestion, use devm_platform_ioremap_resource() and
get rid of the local variable too.

 drivers/spi/spi-rockchip-sfc.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)
drivers/spi/spi-rockchip-sfc.c +0 -1
index 4fabd2e0439f..b370aade11b4 100644
@@ -558,7 +558,6 @@ static int rockchip_sfc_probe(struct platform_device *pdev)
 {
 	struct device *dev = &pdev->dev;
 	struct spi_master *master;
-	struct resource *res;
 	struct rockchip_sfc *sfc;
 	int ret;
 

drivers/spi/spi-rockchip-sfc.c static int rockchip_sfc_probe(struct platform_device *pdev) · line 581

Quoted 9 lines
drivers/spi/spi-rockchip-sfc.c +1 -2
@@ -576,8 +575,7 @@ static int rockchip_sfc_probe(struct platform_device *pdev)
 	sfc = spi_master_get_devdata(master);
 	sfc->dev = dev;
 
-	res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
-	sfc->regbase = devm_ioremap_resource(dev, res);
+	sfc->regbase = devm_platform_ioremap_resource(pdev, 0);
 	if (IS_ERR(sfc->regbase))
 		return PTR_ERR(sfc->regbase);
 

_______________________________________________
Linux-rockchip mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-rockchip

maintainer
#2 lore raw
In reply to Yang Li
Quoted 5 lines · Yang Li

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

Applied to

broonie/spi.git for-6.4

Thanks!

[1/1] spi: rockchip-sfc: Use devm_platform_ioremap_resource()

      commit: 526c2966fca3337f01c513b1f0d85c839f8d8175

All being well this means that it will be integrated into the linux-next tree (usually sometime in the next 24 hours) and sent to Linus during the next merge window (or sooner if it is a bug fix), however if problems are discovered then the patch may be dropped or reverted.

You may get further e-mails resulting from automated or manual testing and review of the tree, please engage with people reporting problems and send followup patches addressing any issues that are reported if needed.

If any updates are required or you are submitting further changes they should be sent as incremental updates against current git, existing patches will not be replaced.

Please add any relevant lists and maintainers to the CCs when replying to this mail.

Thanks,
Mark