[PATCH 01/20] mtd: rawnand: txx9ndfmc: Mark driver struct with __refdata to prevent section mismatch warning
Miquel Raynal
miquel.raynal at bootlin.com
Mon Oct 9 06:37:41 PDT 2023
Hi Arnd,
arnd at arndb.de wrote on Mon, 09 Oct 2023 15:01:17 +0200:
> On Mon, Oct 9, 2023, at 14:46, Miquel Raynal wrote:
> >> On Mon, Oct 09, 2023 at 10:43:46AM +0200, Arnd Bergmann wrote:
> >> > On Mon, Oct 9, 2023, at 09:22, Masahiro Yamada wrote:
> >> > > On Mon, Oct 9, 2023 at 5:02 AM Uwe Kleine-König <u.kleine-koenig at pengutronix.de> > Can we instead question the use of module_platform_driver_probe()?
> > I don't have the history in mind, but why not just switch to regular
> > module_platform_driver() registration instead? It seems like the
> > original authors just did not care about the remove path and were
> > happy to skip its implementation.
> >
> > On mtd devices one can argue that the flash underlying stores the
> > rootfs and thus cannot be removed, but I believe today this is a
> > questionable (software) design.
>
> It was changed to module_platform_driver_probe() in commit
> 3a2a13fa902d2 ("mtd: txx9ndfmc: use module_platform_driver_probe()")
> with a short changelog text:
>
> commit 3a2a13fa902d232a1e56582647aed6cb2591349b
> Author: Jingoo Han <jg1.han at samsung.com>
> Date: Tue Mar 5 13:31:24 2013 +0900
>
> mtd: txx9ndfmc: use module_platform_driver_probe()
>
> This patch uses module_platform_driver_probe() macro which makes
> the code smaller and simpler.
>
> Signed-off-by: Jingoo Han <jg1.han at samsung.com>
> Signed-off-by: Artem Bityutskiy <artem.bityutskiy at linux.intel.com>
> Signed-off-by: David Woodhouse <David.Woodhouse at intel.com>
>
> Instead of just simplifying the code, I think that was actually
> a bugfix because it prevented both the probe and remove callbacks
> from getting called after getting dropped (deferred probe or
> unbind/rebind). Using module_platform_driver() is probably
> even better here, but then we need to remove both the __init
> and __exit annotations.
Agreed.
Thanks,
Miquèl
More information about the linux-mtd
mailing list