From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 303D7E95A91 for ; Mon, 9 Oct 2023 13:37:50 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1377237AbjJINht (ORCPT ); Mon, 9 Oct 2023 09:37:49 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42908 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1377234AbjJINhs (ORCPT ); Mon, 9 Oct 2023 09:37:48 -0400 Received: from relay5-d.mail.gandi.net (relay5-d.mail.gandi.net [217.70.183.197]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 22759C5 for ; Mon, 9 Oct 2023 06:37:46 -0700 (PDT) Received: by mail.gandi.net (Postfix) with ESMTPSA id 7BC651C0006; Mon, 9 Oct 2023 13:37:42 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=gm1; t=1696858665; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=RkCQZu/Nd/vuyAyFTi/s+rMXbY5uaNGrEiZfBlkZy44=; b=Afj/PbQ9pWRNc10VdrvsO5jkIXl2QMdCRq06etXr+5cT/qasr+QemFcU5kOJnSuG2H694A 6Qm9Yt5uEr8ggwpWR1E8DSzywTapQS9Hqgev8fCwNu1DK1OntXHjVIElPJTQ2emt5da3Ir wboupFF9YmgWQ8ycWt+uL1peuqv5EqKOyZ6M9AO6H4X0hJPDHeJCmXSm7BL42ZaTWQF8gt Cj4xkw0cJGQt06SruD8RLw+CASFdGHrY6jgxnDQRe4QHGFQe5VpC3oH5J/BLdhkBKH07jm 3U8YrldUisz379uew+qCOqvVXAtNJpO0Q1mQfyGdloIpFjDpyFiGOYeaSAIejw== Date: Mon, 9 Oct 2023 15:37:41 +0200 From: Miquel Raynal To: "Arnd Bergmann" Cc: Uwe =?UTF-8?B?S2xlaW5lLUvDtm5pZw==?= , "Masahiro Yamada" , "David Woodhouse" , linux-kbuild@vger.kernel.org, "Richard Weinberger" , "Atsushi Nemoto" , "Greg Kroah-Hartman" , linux-mtd@lists.infradead.org, "Pengutronix Kernel Team" , "Andrew Morton" , "Vignesh Raghavendra" Subject: Re: [PATCH 01/20] mtd: rawnand: txx9ndfmc: Mark driver struct with __refdata to prevent section mismatch warning Message-ID: <20231009153741.5b04a137@xps-13> In-Reply-To: <55a03e14-7a92-4cf0-82d4-5cbde64d69db@app.fastmail.com> References: <20231008200143.196369-1-u.kleine-koenig@pengutronix.de> <20231008200143.196369-2-u.kleine-koenig@pengutronix.de> <20231009103037.j44gkzqv7cpn4zpu@pengutronix.de> <20231009144610.4ff82afa@xps-13> <55a03e14-7a92-4cf0-82d4-5cbde64d69db@app.fastmail.com> Organization: Bootlin X-Mailer: Claws Mail 4.0.0 (GTK+ 3.24.33; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-GND-Sasl: miquel.raynal@bootlin.com Precedence: bulk List-ID: X-Mailing-List: linux-kbuild@vger.kernel.org Hi Arnd, arnd@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: =20 > >> > On Mon, Oct 9, 2023, at 09:22, Masahiro Yamada wrote: =20 > >> > > On Mon, Oct 9, 2023 at 5:02=E2=80=AFAM Uwe Kleine-K=C3=B6nig > Can we instead question the use of module_pla= tform_driver_probe()? =20 > > 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. =20 >=20 > It was changed to module_platform_driver_probe() in commit > 3a2a13fa902d2 ("mtd: txx9ndfmc: use module_platform_driver_probe()") > with a short changelog text: >=20 > commit 3a2a13fa902d232a1e56582647aed6cb2591349b > Author: Jingoo Han > Date: Tue Mar 5 13:31:24 2013 +0900 >=20 > mtd: txx9ndfmc: use module_platform_driver_probe() > =20 > This patch uses module_platform_driver_probe() macro which makes > the code smaller and simpler. > =20 > Signed-off-by: Jingoo Han > Signed-off-by: Artem Bityutskiy > Signed-off-by: David Woodhouse >=20 > 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=C3=A8l