linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
From: "Uwe Kleine-König" <u.kleine-koenig@pengutronix.de>
To: Miquel Raynal <miquel.raynal@bootlin.com>,
	Richard Weinberger <richard@nod.at>,
	Vignesh Raghavendra <vigneshr@ti.com>
Cc: David Woodhouse <David.Woodhouse@intel.com>,
	Hui Tang <tanghui20@huawei.com>,
	Atsushi Nemoto <anemo@mba.ocn.ne.jp>,
	Li Zetao <lizetao1@huawei.com>,
	Zheng Yongjun <zhengyongjun3@huawei.com>,
	linux-mtd@lists.infradead.org,
	Robert Jarzmik <robert.jarzmik@free.fr>,
	Heiko Stuebner <heiko@sntech.de>, Rob Herring <robh@kernel.org>,
	Yangtao Li <frank.li@vivo.com>,
	Tudor Ambarus <tudor.ambarus@linaro.org>,
	Linus Walleij <linus.walleij@linaro.org>,
	linux-kbuild@vger.kernel.org, Joern Engel <joern@lazybastard.org>,
	Nicholas Piggin <npiggin@gmail.com>,
	Vladimir Zapolskiy <vz@mleia.com>,
	Christophe JAILLET <christophe.jaillet@wanadoo.fr>,
	linux-arm-kernel@lists.infradead.org,
	Michael Walle <michael@walle.cc>,
	kernel@pengutronix.de, Andrew Morton <akpm@linux-foundation.org>,
	linuxppc-dev@lists.ozlabs.org,
	Pratyush Yadav <pratyush@kernel.org>
Subject: [PATCH 00/20] mtd: Convert to platform remove callback returning void
Date: Sun,  8 Oct 2023 22:01:23 +0200	[thread overview]
Message-ID: <20231008200143.196369-1-u.kleine-koenig@pengutronix.de> (raw)

Hello,

this series converts all platform drivers below drivers/mtd to use the
.remove_new() callback. Compared to the traditional .remove() callback
.remove_new() returns no value. This is a good thing because the driver
core doesn't (and cannot) cope for errors during remove. The only effect
of a non-zero return value in .remove() is that the driver core emits a
warning. The device is removed anyhow and an early return from .remove()
usually yields resource leaks and/or use-after-free bugs.

All drivers touched here returned zero unconditionally in their remove
callback, so they could all be converted trivially to .remove_new().

See commit 5c5a7680e67b ("platform: Provide a remove callback that
returns no value") for an extended explanation and the eventual goal.

As an added bonus the series starts with a minor fix and a
simplification of the txx9ndfmc driver.

The only interdependencies in this series is between the three txx9ndfmc
patches. As there are still quite a few drivers to convert, I'm happy
about every patch that makes it in. So even if there is a merge conflict
with one patch until you apply (or a different concern that doesn't
apply to all patches), please apply the remainder of this series anyhow.
I'll come back to the part that you (maybe) skipped at a later point.

Best regards
Uwe

Uwe Kleine-König (20):
  mtd: rawnand: txx9ndfmc: Mark driver struct with __refdata to prevent
    section mismatch warning
  mtd: rawnand: txx9ndfmc: Drop if block with always false condition
  mtd: bcm47xxsflash: Convert to platform remove callback returning void
  mtd: docg3: Convert to platform remove callback returning void
  mtd: phram: Convert to platform remove callback returning void
  mtd: powernv_flash: Convert to platform remove callback returning void
  mtd: spear_smi: Convert to platform remove callback returning void
  mtd: st_spi_fsm: Convert to platform remove callback returning void
  mtd: hyperbus: hbmc-am654: Convert to platform remove callback
    returning void
  mtd: hyperbus: rpc-if: Convert to platform remove callback returning
    void
  mtd: lpddr2_nvm: Convert to platform remove callback returning void
  mtd: maps: lantiq-flash: Convert to platform remove callback returning
    void
  mtd: maps: physmap-core: Convert to platform remove callback returning
    void
  mtd: maps: plat-ram: Convert to platform remove callback returning
    void
  mtd: maps: pxa2xx-flash: Convert to platform remove callback returning
    void
  mtd: maps: sa1100-flash: Convert to platform remove callback returning
    void
  mtd: maps: sun_uflash: Convert to platform remove callback returning
    void
  mtd: rawnand: txx9ndfmc: Convert to platform remove callback returning
    void
  mtd: spi-nor: hisi-sfc: Convert to platform remove callback returning
    void
  mtd: spi-nor: nxp-spifi: Convert to platform remove callback returning
    void

 drivers/mtd/devices/bcm47xxsflash.c         |  6 ++----
 drivers/mtd/devices/docg3.c                 |  5 ++---
 drivers/mtd/devices/phram.c                 |  6 ++----
 drivers/mtd/devices/powernv_flash.c         |  6 ++----
 drivers/mtd/devices/spear_smi.c             |  6 ++----
 drivers/mtd/devices/st_spi_fsm.c            |  6 ++----
 drivers/mtd/hyperbus/hbmc-am654.c           |  6 ++----
 drivers/mtd/hyperbus/rpc-if.c               |  6 ++----
 drivers/mtd/lpddr/lpddr2_nvm.c              |  6 ++----
 drivers/mtd/maps/lantiq-flash.c             |  6 ++----
 drivers/mtd/maps/physmap-core.c             |  5 ++---
 drivers/mtd/maps/plat-ram.c                 |  8 +++-----
 drivers/mtd/maps/pxa2xx-flash.c             |  5 ++---
 drivers/mtd/maps/sa1100-flash.c             |  6 ++----
 drivers/mtd/maps/sun_uflash.c               |  6 ++----
 drivers/mtd/nand/raw/txx9ndfmc.c            | 15 +++++++++------
 drivers/mtd/spi-nor/controllers/hisi-sfc.c  |  5 ++---
 drivers/mtd/spi-nor/controllers/nxp-spifi.c |  6 ++----
 18 files changed, 44 insertions(+), 71 deletions(-)


base-commit: 0bb80ecc33a8fb5a682236443c1e740d5c917d1d
-- 
2.40.1


             reply	other threads:[~2023-10-08 20:03 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-10-08 20:01 Uwe Kleine-König [this message]
2023-10-08 20:01 ` [PATCH 06/20] mtd: powernv_flash: Convert to platform remove callback returning void Uwe Kleine-König
2023-10-16  9:28   ` Miquel Raynal
2023-10-09  6:07 ` [PATCH 00/20] mtd: " 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=20231008200143.196369-1-u.kleine-koenig@pengutronix.de \
    --to=u.kleine-koenig@pengutronix.de \
    --cc=David.Woodhouse@intel.com \
    --cc=akpm@linux-foundation.org \
    --cc=anemo@mba.ocn.ne.jp \
    --cc=christophe.jaillet@wanadoo.fr \
    --cc=frank.li@vivo.com \
    --cc=heiko@sntech.de \
    --cc=joern@lazybastard.org \
    --cc=kernel@pengutronix.de \
    --cc=linus.walleij@linaro.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kbuild@vger.kernel.org \
    --cc=linux-mtd@lists.infradead.org \
    --cc=linuxppc-dev@lists.ozlabs.org \
    --cc=lizetao1@huawei.com \
    --cc=michael@walle.cc \
    --cc=miquel.raynal@bootlin.com \
    --cc=npiggin@gmail.com \
    --cc=pratyush@kernel.org \
    --cc=richard@nod.at \
    --cc=robert.jarzmik@free.fr \
    --cc=robh@kernel.org \
    --cc=tanghui20@huawei.com \
    --cc=tudor.ambarus@linaro.org \
    --cc=vigneshr@ti.com \
    --cc=vz@mleia.com \
    --cc=zhengyongjun3@huawei.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;
as well as URLs for NNTP newsgroup(s).