diff mbox series

[-next] spi: bcmbca-hsspi: Simpify resource lookup

Message ID 20240820124011.1788479-1-ruanjinjie@huawei.com
State Accepted
Commit 91232b00b1a5d2486770c72c51a752a77c7601b2
Headers show
Series [-next] spi: bcmbca-hsspi: Simpify resource lookup | expand

Commit Message

Jinjie Ruan Aug. 20, 2024, 12:40 p.m. UTC
Instead of calling platform_get_resource_byname() and
devm_ioremap_resource(), simplify the code by simply calling
devm_platform_ioremap_resource_byname().

Signed-off-by: Jinjie Ruan <ruanjinjie@huawei.com>
---
 drivers/spi/spi-bcmbca-hsspi.c | 11 ++---------
 1 file changed, 2 insertions(+), 9 deletions(-)

Comments

Mark Brown Aug. 23, 2024, 10:57 p.m. UTC | #1
On Tue, 20 Aug 2024 20:40:11 +0800, Jinjie Ruan wrote:
> Instead of calling platform_get_resource_byname() and
> devm_ioremap_resource(), simplify the code by simply calling
> devm_platform_ioremap_resource_byname().
> 
> 

Applied to

   https://git.kernel.org/pub/scm/linux/kernel/git/broonie/spi.git for-next

Thanks!

[1/1] spi: bcmbca-hsspi: Simpify resource lookup
      commit: 91232b00b1a5d2486770c72c51a752a77c7601b2

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
diff mbox series

Patch

diff --git a/drivers/spi/spi-bcmbca-hsspi.c b/drivers/spi/spi-bcmbca-hsspi.c
index 9f64afd8164e..e48a56c68ce7 100644
--- a/drivers/spi/spi-bcmbca-hsspi.c
+++ b/drivers/spi/spi-bcmbca-hsspi.c
@@ -433,7 +433,6 @@  static int bcmbca_hsspi_probe(struct platform_device *pdev)
 {
 	struct spi_controller *host;
 	struct bcmbca_hsspi *bs;
-	struct resource *res_mem;
 	void __iomem *spim_ctrl;
 	void __iomem *regs;
 	struct device *dev = &pdev->dev;
@@ -445,17 +444,11 @@  static int bcmbca_hsspi_probe(struct platform_device *pdev)
 	if (irq < 0)
 		return irq;
 
-	res_mem = platform_get_resource_byname(pdev, IORESOURCE_MEM, "hsspi");
-	if (!res_mem)
-		return -EINVAL;
-	regs = devm_ioremap_resource(dev, res_mem);
+	regs = devm_platform_ioremap_resource_byname(pdev, "hsspi");
 	if (IS_ERR(regs))
 		return PTR_ERR(regs);
 
-	res_mem = platform_get_resource_byname(pdev, IORESOURCE_MEM, "spim-ctrl");
-	if (!res_mem)
-		return -EINVAL;
-	spim_ctrl = devm_ioremap_resource(dev, res_mem);
+	spim_ctrl = devm_platform_ioremap_resource_byname(pdev, "spim-ctrl");
 	if (IS_ERR(spim_ctrl))
 		return PTR_ERR(spim_ctrl);