Re: [PATCH v3] memory: fsl_ifc: Clear global controller pointer on probe failure and remove

From: Markus Elfring

Date: Fri Oct 30 2026 - 13:49:31 EST


…
> Clear the pointer on the probe error paths and in remove, once the IRQs
> have been released. The global cannot be published later in probe
…
???

Is there a need to refine the change description another bit?


…
> ---
> Changes in v3:
…
> Not compile-tested (no PowerPC build setup); the change is four
> assignments of NULL.

It seems that I am counting differently.


…
> +++ b/drivers/memory/fsl_ifc.c
…
> @@ -218,6 +220,7 @@ static int fsl_ifc_ctrl_probe(struct platform_device *dev)
> 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");
> + fsl_ifc_ctrl_dev = NULL;
> return -ENODEV;
> }
>
> @@ -300,6 +303,7 @@ static int fsl_ifc_ctrl_probe(struct platform_device *dev)
> irq_dispose_mapping(fsl_ifc_ctrl_dev->irq);
> err:
> iounmap(fsl_ifc_ctrl_dev->gregs);
> + fsl_ifc_ctrl_dev = NULL;
> return ret;
> }

How do you think about to avoid duplicate source code a bit more?
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/Documentation/process/coding-style.rst?h=v7.3#n526
https://elixir.bootlin.com/linux/v7.3/source/drivers/memory/fsl_ifc.c#L194-L304

Regards,
Markus