diff mbox series

bus: qcom-ssc-block-bus: Use devm_platform_ioremap_resource_byname

Message ID 20250402193522517tlQ-zKtbUFsLKAMwRTF6-@zte.com.cn (mailing list archive)
State New
Headers show
Series bus: qcom-ssc-block-bus: Use devm_platform_ioremap_resource_byname | expand

Commit Message

shao.mingyin@zte.com.cn April 2, 2025, 11:35 a.m. UTC
From: Xie Ludan <xie.ludan@zte.com.cn>

Introduce devm_platform_ioremap_resource_byname() to simplify resource
retrieval and mapping.This new function consolidates
platform_get_resource_byname() and devm_ioremap_resource() into a single
call, improving code readability and reducing API call overhead.

Signed-off-by: Xie Ludan <xie.ludan@zte.com.cn>
Signed-off-by: Shao Mingyin <shao.mingyin@zte.com.cn>
---
 drivers/bus/qcom-ssc-block-bus.c | 9 ++++-----
 1 file changed, 4 insertions(+), 5 deletions(-)
diff mbox series

Patch

diff --git a/drivers/bus/qcom-ssc-block-bus.c b/drivers/bus/qcom-ssc-block-bus.c
index 7f5fd4e0940d..c542ef8ae4a6 100644
--- a/drivers/bus/qcom-ssc-block-bus.c
+++ b/drivers/bus/qcom-ssc-block-bus.c
@@ -255,7 +255,6 @@  static int qcom_ssc_block_bus_probe(struct platform_device *pdev)
 	struct qcom_ssc_block_bus_data *data;
 	struct device_node *np = pdev->dev.of_node;
 	struct of_phandle_args halt_args;
-	struct resource *res;
 	int ret;

 	data = devm_kzalloc(&pdev->dev, sizeof(*data), GFP_KERNEL);
@@ -265,14 +264,14 @@  static int qcom_ssc_block_bus_probe(struct platform_device *pdev)
 	platform_set_drvdata(pdev, data);

 	/* low level overrides for when the HW logic doesn't "just work" */
-	res = platform_get_resource_byname(pdev, IORESOURCE_MEM, "mpm_sscaon_config0");
-	data->reg_mpm_sscaon_config0 = devm_ioremap_resource(&pdev->dev, res);
+	data->reg_mpm_sscaon_config0 = devm_platform_ioremap_resource_byname(pdev,
+																		 "mpm_sscaon_config0");
 	if (IS_ERR(data->reg_mpm_sscaon_config0))
 		return dev_err_probe(&pdev->dev, PTR_ERR(data->reg_mpm_sscaon_config0),
 				     "Failed to ioremap mpm_sscaon_config0\n");

-	res = platform_get_resource_byname(pdev, IORESOURCE_MEM, "mpm_sscaon_config1");
-	data->reg_mpm_sscaon_config1 = devm_ioremap_resource(&pdev->dev, res);
+	data->reg_mpm_sscaon_config1 = devm_platform_ioremap_resource_byname(pdev,
+																		 "mpm_sscaon_config1");
 	if (IS_ERR(data->reg_mpm_sscaon_config1))
 		return dev_err_probe(&pdev->dev, PTR_ERR(data->reg_mpm_sscaon_config1),
 				     "Failed to ioremap mpm_sscaon_config1\n");