linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2 1/6] PM: AVS: qcom-cpr: Make use of the helper function devm_platform_ioremap_resource()
@ 2021-09-08  7:46 Cai Huoqing
  2021-09-08  7:46 ` [PATCH v2 2/6] soc: qcom: ocmem: Make use of the helper function devm_platform_ioremap_resource_byname() Cai Huoqing
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Cai Huoqing @ 2021-09-08  7:46 UTC (permalink / raw)
  To: caihuoqing
  Cc: Niklas Cassel, Andy Gross, Bjorn Andersson, linux-pm,
	linux-arm-msm, linux-kernel

Use the devm_platform_ioremap_resource() helper instead of
calling platform_get_resource() and devm_ioremap_resource()
separately

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

diff --git a/drivers/soc/qcom/cpr.c b/drivers/soc/qcom/cpr.c
index 4ce8e816154f..1d818a8ba208 100644
--- a/drivers/soc/qcom/cpr.c
+++ b/drivers/soc/qcom/cpr.c
@@ -1614,7 +1614,6 @@ static void cpr_debugfs_init(struct cpr_drv *drv)
 
 static int cpr_probe(struct platform_device *pdev)
 {
-	struct resource *res;
 	struct device *dev = &pdev->dev;
 	struct cpr_drv *drv;
 	int irq, ret;
@@ -1648,8 +1647,7 @@ static int cpr_probe(struct platform_device *pdev)
 	if (IS_ERR(drv->tcsr))
 		return PTR_ERR(drv->tcsr);
 
-	res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
-	drv->base = devm_ioremap_resource(dev, res);
+	drv->base = devm_platform_ioremap_resource(pdev, 0);
 	if (IS_ERR(drv->base))
 		return PTR_ERR(drv->base);
 
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [PATCH v2 2/6] soc: qcom: ocmem: Make use of the helper function devm_platform_ioremap_resource_byname()
  2021-09-08  7:46 [PATCH v2 1/6] PM: AVS: qcom-cpr: Make use of the helper function devm_platform_ioremap_resource() Cai Huoqing
@ 2021-09-08  7:46 ` Cai Huoqing
  2021-09-08  7:46 ` [PATCH v2 3/6] soc: qcom-geni-se: Make use of the helper function devm_platform_ioremap_resource() Cai Huoqing
  2021-09-08  7:46 ` [PATCH v2 6/6] soc: qcom: rpmh-rsc: Make use of the helper function devm_platform_ioremap_resource_byname() Cai Huoqing
  2 siblings, 0 replies; 4+ messages in thread
From: Cai Huoqing @ 2021-09-08  7:46 UTC (permalink / raw)
  To: caihuoqing
  Cc: Niklas Cassel, Andy Gross, Bjorn Andersson, linux-pm,
	linux-arm-msm, linux-kernel

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/ocmem.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/drivers/soc/qcom/ocmem.c b/drivers/soc/qcom/ocmem.c
index f1875dc31ae2..d2dacbbaafbd 100644
--- a/drivers/soc/qcom/ocmem.c
+++ b/drivers/soc/qcom/ocmem.c
@@ -300,7 +300,6 @@ static int ocmem_dev_probe(struct platform_device *pdev)
 	struct device *dev = &pdev->dev;
 	unsigned long reg, region_size;
 	int i, j, ret, num_banks;
-	struct resource *res;
 	struct ocmem *ocmem;
 
 	if (!qcom_scm_is_available())
@@ -321,8 +320,7 @@ static int ocmem_dev_probe(struct platform_device *pdev)
 		return ret;
 	}
 
-	res = platform_get_resource_byname(pdev, IORESOURCE_MEM, "ctrl");
-	ocmem->mmio = devm_ioremap_resource(&pdev->dev, res);
+	ocmem->mmio = devm_platform_ioremap_resource_byname(pdev, "ctrl");
 	if (IS_ERR(ocmem->mmio)) {
 		dev_err(&pdev->dev, "Failed to ioremap ocmem_ctrl resource\n");
 		return PTR_ERR(ocmem->mmio);
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [PATCH v2 3/6] soc: qcom-geni-se: Make use of the helper function devm_platform_ioremap_resource()
  2021-09-08  7:46 [PATCH v2 1/6] PM: AVS: qcom-cpr: Make use of the helper function devm_platform_ioremap_resource() Cai Huoqing
  2021-09-08  7:46 ` [PATCH v2 2/6] soc: qcom: ocmem: Make use of the helper function devm_platform_ioremap_resource_byname() Cai Huoqing
@ 2021-09-08  7:46 ` Cai Huoqing
  2021-09-08  7:46 ` [PATCH v2 6/6] soc: qcom: rpmh-rsc: Make use of the helper function devm_platform_ioremap_resource_byname() Cai Huoqing
  2 siblings, 0 replies; 4+ messages in thread
From: Cai Huoqing @ 2021-09-08  7:46 UTC (permalink / raw)
  To: caihuoqing
  Cc: Niklas Cassel, Andy Gross, Bjorn Andersson, linux-pm,
	linux-arm-msm, linux-kernel

Use the devm_platform_ioremap_resource() helper instead of
calling platform_get_resource() and devm_ioremap_resource()
separately

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

diff --git a/drivers/soc/qcom/qcom-geni-se.c b/drivers/soc/qcom/qcom-geni-se.c
index 7d649d2cf31e..28a8c0dda66c 100644
--- a/drivers/soc/qcom/qcom-geni-se.c
+++ b/drivers/soc/qcom/qcom-geni-se.c
@@ -871,7 +871,6 @@ EXPORT_SYMBOL(geni_icc_disable);
 static int geni_se_probe(struct platform_device *pdev)
 {
 	struct device *dev = &pdev->dev;
-	struct resource *res;
 	struct geni_wrapper *wrapper;
 	int ret;
 
@@ -880,8 +879,7 @@ static int geni_se_probe(struct platform_device *pdev)
 		return -ENOMEM;
 
 	wrapper->dev = dev;
-	res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
-	wrapper->base = devm_ioremap_resource(dev, res);
+	wrapper->base = devm_platform_ioremap_resource(pdev, 0);
 	if (IS_ERR(wrapper->base))
 		return PTR_ERR(wrapper->base);
 
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [PATCH v2 6/6] soc: qcom: rpmh-rsc: Make use of the helper function devm_platform_ioremap_resource_byname()
  2021-09-08  7:46 [PATCH v2 1/6] PM: AVS: qcom-cpr: Make use of the helper function devm_platform_ioremap_resource() Cai Huoqing
  2021-09-08  7:46 ` [PATCH v2 2/6] soc: qcom: ocmem: Make use of the helper function devm_platform_ioremap_resource_byname() Cai Huoqing
  2021-09-08  7:46 ` [PATCH v2 3/6] soc: qcom-geni-se: Make use of the helper function devm_platform_ioremap_resource() Cai Huoqing
@ 2021-09-08  7:46 ` Cai Huoqing
  2 siblings, 0 replies; 4+ messages in thread
From: Cai Huoqing @ 2021-09-08  7:46 UTC (permalink / raw)
  To: caihuoqing
  Cc: Niklas Cassel, Andy Gross, Bjorn Andersson, linux-pm,
	linux-arm-msm, linux-kernel

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>
---
v1->v2: Fix typo 'dri_id'->'drv_id'
 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, drv_id);
 	if (IS_ERR(base))
 		return PTR_ERR(base);
 
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2021-09-08  7:47 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-09-08  7:46 [PATCH v2 1/6] PM: AVS: qcom-cpr: Make use of the helper function devm_platform_ioremap_resource() Cai Huoqing
2021-09-08  7:46 ` [PATCH v2 2/6] soc: qcom: ocmem: Make use of the helper function devm_platform_ioremap_resource_byname() Cai Huoqing
2021-09-08  7:46 ` [PATCH v2 3/6] soc: qcom-geni-se: Make use of the helper function devm_platform_ioremap_resource() Cai Huoqing
2021-09-08  7:46 ` [PATCH v2 6/6] soc: qcom: rpmh-rsc: Make use of the helper function devm_platform_ioremap_resource_byname() Cai Huoqing

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).