diff mbox series

[-next] pinctrl: bcm: Use devm_platform_ioremap_resource_byname()

Message ID 20240828084810.2526847-1-ruanjinjie@huawei.com
State New
Headers show
Series [-next] pinctrl: bcm: Use devm_platform_ioremap_resource_byname() | expand

Commit Message

Jinjie Ruan Aug. 28, 2024, 8:48 a.m. UTC
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@huawei.com>
---
 drivers/pinctrl/bcm/pinctrl-ns.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)
diff mbox series

Patch

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);