public inbox for linux-kbuild@vger.kernel.org
 help / color / mirror / Atom feed
From: "Arnd Bergmann" <arnd@arndb.de>
To: "Miquel Raynal" <miquel.raynal@bootlin.com>,
	"Uwe Kleine-König" <u.kleine-koenig@pengutronix.de>
Cc: "Masahiro Yamada" <masahiroy@kernel.org>,
	"David Woodhouse" <dwmw2@infradead.org>,
	linux-kbuild@vger.kernel.org,
	"Richard Weinberger" <richard@nod.at>,
	"Atsushi Nemoto" <anemo@mba.ocn.ne.jp>,
	"Greg Kroah-Hartman" <gregkh@linuxfoundation.org>,
	linux-mtd@lists.infradead.org,
	"Pengutronix Kernel Team" <kernel@pengutronix.de>,
	"Andrew Morton" <akpm@linux-foundation.org>,
	"Vignesh Raghavendra" <vigneshr@ti.com>
Subject: Re: [PATCH 01/20] mtd: rawnand: txx9ndfmc: Mark driver struct with __refdata to prevent section mismatch warning
Date: Mon, 09 Oct 2023 15:01:17 +0200	[thread overview]
Message-ID: <55a03e14-7a92-4cf0-82d4-5cbde64d69db@app.fastmail.com> (raw)
In-Reply-To: <20231009144610.4ff82afa@xps-13>

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@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@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@samsung.com>
    Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>
    Signed-off-by: David Woodhouse <David.Woodhouse@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.

      Arnd

  reply	other threads:[~2023-10-09 13:01 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-10-08 20:01 [PATCH 00/20] mtd: Convert to platform remove callback returning void Uwe Kleine-König
2023-10-08 20:01 ` [PATCH 01/20] mtd: rawnand: txx9ndfmc: Mark driver struct with __refdata to prevent section mismatch warning Uwe Kleine-König
2023-10-09  7:22   ` Masahiro Yamada
2023-10-09  8:43     ` Arnd Bergmann
2023-10-09 10:30       ` Uwe Kleine-König
2023-10-09 12:46         ` Miquel Raynal
2023-10-09 13:01           ` Arnd Bergmann [this message]
2023-10-09 13:37             ` Miquel Raynal
2023-10-16  8:57               ` Miquel Raynal
2023-10-16  9:25         ` Arnd Bergmann
2023-10-16 10:21           ` Uwe Kleine-König
2023-10-17 10:20             ` Masahiro Yamada
2023-10-17 13:20               ` Uwe Kleine-König
2023-10-17 13:45                 ` Greg Kroah-Hartman
2023-10-09  6:07 ` [PATCH 00/20] mtd: Convert to platform remove callback returning void Tudor Ambarus

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=55a03e14-7a92-4cf0-82d4-5cbde64d69db@app.fastmail.com \
    --to=arnd@arndb.de \
    --cc=akpm@linux-foundation.org \
    --cc=anemo@mba.ocn.ne.jp \
    --cc=dwmw2@infradead.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=kernel@pengutronix.de \
    --cc=linux-kbuild@vger.kernel.org \
    --cc=linux-mtd@lists.infradead.org \
    --cc=masahiroy@kernel.org \
    --cc=miquel.raynal@bootlin.com \
    --cc=richard@nod.at \
    --cc=u.kleine-koenig@pengutronix.de \
    --cc=vigneshr@ti.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox