summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarco Scardovi <scardracs@disroot.org>2026-06-08 01:05:03 +0200
committerBartosz Golaszewski <bartosz.golaszewski@oss.qualcomm.com>2026-06-26 09:53:27 +0200
commitc03c6a086d188dc5b52e7db2b2991ecead9bb669 (patch)
tree9d4857b3781cb8698a052b5ccc78cceb11c5dfae
parent962528fef90253aeded29cee20a9b6ff3595fed4 (diff)
gpio: rockchip: use devm_platform_ioremap_resource() to map registers
Currently, the driver retrieves the memory resource with of_address_to_resource() and maps it with devm_ioremap_resource(). Since the bank device is a platform_device, simplify and modernize the code by using devm_platform_ioremap_resource(). This also removes the need for the local struct resource variable. Assisted-by: Antigravity:gemini-3.5-flash Signed-off-by: Marco Scardovi <scardracs@disroot.org> Link: https://patch.msgid.link/20260607230504.35392-3-scardracs@disroot.org Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@oss.qualcomm.com>
-rw-r--r--drivers/gpio/gpio-rockchip.c9
1 files changed, 2 insertions, 7 deletions
diff --git a/drivers/gpio/gpio-rockchip.c b/drivers/gpio/gpio-rockchip.c
index 9478a58f1caa..8647d006d103 100644
--- a/drivers/gpio/gpio-rockchip.c
+++ b/drivers/gpio/gpio-rockchip.c
@@ -647,15 +647,10 @@ static void rockchip_clk_put(void *data)
static int rockchip_get_bank_data(struct rockchip_pin_bank *bank)
{
- struct resource res;
+ struct platform_device *pdev = to_platform_device(bank->dev);
int id = 0, ret;
- if (of_address_to_resource(bank->of_node, 0, &res)) {
- dev_err(bank->dev, "cannot find IO resource for bank\n");
- return -ENOENT;
- }
-
- bank->reg_base = devm_ioremap_resource(bank->dev, &res);
+ bank->reg_base = devm_platform_ioremap_resource(pdev, 0);
if (IS_ERR(bank->reg_base))
return PTR_ERR(bank->reg_base);