* [PATCH 0/2] spi: use devm_platform_ioremap_resource() in sh-hspi and jcore
@ 2026-10-09 13:24 Aayush Kumar
2026-10-09 13:24 ` [PATCH 1/2] spi: sh-hspi: Use devm_platform_ioremap_resource() Aayush Kumar
` (2 more replies)
0 siblings, 3 replies; 4+ messages in thread
From: Aayush Kumar @ 2026-10-09 13:24 UTC (permalink / raw)
To: broonie; +Cc: linux-spi, linux-kernel, Aayush Kumar
Convert these two SPI drivers to the devm_platform_ioremap_resource()
helper to simplify the probe paths.
Aayush Kumar (2):
spi: sh-hspi: Use devm_platform_ioremap_resource()
spi: jcore: Use devm_platform_ioremap_resource()
drivers/spi/spi-jcore.c | 14 +++-----------
drivers/spi/spi-sh-hspi.c | 15 +++------------
2 files changed, 6 insertions(+), 23 deletions(-)
--
2.56.0
^ permalink raw reply [flat|nested] 4+ messages in thread
* [PATCH 1/2] spi: sh-hspi: Use devm_platform_ioremap_resource()
2026-10-09 13:24 [PATCH 0/2] spi: use devm_platform_ioremap_resource() in sh-hspi and jcore Aayush Kumar
@ 2026-10-09 13:24 ` Aayush Kumar
2026-10-09 13:24 ` [PATCH 2/2] spi: jcore: " Aayush Kumar
2026-10-13 19:50 ` [PATCH 0/2] spi: use devm_platform_ioremap_resource() in sh-hspi and jcore Mark Brown
2 siblings, 0 replies; 4+ messages in thread
From: Aayush Kumar @ 2026-10-09 13:24 UTC (permalink / raw)
To: broonie; +Cc: linux-spi, linux-kernel, Aayush Kumar
Use the devm_platform_ioremap_resource() helper instead of calling
platform_get_resource() and devm_ioremap() separately.
Signed-off-by: Aayush Kumar <code@aayushk.dev>
---
drivers/spi/spi-sh-hspi.c | 15 +++------------
1 file changed, 3 insertions(+), 12 deletions(-)
diff --git a/drivers/spi/spi-sh-hspi.c b/drivers/spi/spi-sh-hspi.c
index f840467cf..56df076b6 100644
--- a/drivers/spi/spi-sh-hspi.c
+++ b/drivers/spi/spi-sh-hspi.c
@@ -211,19 +211,11 @@ static int hspi_transfer_one_message(struct spi_controller *ctlr,
static int hspi_probe(struct platform_device *pdev)
{
- struct resource *res;
struct spi_controller *ctlr;
struct hspi_priv *hspi;
struct clk *clk;
int ret;
- /* get base addr */
- res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
- if (!res) {
- dev_err(&pdev->dev, "invalid resource\n");
- return -EINVAL;
- }
-
ctlr = devm_spi_alloc_host(&pdev->dev, sizeof(*hspi));
if (!ctlr)
return -ENOMEM;
@@ -241,10 +233,9 @@ static int hspi_probe(struct platform_device *pdev)
hspi->ctlr = ctlr;
hspi->dev = &pdev->dev;
hspi->clk = clk;
- hspi->addr = devm_ioremap(hspi->dev,
- res->start, resource_size(res));
- if (!hspi->addr) {
- ret = -ENOMEM;
+ hspi->addr = devm_platform_ioremap_resource(pdev, 0);
+ if (IS_ERR(hspi->addr)) {
+ ret = PTR_ERR(hspi->addr);
goto error1;
}
--
2.56.0
^ permalink raw reply related [flat|nested] 4+ messages in thread
* [PATCH 2/2] spi: jcore: Use devm_platform_ioremap_resource()
2026-10-09 13:24 [PATCH 0/2] spi: use devm_platform_ioremap_resource() in sh-hspi and jcore Aayush Kumar
2026-10-09 13:24 ` [PATCH 1/2] spi: sh-hspi: Use devm_platform_ioremap_resource() Aayush Kumar
@ 2026-10-09 13:24 ` Aayush Kumar
2026-10-13 19:50 ` [PATCH 0/2] spi: use devm_platform_ioremap_resource() in sh-hspi and jcore Mark Brown
2 siblings, 0 replies; 4+ messages in thread
From: Aayush Kumar @ 2026-10-09 13:24 UTC (permalink / raw)
To: broonie; +Cc: linux-spi, linux-kernel, Aayush Kumar
Use the devm_platform_ioremap_resource() helper instead of calling
platform_get_resource(), devm_request_mem_region() and devm_ioremap()
separately.
Signed-off-by: Aayush Kumar <code@aayushk.dev>
---
drivers/spi/spi-jcore.c | 14 +++-----------
1 file changed, 3 insertions(+), 11 deletions(-)
diff --git a/drivers/spi/spi-jcore.c b/drivers/spi/spi-jcore.c
index a75cd61ec..df82e8adb 100644
--- a/drivers/spi/spi-jcore.c
+++ b/drivers/spi/spi-jcore.c
@@ -143,7 +143,6 @@ static int jcore_spi_probe(struct platform_device *pdev)
struct device_node *node = pdev->dev.of_node;
struct jcore_spi *hw;
struct spi_controller *host;
- struct resource *res;
u32 clock_freq;
struct clk *clk;
@@ -164,16 +163,9 @@ static int jcore_spi_probe(struct platform_device *pdev)
platform_set_drvdata(pdev, hw);
/* Find and map our resources */
- res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
- if (!res)
- return -EBUSY;
- if (!devm_request_mem_region(&pdev->dev, res->start,
- resource_size(res), pdev->name))
- return -EBUSY;
- hw->base = devm_ioremap(&pdev->dev, res->start,
- resource_size(res));
- if (!hw->base)
- return -EBUSY;
+ hw->base = devm_platform_ioremap_resource(pdev, 0);
+ if (IS_ERR(hw->base))
+ return PTR_ERR(hw->base);
/*
* The SPI clock rate controlled via a configurable clock divider
--
2.56.0
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH 0/2] spi: use devm_platform_ioremap_resource() in sh-hspi and jcore
2026-10-09 13:24 [PATCH 0/2] spi: use devm_platform_ioremap_resource() in sh-hspi and jcore Aayush Kumar
2026-10-09 13:24 ` [PATCH 1/2] spi: sh-hspi: Use devm_platform_ioremap_resource() Aayush Kumar
2026-10-09 13:24 ` [PATCH 2/2] spi: jcore: " Aayush Kumar
@ 2026-10-13 19:50 ` Mark Brown
2 siblings, 0 replies; 4+ messages in thread
From: Mark Brown @ 2026-10-13 19:50 UTC (permalink / raw)
To: Aayush Kumar; +Cc: linux-spi, linux-kernel
On Fri, 09 Oct 2026 18:54:19 +0530, Aayush Kumar wrote:
> spi: use devm_platform_ioremap_resource() in sh-hspi and jcore
>
> Convert these two SPI drivers to the devm_platform_ioremap_resource()
> helper to simplify the probe paths.
>
> Aayush Kumar (2):
> spi: sh-hspi: Use devm_platform_ioremap_resource()
> spi: jcore: Use devm_platform_ioremap_resource()
>
> [...]
Applied to
https://git.kernel.org/pub/scm/linux/kernel/git/broonie/spi.git for-7.4
Thanks!
[1/2] spi: sh-hspi: Use devm_platform_ioremap_resource()
https://git.kernel.org/broonie/spi/c/e796a187fbe3
[2/2] spi: jcore: Use devm_platform_ioremap_resource()
https://git.kernel.org/broonie/spi/c/a0b70663dddf
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
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2026-10-15 12:39 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-10-09 13:24 [PATCH 0/2] spi: use devm_platform_ioremap_resource() in sh-hspi and jcore Aayush Kumar
2026-10-09 13:24 ` [PATCH 1/2] spi: sh-hspi: Use devm_platform_ioremap_resource() Aayush Kumar
2026-10-09 13:24 ` [PATCH 2/2] spi: jcore: " Aayush Kumar
2026-10-13 19:50 ` [PATCH 0/2] spi: use devm_platform_ioremap_resource() in sh-hspi and jcore Mark Brown
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox