diff mbox series

[6/6] soc: qcom: rpmh-rsc: Make use of the helper function devm_platform_ioremap_resource_byname()

Message ID 20210908070930.214-6-caihuoqing@baidu.com (mailing list archive)
State Superseded
Headers show
Series [1/6] PM: AVS: qcom-cpr: Make use of the helper function devm_platform_ioremap_resource() | expand

Commit Message

Cai,Huoqing Sept. 8, 2021, 7:09 a.m. UTC
Use the devm_platform_ioremap_resource_byname() helper instead of
calling platform_get_resource_byname() and devm_ioremap_resource()
separately

Signed-off-by: Cai Huoqing <caihuoqing@baidu.com>
---
 drivers/soc/qcom/rpmh-rsc.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

Comments

Steev Klimaszewski Sept. 8, 2021, 7:35 a.m. UTC | #1
On 9/8/21 2:09 AM, Cai Huoqing wrote:
> Use the devm_platform_ioremap_resource_byname() helper instead of
> calling platform_get_resource_byname() and devm_ioremap_resource()
> separately
>
> Signed-off-by: Cai Huoqing <caihuoqing@baidu.com>
> ---
>  drivers/soc/qcom/rpmh-rsc.c | 4 +---
>  1 file changed, 1 insertion(+), 3 deletions(-)
>
> diff --git a/drivers/soc/qcom/rpmh-rsc.c b/drivers/soc/qcom/rpmh-rsc.c
> index e749a2b285d8..2834c6efc16b 100644
> --- a/drivers/soc/qcom/rpmh-rsc.c
> +++ b/drivers/soc/qcom/rpmh-rsc.c
> @@ -910,7 +910,6 @@ static int rpmh_rsc_probe(struct platform_device *pdev)
>  {
>  	struct device_node *dn = pdev->dev.of_node;
>  	struct rsc_drv *drv;
> -	struct resource *res;
>  	char drv_id[10] = {0};
>  	int ret, irq;
>  	u32 solver_config;
> @@ -941,8 +940,7 @@ static int rpmh_rsc_probe(struct platform_device *pdev)
>  		drv->name = dev_name(&pdev->dev);
>  
>  	snprintf(drv_id, ARRAY_SIZE(drv_id), "drv-%d", drv->id);
> -	res = platform_get_resource_byname(pdev, IORESOURCE_MEM, drv_id);
> -	base = devm_ioremap_resource(&pdev->dev, res);
> +	base = devm_platform_ioremap_resource_byname(pdev, dri_id);

dri_id -> drv_id no?


>  	if (IS_ERR(base))
>  		return PTR_ERR(base);
>
diff mbox series

Patch

diff --git a/drivers/soc/qcom/rpmh-rsc.c b/drivers/soc/qcom/rpmh-rsc.c
index e749a2b285d8..2834c6efc16b 100644
--- a/drivers/soc/qcom/rpmh-rsc.c
+++ b/drivers/soc/qcom/rpmh-rsc.c
@@ -910,7 +910,6 @@  static int rpmh_rsc_probe(struct platform_device *pdev)
 {
 	struct device_node *dn = pdev->dev.of_node;
 	struct rsc_drv *drv;
-	struct resource *res;
 	char drv_id[10] = {0};
 	int ret, irq;
 	u32 solver_config;
@@ -941,8 +940,7 @@  static int rpmh_rsc_probe(struct platform_device *pdev)
 		drv->name = dev_name(&pdev->dev);
 
 	snprintf(drv_id, ARRAY_SIZE(drv_id), "drv-%d", drv->id);
-	res = platform_get_resource_byname(pdev, IORESOURCE_MEM, drv_id);
-	base = devm_ioremap_resource(&pdev->dev, res);
+	base = devm_platform_ioremap_resource_byname(pdev, dri_id);
 	if (IS_ERR(base))
 		return PTR_ERR(base);