mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH 0/3] memory: fsl_ifc: Switch to modern devm and platform IRQ APIs
@ 2026-06-04  4:28 Rosen Penev
  2026-06-04  4:28 ` [PATCH 1/3] memory: fsl_ifc: Fix optional NAND IRQ handling and migrate to platform IRQ API Rosen Penev
                   ` (2 more replies)
  0 siblings, 3 replies; 11+ messages in thread
From: Rosen Penev @ 2026-06-04  4:28 UTC (permalink / raw)
  To: linux-kernel; +Cc: Krzysztof Kozlowski

Convert the Freescale IFC controller driver from legacy OF-specific
APIs to modern platform-device and devm-based equivalents. This
eliminates manual resource tracking in error paths and remove(),
simplifying the driver and reducing LoC by ~40%.

Patch 1 replaces irq_of_parse_and_map() with platform_get_irq() /
platform_get_irq_optional() and fixes unconditional free_irq() calls
on the optional NAND IRQ.
Patch 2 replaces of_iomap() with devm_platform_ioremap_resource(),
dropping the manual iounmap in remove/error paths and fixing a
missing free_irq on the main IRQ request_irq failure.
Patch 3 switches from request_irq to devm_request_irq, removing the
error-path labels entirely and reducing remove() to just
of_platform_depopulate.

Rosen Penev (3):
  memory: fsl_ifc: Fix optional NAND IRQ handling and migrate to
    platform IRQ API
  memory: fsl_ifc: Use devm_platform_ioremap_resource and fix error
    paths
  memory: fsl_ifc: Use devm_request_irq and simplify remove

 drivers/memory/fsl_ifc.c | 68 ++++++++++++----------------------------
 1 file changed, 20 insertions(+), 48 deletions(-)

-- 
2.54.0


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

* [PATCH 1/3] memory: fsl_ifc: Fix optional NAND IRQ handling and migrate to platform IRQ API
  2026-06-04  4:28 [PATCH 0/3] memory: fsl_ifc: Switch to modern devm and platform IRQ APIs Rosen Penev
@ 2026-06-04  4:28 ` Rosen Penev
  2026-07-08 11:02   ` Krzysztof Kozlowski
  2026-06-04  4:28 ` [PATCH 2/3] memory: fsl_ifc: Use devm_platform_ioremap_resource and fix error paths Rosen Penev
  2026-06-04  4:28 ` [PATCH 3/3] memory: fsl_ifc: Use devm_request_irq and simplify remove Rosen Penev
  2 siblings, 1 reply; 11+ messages in thread
From: Rosen Penev @ 2026-06-04  4:28 UTC (permalink / raw)
  To: linux-kernel; +Cc: Krzysztof Kozlowski

Switch from irq_of_parse_and_map() to platform_get_irq() for the main
controller IRQ, and use platform_get_irq_optional() for the NAND IRQ
which is optional. Guard free_irq() calls on the NAND IRQ with a
nand_irq > 0 check to avoid passing invalid IRQ numbers on platforms
without a dedicated NAND interrupt line.

Assisted-by: opencode:big-pickle
Signed-off-by: Rosen Penev <rosenp@gmail.com>
---
 drivers/memory/fsl_ifc.c | 34 ++++++++++++++++------------------
 1 file changed, 16 insertions(+), 18 deletions(-)

diff --git a/drivers/memory/fsl_ifc.c b/drivers/memory/fsl_ifc.c
index e89e0c6cc4bc..80b82ea952f7 100644
--- a/drivers/memory/fsl_ifc.c
+++ b/drivers/memory/fsl_ifc.c
@@ -89,12 +89,10 @@ static void fsl_ifc_ctrl_remove(struct platform_device *dev)
 	struct fsl_ifc_ctrl *ctrl = dev_get_drvdata(&dev->dev);
 
 	of_platform_depopulate(&dev->dev);
-	free_irq(ctrl->nand_irq, ctrl);
+	if (ctrl->nand_irq > 0)
+		free_irq(ctrl->nand_irq, ctrl);
 	free_irq(ctrl->irq, ctrl);
 
-	irq_dispose_mapping(ctrl->nand_irq);
-	irq_dispose_mapping(ctrl->irq);
-
 	iounmap(ctrl->gregs);
 
 	dev_set_drvdata(&dev->dev, NULL);
@@ -247,22 +245,18 @@ static int fsl_ifc_ctrl_probe(struct platform_device *dev)
 	fsl_ifc_ctrl_dev->rregs = addr;
 
 	/* get the Controller level irq */
-	fsl_ifc_ctrl_dev->irq = irq_of_parse_and_map(dev->dev.of_node, 0);
-	if (fsl_ifc_ctrl_dev->irq == 0) {
+	fsl_ifc_ctrl_dev->irq = platform_get_irq(dev, 0);
+	if (fsl_ifc_ctrl_dev->irq < 0) {
 		dev_err(&dev->dev, "failed to get irq resource for IFC\n");
-		ret = -ENODEV;
+		ret = fsl_ifc_ctrl_dev->irq;
 		goto err;
 	}
 
-	/* get the nand machine irq */
-	fsl_ifc_ctrl_dev->nand_irq =
-			irq_of_parse_and_map(dev->dev.of_node, 1);
-
 	fsl_ifc_ctrl_dev->dev = &dev->dev;
 
 	ret = fsl_ifc_ctrl_init(fsl_ifc_ctrl_dev);
 	if (ret < 0)
-		goto err_unmap_nandirq;
+		goto err;
 
 	init_waitqueue_head(&fsl_ifc_ctrl_dev->nand_wait);
 
@@ -271,10 +265,16 @@ static int fsl_ifc_ctrl_probe(struct platform_device *dev)
 	if (ret != 0) {
 		dev_err(&dev->dev, "failed to install irq (%d)\n",
 			fsl_ifc_ctrl_dev->irq);
-		goto err_unmap_nandirq;
+		goto err;
 	}
 
-	if (fsl_ifc_ctrl_dev->nand_irq) {
+	/* get the nand machine irq */
+	fsl_ifc_ctrl_dev->nand_irq = platform_get_irq_optional(dev, 1);
+	if (fsl_ifc_ctrl_dev->nand_irq < 0) {
+		ret = fsl_ifc_ctrl_dev->nand_irq;
+		goto err_free_irq;
+	}
+	if (fsl_ifc_ctrl_dev->nand_irq > 0) {
 		ret = request_irq(fsl_ifc_ctrl_dev->nand_irq, fsl_ifc_nand_irq,
 				0, "fsl-ifc-nand", fsl_ifc_ctrl_dev);
 		if (ret != 0) {
@@ -292,12 +292,10 @@ static int fsl_ifc_ctrl_probe(struct platform_device *dev)
 	return 0;
 
 err_free_nandirq:
-	free_irq(fsl_ifc_ctrl_dev->nand_irq, fsl_ifc_ctrl_dev);
+	if (fsl_ifc_ctrl_dev->nand_irq > 0)
+		free_irq(fsl_ifc_ctrl_dev->nand_irq, fsl_ifc_ctrl_dev);
 err_free_irq:
 	free_irq(fsl_ifc_ctrl_dev->irq, fsl_ifc_ctrl_dev);
-err_unmap_nandirq:
-	irq_dispose_mapping(fsl_ifc_ctrl_dev->nand_irq);
-	irq_dispose_mapping(fsl_ifc_ctrl_dev->irq);
 err:
 	iounmap(fsl_ifc_ctrl_dev->gregs);
 	return ret;
-- 
2.54.0


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

* [PATCH 2/3] memory: fsl_ifc: Use devm_platform_ioremap_resource and fix error paths
  2026-06-04  4:28 [PATCH 0/3] memory: fsl_ifc: Switch to modern devm and platform IRQ APIs Rosen Penev
  2026-06-04  4:28 ` [PATCH 1/3] memory: fsl_ifc: Fix optional NAND IRQ handling and migrate to platform IRQ API Rosen Penev
@ 2026-06-04  4:28 ` Rosen Penev
  2026-06-04  4:28 ` [PATCH 3/3] memory: fsl_ifc: Use devm_request_irq and simplify remove Rosen Penev
  2 siblings, 0 replies; 11+ messages in thread
From: Rosen Penev @ 2026-06-04  4:28 UTC (permalink / raw)
  To: linux-kernel; +Cc: Krzysztof Kozlowski

Replace of_iomap() with devm_platform_ioremap_resource() for automatic
resource management, eliminating manual iounmap in remove and error
paths. devm_ioremap_resource() reserves the region and checks for
overlaps, which is safe here since the IFC controller register space
and child chip-select ranges are always at distinct addresses in all
DTS files.

Also fix the request_irq failure path to properly free the registered
main IRQ, and remove an incorrect nand_irq < 0 check that treated a
missing optional NAND IRQ as a fatal error.

Assisted-by: opencode:big-pickle
Signed-off-by: Rosen Penev <rosenp@gmail.com>
---
 drivers/memory/fsl_ifc.c | 25 ++++++-------------------
 1 file changed, 6 insertions(+), 19 deletions(-)

diff --git a/drivers/memory/fsl_ifc.c b/drivers/memory/fsl_ifc.c
index 80b82ea952f7..effeae0bdacc 100644
--- a/drivers/memory/fsl_ifc.c
+++ b/drivers/memory/fsl_ifc.c
@@ -92,10 +92,6 @@ static void fsl_ifc_ctrl_remove(struct platform_device *dev)
 	if (ctrl->nand_irq > 0)
 		free_irq(ctrl->nand_irq, ctrl);
 	free_irq(ctrl->irq, ctrl);
-
-	iounmap(ctrl->gregs);
-
-	dev_set_drvdata(&dev->dev, NULL);
 }
 
 /*
@@ -213,11 +209,9 @@ static int fsl_ifc_ctrl_probe(struct platform_device *dev)
 	dev_set_drvdata(&dev->dev, fsl_ifc_ctrl_dev);
 
 	/* IOMAP the entire IFC region */
-	fsl_ifc_ctrl_dev->gregs = of_iomap(dev->dev.of_node, 0);
-	if (!fsl_ifc_ctrl_dev->gregs) {
-		dev_err(&dev->dev, "failed to get memory region\n");
-		return -ENODEV;
-	}
+	fsl_ifc_ctrl_dev->gregs = devm_platform_ioremap_resource(dev, 0);
+	if (IS_ERR(fsl_ifc_ctrl_dev->gregs))
+		return PTR_ERR(fsl_ifc_ctrl_dev->gregs);
 
 	if (of_property_read_bool(dev->dev.of_node, "little-endian")) {
 		fsl_ifc_ctrl_dev->little_endian = true;
@@ -248,15 +242,14 @@ static int fsl_ifc_ctrl_probe(struct platform_device *dev)
 	fsl_ifc_ctrl_dev->irq = platform_get_irq(dev, 0);
 	if (fsl_ifc_ctrl_dev->irq < 0) {
 		dev_err(&dev->dev, "failed to get irq resource for IFC\n");
-		ret = fsl_ifc_ctrl_dev->irq;
-		goto err;
+		return fsl_ifc_ctrl_dev->irq;
 	}
 
 	fsl_ifc_ctrl_dev->dev = &dev->dev;
 
 	ret = fsl_ifc_ctrl_init(fsl_ifc_ctrl_dev);
 	if (ret < 0)
-		goto err;
+		return ret;
 
 	init_waitqueue_head(&fsl_ifc_ctrl_dev->nand_wait);
 
@@ -265,15 +258,11 @@ static int fsl_ifc_ctrl_probe(struct platform_device *dev)
 	if (ret != 0) {
 		dev_err(&dev->dev, "failed to install irq (%d)\n",
 			fsl_ifc_ctrl_dev->irq);
-		goto err;
+		goto err_free_irq;
 	}
 
 	/* get the nand machine irq */
 	fsl_ifc_ctrl_dev->nand_irq = platform_get_irq_optional(dev, 1);
-	if (fsl_ifc_ctrl_dev->nand_irq < 0) {
-		ret = fsl_ifc_ctrl_dev->nand_irq;
-		goto err_free_irq;
-	}
 	if (fsl_ifc_ctrl_dev->nand_irq > 0) {
 		ret = request_irq(fsl_ifc_ctrl_dev->nand_irq, fsl_ifc_nand_irq,
 				0, "fsl-ifc-nand", fsl_ifc_ctrl_dev);
@@ -296,8 +285,6 @@ static int fsl_ifc_ctrl_probe(struct platform_device *dev)
 		free_irq(fsl_ifc_ctrl_dev->nand_irq, fsl_ifc_ctrl_dev);
 err_free_irq:
 	free_irq(fsl_ifc_ctrl_dev->irq, fsl_ifc_ctrl_dev);
-err:
-	iounmap(fsl_ifc_ctrl_dev->gregs);
 	return ret;
 }
 
-- 
2.54.0


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

* [PATCH 3/3] memory: fsl_ifc: Use devm_request_irq and simplify remove
  2026-06-04  4:28 [PATCH 0/3] memory: fsl_ifc: Switch to modern devm and platform IRQ APIs Rosen Penev
  2026-06-04  4:28 ` [PATCH 1/3] memory: fsl_ifc: Fix optional NAND IRQ handling and migrate to platform IRQ API Rosen Penev
  2026-06-04  4:28 ` [PATCH 2/3] memory: fsl_ifc: Use devm_platform_ioremap_resource and fix error paths Rosen Penev
@ 2026-06-04  4:28 ` Rosen Penev
  2026-07-08 11:04   ` Krzysztof Kozlowski
  2 siblings, 1 reply; 11+ messages in thread
From: Rosen Penev @ 2026-06-04  4:28 UTC (permalink / raw)
  To: linux-kernel; +Cc: Krzysztof Kozlowski

Switch from request_irq to devm_request_irq, eliminating the error
path labels and free_irq calls in remove(). Since both IRQs are now
devm-managed, the remove function only needs of_platform_depopulate
to tear down child devices before devm cleanup fires.

Assisted-by: opencode:big-pickle
Signed-off-by: Rosen Penev <rosenp@gmail.com>
---
 drivers/memory/fsl_ifc.c | 33 ++++++++++-----------------------
 1 file changed, 10 insertions(+), 23 deletions(-)

diff --git a/drivers/memory/fsl_ifc.c b/drivers/memory/fsl_ifc.c
index effeae0bdacc..6be09a902443 100644
--- a/drivers/memory/fsl_ifc.c
+++ b/drivers/memory/fsl_ifc.c
@@ -86,12 +86,7 @@ static int fsl_ifc_ctrl_init(struct fsl_ifc_ctrl *ctrl)
 
 static void fsl_ifc_ctrl_remove(struct platform_device *dev)
 {
-	struct fsl_ifc_ctrl *ctrl = dev_get_drvdata(&dev->dev);
-
 	of_platform_depopulate(&dev->dev);
-	if (ctrl->nand_irq > 0)
-		free_irq(ctrl->nand_irq, ctrl);
-	free_irq(ctrl->irq, ctrl);
 }
 
 /*
@@ -253,39 +248,31 @@ static int fsl_ifc_ctrl_probe(struct platform_device *dev)
 
 	init_waitqueue_head(&fsl_ifc_ctrl_dev->nand_wait);
 
-	ret = request_irq(fsl_ifc_ctrl_dev->irq, fsl_ifc_ctrl_irq, IRQF_SHARED,
-			  "fsl-ifc", fsl_ifc_ctrl_dev);
+	ret = devm_request_irq(&dev->dev, fsl_ifc_ctrl_dev->irq,
+			       fsl_ifc_ctrl_irq, IRQF_SHARED,
+			       "fsl-ifc", fsl_ifc_ctrl_dev);
 	if (ret != 0) {
 		dev_err(&dev->dev, "failed to install irq (%d)\n",
 			fsl_ifc_ctrl_dev->irq);
-		goto err_free_irq;
+		return ret;
 	}
 
 	/* get the nand machine irq */
 	fsl_ifc_ctrl_dev->nand_irq = platform_get_irq_optional(dev, 1);
 	if (fsl_ifc_ctrl_dev->nand_irq > 0) {
-		ret = request_irq(fsl_ifc_ctrl_dev->nand_irq, fsl_ifc_nand_irq,
-				0, "fsl-ifc-nand", fsl_ifc_ctrl_dev);
+		ret = devm_request_irq(&dev->dev,
+				       fsl_ifc_ctrl_dev->nand_irq,
+				       fsl_ifc_nand_irq, 0,
+				       "fsl-ifc-nand", fsl_ifc_ctrl_dev);
 		if (ret != 0) {
 			dev_err(&dev->dev, "failed to install irq (%d)\n",
 				fsl_ifc_ctrl_dev->nand_irq);
-			goto err_free_irq;
+			return ret;
 		}
 	}
 
 	/* legacy dts may still use "simple-bus" compatible */
-	ret = of_platform_default_populate(dev->dev.of_node, NULL, &dev->dev);
-	if (ret)
-		goto err_free_nandirq;
-
-	return 0;
-
-err_free_nandirq:
-	if (fsl_ifc_ctrl_dev->nand_irq > 0)
-		free_irq(fsl_ifc_ctrl_dev->nand_irq, fsl_ifc_ctrl_dev);
-err_free_irq:
-	free_irq(fsl_ifc_ctrl_dev->irq, fsl_ifc_ctrl_dev);
-	return ret;
+	return of_platform_default_populate(dev->dev.of_node, NULL, &dev->dev);
 }
 
 static const struct of_device_id fsl_ifc_match[] = {
-- 
2.54.0


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

* Re: [PATCH 1/3] memory: fsl_ifc: Fix optional NAND IRQ handling and migrate to platform IRQ API
  2026-06-04  4:28 ` [PATCH 1/3] memory: fsl_ifc: Fix optional NAND IRQ handling and migrate to platform IRQ API Rosen Penev
@ 2026-07-08 11:02   ` Krzysztof Kozlowski
  2026-07-08 19:28     ` Rosen Penev
  0 siblings, 1 reply; 11+ messages in thread
From: Krzysztof Kozlowski @ 2026-07-08 11:02 UTC (permalink / raw)
  To: Rosen Penev, linux-kernel

On 04/06/2026 06:28, Rosen Penev wrote:
> @@ -271,10 +265,16 @@ static int fsl_ifc_ctrl_probe(struct platform_device *dev)
>  	if (ret != 0) {
>  		dev_err(&dev->dev, "failed to install irq (%d)\n",
>  			fsl_ifc_ctrl_dev->irq);
> -		goto err_unmap_nandirq;
> +		goto err;
>  	}
>  
> -	if (fsl_ifc_ctrl_dev->nand_irq) {
> +	/* get the nand machine irq */
> +	fsl_ifc_ctrl_dev->nand_irq = platform_get_irq_optional(dev, 1);
> +	if (fsl_ifc_ctrl_dev->nand_irq < 0) {
> +		ret = fsl_ifc_ctrl_dev->nand_irq;

How did you test it? Looks like you change the logic and fail the probe
on missing IRQ.


Best regards,
Krzysztof

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

* Re: [PATCH 3/3] memory: fsl_ifc: Use devm_request_irq and simplify remove
  2026-06-04  4:28 ` [PATCH 3/3] memory: fsl_ifc: Use devm_request_irq and simplify remove Rosen Penev
@ 2026-07-08 11:04   ` Krzysztof Kozlowski
  2026-07-08 19:37     ` Rosen Penev
  0 siblings, 1 reply; 11+ messages in thread
From: Krzysztof Kozlowski @ 2026-07-08 11:04 UTC (permalink / raw)
  To: Rosen Penev, linux-kernel

On 04/06/2026 06:28, Rosen Penev wrote:
> -
> -err_free_nandirq:
> -	if (fsl_ifc_ctrl_dev->nand_irq > 0)
> -		free_irq(fsl_ifc_ctrl_dev->nand_irq, fsl_ifc_ctrl_dev);
> -err_free_irq:
> -	free_irq(fsl_ifc_ctrl_dev->irq, fsl_ifc_ctrl_dev);
> -	return ret;
> +	return of_platform_default_populate(dev->dev.of_node, NULL, &dev->dev);

This can be devm as well, in this patch.


>  }
>  
>  static const struct of_device_id fsl_ifc_match[] = {


Best regards,
Krzysztof

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

* Re: [PATCH 1/3] memory: fsl_ifc: Fix optional NAND IRQ handling and migrate to platform IRQ API
  2026-07-08 11:02   ` Krzysztof Kozlowski
@ 2026-07-08 19:28     ` Rosen Penev
  0 siblings, 0 replies; 11+ messages in thread
From: Rosen Penev @ 2026-07-08 19:28 UTC (permalink / raw)
  To: Krzysztof Kozlowski; +Cc: linux-kernel

On Wed, Jul 8, 2026 at 4:02 AM Krzysztof Kozlowski <krzk@kernel.org> wrote:
>
> On 04/06/2026 06:28, Rosen Penev wrote:
> > @@ -271,10 +265,16 @@ static int fsl_ifc_ctrl_probe(struct platform_device *dev)
> >       if (ret != 0) {
> >               dev_err(&dev->dev, "failed to install irq (%d)\n",
> >                       fsl_ifc_ctrl_dev->irq);
> > -             goto err_unmap_nandirq;
> > +             goto err;
> >       }
> >
> > -     if (fsl_ifc_ctrl_dev->nand_irq) {
> > +     /* get the nand machine irq */
> > +     fsl_ifc_ctrl_dev->nand_irq = platform_get_irq_optional(dev, 1);
> > +     if (fsl_ifc_ctrl_dev->nand_irq < 0) {
> > +             ret = fsl_ifc_ctrl_dev->nand_irq;
>
> How did you test it? Looks like you change the logic and fail the probe
> on missing IRQ.
Yeah this was wrong. I assumed the optional part was the irq itself
but it's just the error message.
>
>
> Best regards,
> Krzysztof

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

* Re: [PATCH 3/3] memory: fsl_ifc: Use devm_request_irq and simplify remove
  2026-07-08 11:04   ` Krzysztof Kozlowski
@ 2026-07-08 19:37     ` Rosen Penev
  2026-07-09  7:11       ` Krzysztof Kozlowski
  0 siblings, 1 reply; 11+ messages in thread
From: Rosen Penev @ 2026-07-08 19:37 UTC (permalink / raw)
  To: Krzysztof Kozlowski; +Cc: linux-kernel

On Wed, Jul 8, 2026 at 4:04 AM Krzysztof Kozlowski <krzk@kernel.org> wrote:
>
> On 04/06/2026 06:28, Rosen Penev wrote:
> > -
> > -err_free_nandirq:
> > -     if (fsl_ifc_ctrl_dev->nand_irq > 0)
> > -             free_irq(fsl_ifc_ctrl_dev->nand_irq, fsl_ifc_ctrl_dev);
> > -err_free_irq:
> > -     free_irq(fsl_ifc_ctrl_dev->irq, fsl_ifc_ctrl_dev);
> > -     return ret;
> > +     return of_platform_default_populate(dev->dev.of_node, NULL, &dev->dev);
>
> This can be devm as well, in this patch.
Not sure I follow. Although of_platform_default_populate is probably
not needed here anymore. Will test.

This series means nothing though, since this driver never probes. I
sent a patch but no action has been taken:
https://lore.kernel.org/all/20260604043309.91280-1-rosenp@gmail.com/
>
>
> >  }
> >
> >  static const struct of_device_id fsl_ifc_match[] = {
>
>
> Best regards,
> Krzysztof

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

* Re: [PATCH 3/3] memory: fsl_ifc: Use devm_request_irq and simplify remove
  2026-07-08 19:37     ` Rosen Penev
@ 2026-07-09  7:11       ` Krzysztof Kozlowski
  2026-07-14 20:44         ` Rosen Penev
  0 siblings, 1 reply; 11+ messages in thread
From: Krzysztof Kozlowski @ 2026-07-09  7:11 UTC (permalink / raw)
  To: Rosen Penev; +Cc: linux-kernel

On 08/07/2026 21:37, Rosen Penev wrote:
> On Wed, Jul 8, 2026 at 4:04 AM Krzysztof Kozlowski <krzk@kernel.org> wrote:
>>
>> On 04/06/2026 06:28, Rosen Penev wrote:
>>> -
>>> -err_free_nandirq:
>>> -     if (fsl_ifc_ctrl_dev->nand_irq > 0)
>>> -             free_irq(fsl_ifc_ctrl_dev->nand_irq, fsl_ifc_ctrl_dev);
>>> -err_free_irq:
>>> -     free_irq(fsl_ifc_ctrl_dev->irq, fsl_ifc_ctrl_dev);
>>> -     return ret;
>>> +     return of_platform_default_populate(dev->dev.of_node, NULL, &dev->dev);
>>
>> This can be devm as well, in this patch.
> Not sure I follow.

Use devm resource managed variant.

Best regards,
Krzysztof

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

* Re: [PATCH 3/3] memory: fsl_ifc: Use devm_request_irq and simplify remove
  2026-07-09  7:11       ` Krzysztof Kozlowski
@ 2026-07-14 20:44         ` Rosen Penev
  2026-07-15  4:34           ` Krzysztof Kozlowski
  0 siblings, 1 reply; 11+ messages in thread
From: Rosen Penev @ 2026-07-14 20:44 UTC (permalink / raw)
  To: Krzysztof Kozlowski; +Cc: linux-kernel

On Thu, Jul 9, 2026 at 12:11 AM Krzysztof Kozlowski <krzk@kernel.org> wrote:
>
> On 08/07/2026 21:37, Rosen Penev wrote:
> > On Wed, Jul 8, 2026 at 4:04 AM Krzysztof Kozlowski <krzk@kernel.org> wrote:
> >>
> >> On 04/06/2026 06:28, Rosen Penev wrote:
> >>> -
> >>> -err_free_nandirq:
> >>> -     if (fsl_ifc_ctrl_dev->nand_irq > 0)
> >>> -             free_irq(fsl_ifc_ctrl_dev->nand_irq, fsl_ifc_ctrl_dev);
> >>> -err_free_irq:
> >>> -     free_irq(fsl_ifc_ctrl_dev->irq, fsl_ifc_ctrl_dev);
> >>> -     return ret;
> >>> +     return of_platform_default_populate(dev->dev.of_node, NULL, &dev->dev);
> >>
> >> This can be devm as well, in this patch.
> > Not sure I follow.
>
> Use devm resource managed variant.
What's the devm version of of_platform_default_populate?
>
> Best regards,
> Krzysztof

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

* Re: [PATCH 3/3] memory: fsl_ifc: Use devm_request_irq and simplify remove
  2026-07-14 20:44         ` Rosen Penev
@ 2026-07-15  4:34           ` Krzysztof Kozlowski
  0 siblings, 0 replies; 11+ messages in thread
From: Krzysztof Kozlowski @ 2026-07-15  4:34 UTC (permalink / raw)
  To: Rosen Penev; +Cc: linux-kernel

On 14/07/2026 22:44, Rosen Penev wrote:
> On Thu, Jul 9, 2026 at 12:11 AM Krzysztof Kozlowski <krzk@kernel.org> wrote:
>>
>> On 08/07/2026 21:37, Rosen Penev wrote:
>>> On Wed, Jul 8, 2026 at 4:04 AM Krzysztof Kozlowski <krzk@kernel.org> wrote:
>>>>
>>>> On 04/06/2026 06:28, Rosen Penev wrote:
>>>>> -
>>>>> -err_free_nandirq:
>>>>> -     if (fsl_ifc_ctrl_dev->nand_irq > 0)
>>>>> -             free_irq(fsl_ifc_ctrl_dev->nand_irq, fsl_ifc_ctrl_dev);
>>>>> -err_free_irq:
>>>>> -     free_irq(fsl_ifc_ctrl_dev->irq, fsl_ifc_ctrl_dev);
>>>>> -     return ret;
>>>>> +     return of_platform_default_populate(dev->dev.of_node, NULL, &dev->dev);
>>>>
>>>> This can be devm as well, in this patch.
>>> Not sure I follow.
>>
>> Use devm resource managed variant.
> What's the devm version of of_platform_default_populate?

Indeed, "default" variant does not have a devm. Patch is fine.

Best regards,
Krzysztof

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

end of thread, other threads:[~2026-07-15  4:35 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-06-04  4:28 [PATCH 0/3] memory: fsl_ifc: Switch to modern devm and platform IRQ APIs Rosen Penev
2026-06-04  4:28 ` [PATCH 1/3] memory: fsl_ifc: Fix optional NAND IRQ handling and migrate to platform IRQ API Rosen Penev
2026-07-08 11:02   ` Krzysztof Kozlowski
2026-07-08 19:28     ` Rosen Penev
2026-06-04  4:28 ` [PATCH 2/3] memory: fsl_ifc: Use devm_platform_ioremap_resource and fix error paths Rosen Penev
2026-06-04  4:28 ` [PATCH 3/3] memory: fsl_ifc: Use devm_request_irq and simplify remove Rosen Penev
2026-07-08 11:04   ` Krzysztof Kozlowski
2026-07-08 19:37     ` Rosen Penev
2026-07-09  7:11       ` Krzysztof Kozlowski
2026-07-14 20:44         ` Rosen Penev
2026-07-15  4:34           ` Krzysztof Kozlowski

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox