[<prev] [next>] [day] [month] [year] [list]
Message-ID: <20240828084810.2526847-1-ruanjinjie@huawei.com>
Date: Wed, 28 Aug 2024 16:48:10 +0800
From: Jinjie Ruan <ruanjinjie@...wei.com>
To: <rjui@...adcom.com>, <sbranden@...adcom.com>,
<bcm-kernel-feedback-list@...adcom.com>, <linus.walleij@...aro.org>,
<linux-arm-kernel@...ts.infradead.org>, <linux-gpio@...r.kernel.org>,
<linux-kernel@...r.kernel.org>
CC: <ruanjinjie@...wei.com>
Subject: [PATCH -next] pinctrl: bcm: Use devm_platform_ioremap_resource_byname()
platform_get_resource_byname() and devm_ioremap_resource() can be
replaced by devm_platform_ioremap_resource_byname(), which can
simplify the code logic a bit, No functional change here.
Signed-off-by: Jinjie Ruan <ruanjinjie@...wei.com>
---
drivers/pinctrl/bcm/pinctrl-ns.c | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/drivers/pinctrl/bcm/pinctrl-ns.c b/drivers/pinctrl/bcm/pinctrl-ns.c
index 6bb2b461950b..bacc1a00506d 100644
--- a/drivers/pinctrl/bcm/pinctrl-ns.c
+++ b/drivers/pinctrl/bcm/pinctrl-ns.c
@@ -211,7 +211,6 @@ static int ns_pinctrl_probe(struct platform_device *pdev)
struct ns_pinctrl *ns_pinctrl;
struct pinctrl_desc *pctldesc;
struct pinctrl_pin_desc *pin;
- struct resource *res;
int i;
ns_pinctrl = devm_kzalloc(dev, sizeof(*ns_pinctrl), GFP_KERNEL);
@@ -226,9 +225,8 @@ static int ns_pinctrl_probe(struct platform_device *pdev)
ns_pinctrl->chipset_flag = (uintptr_t)device_get_match_data(dev);
- res = platform_get_resource_byname(pdev, IORESOURCE_MEM,
- "cru_gpio_control");
- ns_pinctrl->base = devm_ioremap_resource(dev, res);
+ ns_pinctrl->base = devm_platform_ioremap_resource_byname(pdev,
+ "cru_gpio_control");
if (IS_ERR(ns_pinctrl->base))
return PTR_ERR(ns_pinctrl->base);
--
2.34.1
Powered by blists - more mailing lists