All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] mtd: rawnand: atmel: Make use of the helper function devm_platform_ioremap_resource()
@ 2021-09-01  7:40 ` Cai Huoqing
  0 siblings, 0 replies; 9+ messages in thread
From: Cai Huoqing @ 2021-09-01  7:40 UTC (permalink / raw)
  To: caihuoqing
  Cc: Tudor Ambarus, Miquel Raynal, Richard Weinberger,
	Vignesh Raghavendra, Nicolas Ferre, Alexandre Belloni,
	Ludovic Desroches, linux-mtd, 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/mtd/nand/raw/atmel/pmecc.c | 7 ++-----
 1 file changed, 2 insertions(+), 5 deletions(-)

diff --git a/drivers/mtd/nand/raw/atmel/pmecc.c b/drivers/mtd/nand/raw/atmel/pmecc.c
index cbb023bf00f7..498e41ccabbd 100644
--- a/drivers/mtd/nand/raw/atmel/pmecc.c
+++ b/drivers/mtd/nand/raw/atmel/pmecc.c
@@ -834,7 +834,6 @@ static struct atmel_pmecc *atmel_pmecc_create(struct platform_device *pdev,
 {
 	struct device *dev = &pdev->dev;
 	struct atmel_pmecc *pmecc;
-	struct resource *res;
 
 	pmecc = devm_kzalloc(dev, sizeof(*pmecc), GFP_KERNEL);
 	if (!pmecc)
@@ -844,13 +843,11 @@ static struct atmel_pmecc *atmel_pmecc_create(struct platform_device *pdev,
 	pmecc->dev = dev;
 	mutex_init(&pmecc->lock);
 
-	res = platform_get_resource(pdev, IORESOURCE_MEM, pmecc_res_idx);
-	pmecc->regs.base = devm_ioremap_resource(dev, res);
+	pmecc->regs.base = devm_platform_ioremap_resource(pdev, pmecc_res_idx);
 	if (IS_ERR(pmecc->regs.base))
 		return ERR_CAST(pmecc->regs.base);
 
-	res = platform_get_resource(pdev, IORESOURCE_MEM, errloc_res_idx);
-	pmecc->regs.errloc = devm_ioremap_resource(dev, res);
+	pmecc->regs.errloc = devm_platform_ioremap_resource(pdev, errloc_res_idx);
 	if (IS_ERR(pmecc->regs.errloc))
 		return ERR_CAST(pmecc->regs.errloc);
 
-- 
2.25.1


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

* [PATCH] mtd: rawnand: atmel: Make use of the helper function devm_platform_ioremap_resource()
@ 2021-09-01  7:40 ` Cai Huoqing
  0 siblings, 0 replies; 9+ messages in thread
From: Cai Huoqing @ 2021-09-01  7:40 UTC (permalink / raw)
  To: caihuoqing
  Cc: Tudor Ambarus, Miquel Raynal, Richard Weinberger,
	Vignesh Raghavendra, Nicolas Ferre, Alexandre Belloni,
	Ludovic Desroches, linux-mtd, 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/mtd/nand/raw/atmel/pmecc.c | 7 ++-----
 1 file changed, 2 insertions(+), 5 deletions(-)

diff --git a/drivers/mtd/nand/raw/atmel/pmecc.c b/drivers/mtd/nand/raw/atmel/pmecc.c
index cbb023bf00f7..498e41ccabbd 100644
--- a/drivers/mtd/nand/raw/atmel/pmecc.c
+++ b/drivers/mtd/nand/raw/atmel/pmecc.c
@@ -834,7 +834,6 @@ static struct atmel_pmecc *atmel_pmecc_create(struct platform_device *pdev,
 {
 	struct device *dev = &pdev->dev;
 	struct atmel_pmecc *pmecc;
-	struct resource *res;
 
 	pmecc = devm_kzalloc(dev, sizeof(*pmecc), GFP_KERNEL);
 	if (!pmecc)
@@ -844,13 +843,11 @@ static struct atmel_pmecc *atmel_pmecc_create(struct platform_device *pdev,
 	pmecc->dev = dev;
 	mutex_init(&pmecc->lock);
 
-	res = platform_get_resource(pdev, IORESOURCE_MEM, pmecc_res_idx);
-	pmecc->regs.base = devm_ioremap_resource(dev, res);
+	pmecc->regs.base = devm_platform_ioremap_resource(pdev, pmecc_res_idx);
 	if (IS_ERR(pmecc->regs.base))
 		return ERR_CAST(pmecc->regs.base);
 
-	res = platform_get_resource(pdev, IORESOURCE_MEM, errloc_res_idx);
-	pmecc->regs.errloc = devm_ioremap_resource(dev, res);
+	pmecc->regs.errloc = devm_platform_ioremap_resource(pdev, errloc_res_idx);
 	if (IS_ERR(pmecc->regs.errloc))
 		return ERR_CAST(pmecc->regs.errloc);
 
-- 
2.25.1


______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/

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

* [PATCH] mtd: rawnand: atmel: Make use of the helper function devm_platform_ioremap_resource()
@ 2021-09-01  7:40 ` Cai Huoqing
  0 siblings, 0 replies; 9+ messages in thread
From: Cai Huoqing @ 2021-09-01  7:40 UTC (permalink / raw)
  To: caihuoqing
  Cc: Alexandre Belloni, Vignesh Raghavendra, Tudor Ambarus,
	Richard Weinberger, linux-kernel, Ludovic Desroches, linux-mtd,
	Miquel Raynal, linux-arm-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/mtd/nand/raw/atmel/pmecc.c | 7 ++-----
 1 file changed, 2 insertions(+), 5 deletions(-)

diff --git a/drivers/mtd/nand/raw/atmel/pmecc.c b/drivers/mtd/nand/raw/atmel/pmecc.c
index cbb023bf00f7..498e41ccabbd 100644
--- a/drivers/mtd/nand/raw/atmel/pmecc.c
+++ b/drivers/mtd/nand/raw/atmel/pmecc.c
@@ -834,7 +834,6 @@ static struct atmel_pmecc *atmel_pmecc_create(struct platform_device *pdev,
 {
 	struct device *dev = &pdev->dev;
 	struct atmel_pmecc *pmecc;
-	struct resource *res;
 
 	pmecc = devm_kzalloc(dev, sizeof(*pmecc), GFP_KERNEL);
 	if (!pmecc)
@@ -844,13 +843,11 @@ static struct atmel_pmecc *atmel_pmecc_create(struct platform_device *pdev,
 	pmecc->dev = dev;
 	mutex_init(&pmecc->lock);
 
-	res = platform_get_resource(pdev, IORESOURCE_MEM, pmecc_res_idx);
-	pmecc->regs.base = devm_ioremap_resource(dev, res);
+	pmecc->regs.base = devm_platform_ioremap_resource(pdev, pmecc_res_idx);
 	if (IS_ERR(pmecc->regs.base))
 		return ERR_CAST(pmecc->regs.base);
 
-	res = platform_get_resource(pdev, IORESOURCE_MEM, errloc_res_idx);
-	pmecc->regs.errloc = devm_ioremap_resource(dev, res);
+	pmecc->regs.errloc = devm_platform_ioremap_resource(pdev, errloc_res_idx);
 	if (IS_ERR(pmecc->regs.errloc))
 		return ERR_CAST(pmecc->regs.errloc);
 
-- 
2.25.1


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* Re: [PATCH] mtd: rawnand: atmel: Make use of the helper function devm_platform_ioremap_resource()
  2021-09-01  7:40 ` Cai Huoqing
  (?)
@ 2021-09-01  9:51   ` Nicolas Ferre
  -1 siblings, 0 replies; 9+ messages in thread
From: Nicolas Ferre @ 2021-09-01  9:51 UTC (permalink / raw)
  To: Cai Huoqing
  Cc: Tudor Ambarus, Miquel Raynal, Richard Weinberger,
	Vignesh Raghavendra, Alexandre Belloni, Ludovic Desroches,
	linux-mtd, linux-arm-kernel, linux-kernel

On 01/09/2021 at 09:40, Cai Huoqing 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>

Reviewed-by: Nicolas Ferre <nicolas.ferre@microchip.com>

> ---
>   drivers/mtd/nand/raw/atmel/pmecc.c | 7 ++-----
>   1 file changed, 2 insertions(+), 5 deletions(-)
> 
> diff --git a/drivers/mtd/nand/raw/atmel/pmecc.c b/drivers/mtd/nand/raw/atmel/pmecc.c
> index cbb023bf00f7..498e41ccabbd 100644
> --- a/drivers/mtd/nand/raw/atmel/pmecc.c
> +++ b/drivers/mtd/nand/raw/atmel/pmecc.c
> @@ -834,7 +834,6 @@ static struct atmel_pmecc *atmel_pmecc_create(struct platform_device *pdev,
>   {
>          struct device *dev = &pdev->dev;
>          struct atmel_pmecc *pmecc;
> -       struct resource *res;
> 
>          pmecc = devm_kzalloc(dev, sizeof(*pmecc), GFP_KERNEL);
>          if (!pmecc)
> @@ -844,13 +843,11 @@ static struct atmel_pmecc *atmel_pmecc_create(struct platform_device *pdev,
>          pmecc->dev = dev;
>          mutex_init(&pmecc->lock);
> 
> -       res = platform_get_resource(pdev, IORESOURCE_MEM, pmecc_res_idx);
> -       pmecc->regs.base = devm_ioremap_resource(dev, res);
> +       pmecc->regs.base = devm_platform_ioremap_resource(pdev, pmecc_res_idx);
>          if (IS_ERR(pmecc->regs.base))
>                  return ERR_CAST(pmecc->regs.base);
> 
> -       res = platform_get_resource(pdev, IORESOURCE_MEM, errloc_res_idx);
> -       pmecc->regs.errloc = devm_ioremap_resource(dev, res);
> +       pmecc->regs.errloc = devm_platform_ioremap_resource(pdev, errloc_res_idx);
>          if (IS_ERR(pmecc->regs.errloc))
>                  return ERR_CAST(pmecc->regs.errloc);
> 
> --
> 2.25.1
> 


-- 
Nicolas Ferre

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

* Re: [PATCH] mtd: rawnand: atmel: Make use of the helper function devm_platform_ioremap_resource()
@ 2021-09-01  9:51   ` Nicolas Ferre
  0 siblings, 0 replies; 9+ messages in thread
From: Nicolas Ferre @ 2021-09-01  9:51 UTC (permalink / raw)
  To: Cai Huoqing
  Cc: Tudor Ambarus, Miquel Raynal, Richard Weinberger,
	Vignesh Raghavendra, Alexandre Belloni, Ludovic Desroches,
	linux-mtd, linux-arm-kernel, linux-kernel

On 01/09/2021 at 09:40, Cai Huoqing 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>

Reviewed-by: Nicolas Ferre <nicolas.ferre@microchip.com>

> ---
>   drivers/mtd/nand/raw/atmel/pmecc.c | 7 ++-----
>   1 file changed, 2 insertions(+), 5 deletions(-)
> 
> diff --git a/drivers/mtd/nand/raw/atmel/pmecc.c b/drivers/mtd/nand/raw/atmel/pmecc.c
> index cbb023bf00f7..498e41ccabbd 100644
> --- a/drivers/mtd/nand/raw/atmel/pmecc.c
> +++ b/drivers/mtd/nand/raw/atmel/pmecc.c
> @@ -834,7 +834,6 @@ static struct atmel_pmecc *atmel_pmecc_create(struct platform_device *pdev,
>   {
>          struct device *dev = &pdev->dev;
>          struct atmel_pmecc *pmecc;
> -       struct resource *res;
> 
>          pmecc = devm_kzalloc(dev, sizeof(*pmecc), GFP_KERNEL);
>          if (!pmecc)
> @@ -844,13 +843,11 @@ static struct atmel_pmecc *atmel_pmecc_create(struct platform_device *pdev,
>          pmecc->dev = dev;
>          mutex_init(&pmecc->lock);
> 
> -       res = platform_get_resource(pdev, IORESOURCE_MEM, pmecc_res_idx);
> -       pmecc->regs.base = devm_ioremap_resource(dev, res);
> +       pmecc->regs.base = devm_platform_ioremap_resource(pdev, pmecc_res_idx);
>          if (IS_ERR(pmecc->regs.base))
>                  return ERR_CAST(pmecc->regs.base);
> 
> -       res = platform_get_resource(pdev, IORESOURCE_MEM, errloc_res_idx);
> -       pmecc->regs.errloc = devm_ioremap_resource(dev, res);
> +       pmecc->regs.errloc = devm_platform_ioremap_resource(pdev, errloc_res_idx);
>          if (IS_ERR(pmecc->regs.errloc))
>                  return ERR_CAST(pmecc->regs.errloc);
> 
> --
> 2.25.1
> 


-- 
Nicolas Ferre

______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/

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

* Re: [PATCH] mtd: rawnand: atmel: Make use of the helper function devm_platform_ioremap_resource()
@ 2021-09-01  9:51   ` Nicolas Ferre
  0 siblings, 0 replies; 9+ messages in thread
From: Nicolas Ferre @ 2021-09-01  9:51 UTC (permalink / raw)
  To: Cai Huoqing
  Cc: Tudor Ambarus, Miquel Raynal, Richard Weinberger,
	Vignesh Raghavendra, Alexandre Belloni, Ludovic Desroches,
	linux-mtd, linux-arm-kernel, linux-kernel

On 01/09/2021 at 09:40, Cai Huoqing 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>

Reviewed-by: Nicolas Ferre <nicolas.ferre@microchip.com>

> ---
>   drivers/mtd/nand/raw/atmel/pmecc.c | 7 ++-----
>   1 file changed, 2 insertions(+), 5 deletions(-)
> 
> diff --git a/drivers/mtd/nand/raw/atmel/pmecc.c b/drivers/mtd/nand/raw/atmel/pmecc.c
> index cbb023bf00f7..498e41ccabbd 100644
> --- a/drivers/mtd/nand/raw/atmel/pmecc.c
> +++ b/drivers/mtd/nand/raw/atmel/pmecc.c
> @@ -834,7 +834,6 @@ static struct atmel_pmecc *atmel_pmecc_create(struct platform_device *pdev,
>   {
>          struct device *dev = &pdev->dev;
>          struct atmel_pmecc *pmecc;
> -       struct resource *res;
> 
>          pmecc = devm_kzalloc(dev, sizeof(*pmecc), GFP_KERNEL);
>          if (!pmecc)
> @@ -844,13 +843,11 @@ static struct atmel_pmecc *atmel_pmecc_create(struct platform_device *pdev,
>          pmecc->dev = dev;
>          mutex_init(&pmecc->lock);
> 
> -       res = platform_get_resource(pdev, IORESOURCE_MEM, pmecc_res_idx);
> -       pmecc->regs.base = devm_ioremap_resource(dev, res);
> +       pmecc->regs.base = devm_platform_ioremap_resource(pdev, pmecc_res_idx);
>          if (IS_ERR(pmecc->regs.base))
>                  return ERR_CAST(pmecc->regs.base);
> 
> -       res = platform_get_resource(pdev, IORESOURCE_MEM, errloc_res_idx);
> -       pmecc->regs.errloc = devm_ioremap_resource(dev, res);
> +       pmecc->regs.errloc = devm_platform_ioremap_resource(pdev, errloc_res_idx);
>          if (IS_ERR(pmecc->regs.errloc))
>                  return ERR_CAST(pmecc->regs.errloc);
> 
> --
> 2.25.1
> 


-- 
Nicolas Ferre

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* Re: [PATCH] mtd: rawnand: atmel: Make use of the helper function devm_platform_ioremap_resource()
  2021-09-01  7:40 ` Cai Huoqing
  (?)
@ 2021-09-14 17:40   ` Miquel Raynal
  -1 siblings, 0 replies; 9+ messages in thread
From: Miquel Raynal @ 2021-09-14 17:40 UTC (permalink / raw)
  To: Cai Huoqing
  Cc: Miquel Raynal, Tudor Ambarus, Richard Weinberger,
	Vignesh Raghavendra, Nicolas Ferre, Alexandre Belloni,
	Ludovic Desroches, linux-mtd, linux-arm-kernel, linux-kernel

On Wed, 2021-09-01 at 07:40:30 UTC, Cai Huoqing 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>
> Reviewed-by: Nicolas Ferre <nicolas.ferre@microchip.com>

Applied to https://git.kernel.org/pub/scm/linux/kernel/git/mtd/linux.git nand/next, thanks.

Miquel

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

* Re: [PATCH] mtd: rawnand: atmel: Make use of the helper function devm_platform_ioremap_resource()
@ 2021-09-14 17:40   ` Miquel Raynal
  0 siblings, 0 replies; 9+ messages in thread
From: Miquel Raynal @ 2021-09-14 17:40 UTC (permalink / raw)
  To: Cai Huoqing
  Cc: Miquel Raynal, Tudor Ambarus, Richard Weinberger,
	Vignesh Raghavendra, Nicolas Ferre, Alexandre Belloni,
	Ludovic Desroches, linux-mtd, linux-arm-kernel, linux-kernel

On Wed, 2021-09-01 at 07:40:30 UTC, Cai Huoqing 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>
> Reviewed-by: Nicolas Ferre <nicolas.ferre@microchip.com>

Applied to https://git.kernel.org/pub/scm/linux/kernel/git/mtd/linux.git nand/next, thanks.

Miquel

______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/

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

* Re: [PATCH] mtd: rawnand: atmel: Make use of the helper function devm_platform_ioremap_resource()
@ 2021-09-14 17:40   ` Miquel Raynal
  0 siblings, 0 replies; 9+ messages in thread
From: Miquel Raynal @ 2021-09-14 17:40 UTC (permalink / raw)
  To: Cai Huoqing
  Cc: Alexandre Belloni, Vignesh Raghavendra, Tudor Ambarus,
	Richard Weinberger, linux-kernel, Ludovic Desroches, linux-mtd,
	Miquel Raynal, linux-arm-kernel

On Wed, 2021-09-01 at 07:40:30 UTC, Cai Huoqing 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>
> Reviewed-by: Nicolas Ferre <nicolas.ferre@microchip.com>

Applied to https://git.kernel.org/pub/scm/linux/kernel/git/mtd/linux.git nand/next, thanks.

Miquel

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

end of thread, other threads:[~2021-09-14 18:09 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-09-01  7:40 [PATCH] mtd: rawnand: atmel: Make use of the helper function devm_platform_ioremap_resource() Cai Huoqing
2021-09-01  7:40 ` Cai Huoqing
2021-09-01  7:40 ` Cai Huoqing
2021-09-01  9:51 ` Nicolas Ferre
2021-09-01  9:51   ` Nicolas Ferre
2021-09-01  9:51   ` Nicolas Ferre
2021-09-14 17:40 ` Miquel Raynal
2021-09-14 17:40   ` Miquel Raynal
2021-09-14 17:40   ` Miquel Raynal

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.