From: Aayush Kumar <code@aayushk.dev>
To: broonie@kernel.org
Cc: linux-spi@vger.kernel.org, linux-kernel@vger.kernel.org,
Aayush Kumar <code@aayushk.dev>
Subject: [PATCH 2/2] spi: jcore: Use devm_platform_ioremap_resource()
Date: Fri, 9 Oct 2026 18:54:21 +0530 [thread overview]
Message-ID: <20261009132421.557758-3-code@aayushk.dev> (raw)
In-Reply-To: <20261009132421.557758-1-code@aayushk.dev>
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
prev parent reply other threads:[~2026-10-09 13:24 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
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 [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20261009132421.557758-3-code@aayushk.dev \
--to=code@aayushk.dev \
--cc=broonie@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-spi@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.