* [PATCH 1/3] soc: ti: k3-ringacc: Make use of the helper function devm_platform_ioremap_resource_byname()
@ 2021-09-08 7:13 Cai Huoqing
2021-09-08 7:13 ` [PATCH 2/3] soc: ti: smartreflex: Make use of the helper function devm_platform_ioremap_resource() Cai Huoqing
` (2 more replies)
0 siblings, 3 replies; 4+ messages in thread
From: Cai Huoqing @ 2021-09-08 7:13 UTC (permalink / raw)
To: caihuoqing
Cc: Santosh Shilimkar, Nishanth Menon, linux-kernel,
linux-arm-kernel, linux-pm
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/ti/k3-ringacc.c | 18 +++++-------------
1 file changed, 5 insertions(+), 13 deletions(-)
diff --git a/drivers/soc/ti/k3-ringacc.c b/drivers/soc/ti/k3-ringacc.c
index 573be88f8191..0474257735f3 100644
--- a/drivers/soc/ti/k3-ringacc.c
+++ b/drivers/soc/ti/k3-ringacc.c
@@ -1353,7 +1353,6 @@ static int k3_ringacc_init(struct platform_device *pdev,
const struct soc_device_attribute *soc;
void __iomem *base_fifo, *base_rt;
struct device *dev = &pdev->dev;
- struct resource *res;
int ret, i;
dev->msi_domain = of_msi_get_domain(dev, dev->of_node,
@@ -1374,24 +1373,19 @@ static int k3_ringacc_init(struct platform_device *pdev,
ringacc->dma_ring_reset_quirk = soc_data->dma_ring_reset_quirk;
}
- res = platform_get_resource_byname(pdev, IORESOURCE_MEM, "rt");
- base_rt = devm_ioremap_resource(dev, res);
+ base_rt = devm_platform_ioremap_resource_byname(pdev, "rt");
if (IS_ERR(base_rt))
return PTR_ERR(base_rt);
- res = platform_get_resource_byname(pdev, IORESOURCE_MEM, "fifos");
- base_fifo = devm_ioremap_resource(dev, res);
+ base_fifo = devm_platform_ioremap_resource_byname(pdev, "fifos");
if (IS_ERR(base_fifo))
return PTR_ERR(base_fifo);
- res = platform_get_resource_byname(pdev, IORESOURCE_MEM, "proxy_gcfg");
- ringacc->proxy_gcfg = devm_ioremap_resource(dev, res);
+ ringacc->proxy_gcfg = devm_platform_ioremap_resource_byname(pdev, "proxy_gcfg");
if (IS_ERR(ringacc->proxy_gcfg))
return PTR_ERR(ringacc->proxy_gcfg);
- res = platform_get_resource_byname(pdev, IORESOURCE_MEM,
- "proxy_target");
- ringacc->proxy_target_base = devm_ioremap_resource(dev, res);
+ ringacc->proxy_target_base = devm_platform_ioremap_resource_byname(pdev, "proxy_target");
if (IS_ERR(ringacc->proxy_target_base))
return PTR_ERR(ringacc->proxy_target_base);
@@ -1459,7 +1453,6 @@ struct k3_ringacc *k3_ringacc_dmarings_init(struct platform_device *pdev,
struct device *dev = &pdev->dev;
struct k3_ringacc *ringacc;
void __iomem *base_rt;
- struct resource *res;
int i;
ringacc = devm_kzalloc(dev, sizeof(*ringacc), GFP_KERNEL);
@@ -1474,8 +1467,7 @@ struct k3_ringacc *k3_ringacc_dmarings_init(struct platform_device *pdev,
mutex_init(&ringacc->req_lock);
- res = platform_get_resource_byname(pdev, IORESOURCE_MEM, "ringrt");
- base_rt = devm_ioremap_resource(dev, res);
+ base_rt = devm_platform_ioremap_resource_byname(pdev, "ringrt");
if (IS_ERR(base_rt))
return ERR_CAST(base_rt);
--
2.25.1
^ permalink raw reply related [flat|nested] 4+ messages in thread
* [PATCH 2/3] soc: ti: smartreflex: Make use of the helper function devm_platform_ioremap_resource()
2021-09-08 7:13 [PATCH 1/3] soc: ti: k3-ringacc: Make use of the helper function devm_platform_ioremap_resource_byname() Cai Huoqing
@ 2021-09-08 7:13 ` Cai Huoqing
2021-09-08 7:13 ` [PATCH 3/3] soc: ti: wkup_m3_ipc: " Cai Huoqing
2021-09-08 9:51 ` [PATCH 1/3] soc: ti: k3-ringacc: Make use of the helper function devm_platform_ioremap_resource_byname() Grygorii Strashko
2 siblings, 0 replies; 4+ messages in thread
From: Cai Huoqing @ 2021-09-08 7:13 UTC (permalink / raw)
To: caihuoqing
Cc: Santosh Shilimkar, Nishanth Menon, linux-kernel,
linux-arm-kernel, linux-pm
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/ti/smartreflex.c | 5 ++---
1 file changed, 2 insertions(+), 3 deletions(-)
diff --git a/drivers/soc/ti/smartreflex.c b/drivers/soc/ti/smartreflex.c
index b5b2fa538d5c..fabbc9f16a3e 100644
--- a/drivers/soc/ti/smartreflex.c
+++ b/drivers/soc/ti/smartreflex.c
@@ -819,7 +819,7 @@ static int omap_sr_probe(struct platform_device *pdev)
{
struct omap_sr *sr_info;
struct omap_sr_data *pdata = pdev->dev.platform_data;
- struct resource *mem, *irq;
+ struct resource *irq;
struct dentry *nvalue_dir;
int i, ret = 0;
@@ -839,8 +839,7 @@ static int omap_sr_probe(struct platform_device *pdev)
return -EINVAL;
}
- mem = platform_get_resource(pdev, IORESOURCE_MEM, 0);
- sr_info->base = devm_ioremap_resource(&pdev->dev, mem);
+ sr_info->base = devm_platform_ioremap_resource(pdev, 0);
if (IS_ERR(sr_info->base))
return PTR_ERR(sr_info->base);
--
2.25.1
^ permalink raw reply related [flat|nested] 4+ messages in thread
* [PATCH 3/3] soc: ti: wkup_m3_ipc: Make use of the helper function devm_platform_ioremap_resource()
2021-09-08 7:13 [PATCH 1/3] soc: ti: k3-ringacc: Make use of the helper function devm_platform_ioremap_resource_byname() Cai Huoqing
2021-09-08 7:13 ` [PATCH 2/3] soc: ti: smartreflex: Make use of the helper function devm_platform_ioremap_resource() Cai Huoqing
@ 2021-09-08 7:13 ` Cai Huoqing
2021-09-08 9:51 ` [PATCH 1/3] soc: ti: k3-ringacc: Make use of the helper function devm_platform_ioremap_resource_byname() Grygorii Strashko
2 siblings, 0 replies; 4+ messages in thread
From: Cai Huoqing @ 2021-09-08 7:13 UTC (permalink / raw)
To: caihuoqing
Cc: Santosh Shilimkar, Nishanth Menon, linux-kernel,
linux-arm-kernel, linux-pm
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/ti/wkup_m3_ipc.c | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)
diff --git a/drivers/soc/ti/wkup_m3_ipc.c b/drivers/soc/ti/wkup_m3_ipc.c
index 09abd17065ba..388ffbee30a1 100644
--- a/drivers/soc/ti/wkup_m3_ipc.c
+++ b/drivers/soc/ti/wkup_m3_ipc.c
@@ -435,7 +435,6 @@ static int wkup_m3_ipc_probe(struct platform_device *pdev)
int irq, ret;
phandle rproc_phandle;
struct rproc *m3_rproc;
- struct resource *res;
struct task_struct *task;
struct wkup_m3_ipc *m3_ipc;
@@ -443,8 +442,7 @@ static int wkup_m3_ipc_probe(struct platform_device *pdev)
if (!m3_ipc)
return -ENOMEM;
- res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
- m3_ipc->ipc_mem_base = devm_ioremap_resource(dev, res);
+ m3_ipc->ipc_mem_base = devm_platform_ioremap_resource(pdev, 0);
if (IS_ERR(m3_ipc->ipc_mem_base))
return PTR_ERR(m3_ipc->ipc_mem_base);
--
2.25.1
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH 1/3] soc: ti: k3-ringacc: Make use of the helper function devm_platform_ioremap_resource_byname()
2021-09-08 7:13 [PATCH 1/3] soc: ti: k3-ringacc: Make use of the helper function devm_platform_ioremap_resource_byname() Cai Huoqing
2021-09-08 7:13 ` [PATCH 2/3] soc: ti: smartreflex: Make use of the helper function devm_platform_ioremap_resource() Cai Huoqing
2021-09-08 7:13 ` [PATCH 3/3] soc: ti: wkup_m3_ipc: " Cai Huoqing
@ 2021-09-08 9:51 ` Grygorii Strashko
2 siblings, 0 replies; 4+ messages in thread
From: Grygorii Strashko @ 2021-09-08 9:51 UTC (permalink / raw)
To: Cai Huoqing, Peter Ujfalusi
Cc: Santosh Shilimkar, Nishanth Menon, linux-kernel,
linux-arm-kernel, linux-pm
On 08/09/2021 10:13, 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/ti/k3-ringacc.c | 18 +++++-------------
> 1 file changed, 5 insertions(+), 13 deletions(-)
Thank you.
Reviewed-by: Grygorii Strashko <grygorii.strashko@ti.com>
--
Best regards,
grygorii
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2021-09-08 9:52 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:13 [PATCH 1/3] soc: ti: k3-ringacc: Make use of the helper function devm_platform_ioremap_resource_byname() Cai Huoqing
2021-09-08 7:13 ` [PATCH 2/3] soc: ti: smartreflex: Make use of the helper function devm_platform_ioremap_resource() Cai Huoqing
2021-09-08 7:13 ` [PATCH 3/3] soc: ti: wkup_m3_ipc: " Cai Huoqing
2021-09-08 9:51 ` [PATCH 1/3] soc: ti: k3-ringacc: Make use of the helper function devm_platform_ioremap_resource_byname() Grygorii Strashko
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).