linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/2] soc: fsl: guts: Make use of the helper function devm_platform_ioremap_resource()
@ 2021-09-08  7:16 Cai Huoqing
  2021-09-08  7:16 ` [PATCH 2/2] soc: fsl: rcpm: " Cai Huoqing
  2021-10-22  0:34 ` [PATCH 1/2] soc: fsl: guts: " Li Yang
  0 siblings, 2 replies; 4+ messages in thread
From: Cai Huoqing @ 2021-09-08  7:16 UTC (permalink / raw)
  To: caihuoqing; +Cc: Li Yang, linuxppc-dev, linux-arm-kernel, 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/fsl/guts.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/drivers/soc/fsl/guts.c b/drivers/soc/fsl/guts.c
index d5e9a5f2c087..072473a16f4d 100644
--- a/drivers/soc/fsl/guts.c
+++ b/drivers/soc/fsl/guts.c
@@ -140,7 +140,6 @@ static int fsl_guts_probe(struct platform_device *pdev)
 {
 	struct device_node *np = pdev->dev.of_node;
 	struct device *dev = &pdev->dev;
-	struct resource *res;
 	const struct fsl_soc_die_attr *soc_die;
 	const char *machine;
 	u32 svr;
@@ -152,8 +151,7 @@ static int fsl_guts_probe(struct platform_device *pdev)
 
 	guts->little_endian = of_property_read_bool(np, "little-endian");
 
-	res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
-	guts->regs = devm_ioremap_resource(dev, res);
+	guts->regs = devm_platform_ioremap_resource(pdev, 0);
 	if (IS_ERR(guts->regs))
 		return PTR_ERR(guts->regs);
 
-- 
2.25.1


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

* [PATCH 2/2] soc: fsl: rcpm: Make use of the helper function devm_platform_ioremap_resource()
  2021-09-08  7:16 [PATCH 1/2] soc: fsl: guts: Make use of the helper function devm_platform_ioremap_resource() Cai Huoqing
@ 2021-09-08  7:16 ` Cai Huoqing
  2021-10-22  0:37   ` Li Yang
  2021-10-22  0:34 ` [PATCH 1/2] soc: fsl: guts: " Li Yang
  1 sibling, 1 reply; 4+ messages in thread
From: Cai Huoqing @ 2021-09-08  7:16 UTC (permalink / raw)
  To: caihuoqing; +Cc: Li Yang, linuxppc-dev, linux-arm-kernel, 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/fsl/rcpm.c | 7 +------
 1 file changed, 1 insertion(+), 6 deletions(-)

diff --git a/drivers/soc/fsl/rcpm.c b/drivers/soc/fsl/rcpm.c
index 90d3f4060b0c..3d0cae30c769 100644
--- a/drivers/soc/fsl/rcpm.c
+++ b/drivers/soc/fsl/rcpm.c
@@ -146,7 +146,6 @@ static const struct dev_pm_ops rcpm_pm_ops = {
 static int rcpm_probe(struct platform_device *pdev)
 {
 	struct device	*dev = &pdev->dev;
-	struct resource *r;
 	struct rcpm	*rcpm;
 	int ret;
 
@@ -154,11 +153,7 @@ static int rcpm_probe(struct platform_device *pdev)
 	if (!rcpm)
 		return -ENOMEM;
 
-	r = platform_get_resource(pdev, IORESOURCE_MEM, 0);
-	if (!r)
-		return -ENODEV;
-
-	rcpm->ippdexpcr_base = devm_ioremap_resource(&pdev->dev, r);
+	rcpm->ippdexpcr_base = devm_platform_ioremap_resource(pdev, 0);
 	if (IS_ERR(rcpm->ippdexpcr_base)) {
 		ret =  PTR_ERR(rcpm->ippdexpcr_base);
 		return ret;
-- 
2.25.1


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

* Re: [PATCH 1/2] soc: fsl: guts: Make use of the helper function devm_platform_ioremap_resource()
  2021-09-08  7:16 [PATCH 1/2] soc: fsl: guts: Make use of the helper function devm_platform_ioremap_resource() Cai Huoqing
  2021-09-08  7:16 ` [PATCH 2/2] soc: fsl: rcpm: " Cai Huoqing
@ 2021-10-22  0:34 ` Li Yang
  1 sibling, 0 replies; 4+ messages in thread
From: Li Yang @ 2021-10-22  0:34 UTC (permalink / raw)
  To: Cai Huoqing
  Cc: linuxppc-dev, lkml,
	moderated list:ARM/FREESCALE IMX / MXC ARM ARCHITECTURE

On Wed, Sep 8, 2021 at 2:19 AM Cai Huoqing <caihuoqing@baidu.com> wrote:
>
> 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>

Applied for next.  Thanks.

> ---
>  drivers/soc/fsl/guts.c | 4 +---
>  1 file changed, 1 insertion(+), 3 deletions(-)
>
> diff --git a/drivers/soc/fsl/guts.c b/drivers/soc/fsl/guts.c
> index d5e9a5f2c087..072473a16f4d 100644
> --- a/drivers/soc/fsl/guts.c
> +++ b/drivers/soc/fsl/guts.c
> @@ -140,7 +140,6 @@ static int fsl_guts_probe(struct platform_device *pdev)
>  {
>         struct device_node *np = pdev->dev.of_node;
>         struct device *dev = &pdev->dev;
> -       struct resource *res;
>         const struct fsl_soc_die_attr *soc_die;
>         const char *machine;
>         u32 svr;
> @@ -152,8 +151,7 @@ static int fsl_guts_probe(struct platform_device *pdev)
>
>         guts->little_endian = of_property_read_bool(np, "little-endian");
>
> -       res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
> -       guts->regs = devm_ioremap_resource(dev, res);
> +       guts->regs = devm_platform_ioremap_resource(pdev, 0);
>         if (IS_ERR(guts->regs))
>                 return PTR_ERR(guts->regs);
>
> --
> 2.25.1
>

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

* Re: [PATCH 2/2] soc: fsl: rcpm: Make use of the helper function devm_platform_ioremap_resource()
  2021-09-08  7:16 ` [PATCH 2/2] soc: fsl: rcpm: " Cai Huoqing
@ 2021-10-22  0:37   ` Li Yang
  0 siblings, 0 replies; 4+ messages in thread
From: Li Yang @ 2021-10-22  0:37 UTC (permalink / raw)
  To: Cai Huoqing
  Cc: linuxppc-dev, lkml,
	moderated list:ARM/FREESCALE IMX / MXC ARM ARCHITECTURE

On Wed, Sep 8, 2021 at 2:20 AM Cai Huoqing <caihuoqing@baidu.com> wrote:
>
> 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>

Applied for next.  Thanks.

> ---
>  drivers/soc/fsl/rcpm.c | 7 +------
>  1 file changed, 1 insertion(+), 6 deletions(-)
>
> diff --git a/drivers/soc/fsl/rcpm.c b/drivers/soc/fsl/rcpm.c
> index 90d3f4060b0c..3d0cae30c769 100644
> --- a/drivers/soc/fsl/rcpm.c
> +++ b/drivers/soc/fsl/rcpm.c
> @@ -146,7 +146,6 @@ static const struct dev_pm_ops rcpm_pm_ops = {
>  static int rcpm_probe(struct platform_device *pdev)
>  {
>         struct device   *dev = &pdev->dev;
> -       struct resource *r;
>         struct rcpm     *rcpm;
>         int ret;
>
> @@ -154,11 +153,7 @@ static int rcpm_probe(struct platform_device *pdev)
>         if (!rcpm)
>                 return -ENOMEM;
>
> -       r = platform_get_resource(pdev, IORESOURCE_MEM, 0);
> -       if (!r)
> -               return -ENODEV;
> -
> -       rcpm->ippdexpcr_base = devm_ioremap_resource(&pdev->dev, r);
> +       rcpm->ippdexpcr_base = devm_platform_ioremap_resource(pdev, 0);
>         if (IS_ERR(rcpm->ippdexpcr_base)) {
>                 ret =  PTR_ERR(rcpm->ippdexpcr_base);
>                 return ret;
> --
> 2.25.1
>

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

end of thread, other threads:[~2021-10-22  0:37 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:16 [PATCH 1/2] soc: fsl: guts: Make use of the helper function devm_platform_ioremap_resource() Cai Huoqing
2021-09-08  7:16 ` [PATCH 2/2] soc: fsl: rcpm: " Cai Huoqing
2021-10-22  0:37   ` Li Yang
2021-10-22  0:34 ` [PATCH 1/2] soc: fsl: guts: " Li Yang

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