* [PATCH 1/4] mtd: dataflash: Warn about failure to unregister mtd device
@ 2021-11-08 9:31 Uwe Kleine-König
2021-11-08 9:31 ` [PATCH 2/4] mtd: mchp23k256: " Uwe Kleine-König
` (3 more replies)
0 siblings, 4 replies; 8+ messages in thread
From: Uwe Kleine-König @ 2021-11-08 9:31 UTC (permalink / raw)
To: Miquel Raynal, Richard Weinberger, Vignesh Raghavendra
Cc: Mark Brown, linux-mtd, kernel, linux-spi
mtd_device_unregister() shouldn't fail. Wail loudly if it does anyhow.
This matches how other drivers (e.g. nand/raw/nandsim.c) use
mtd_device_unregister().
By returning 0 in the spi remove callback a generic error message by the
spi framework (and nothing else) is suppressed.
Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
---
drivers/mtd/devices/mtd_dataflash.c | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)
diff --git a/drivers/mtd/devices/mtd_dataflash.c b/drivers/mtd/devices/mtd_dataflash.c
index 9802e265fca8..293cab758299 100644
--- a/drivers/mtd/devices/mtd_dataflash.c
+++ b/drivers/mtd/devices/mtd_dataflash.c
@@ -912,14 +912,14 @@ static int dataflash_probe(struct spi_device *spi)
static int dataflash_remove(struct spi_device *spi)
{
struct dataflash *flash = spi_get_drvdata(spi);
- int status;
dev_dbg(&spi->dev, "remove\n");
- status = mtd_device_unregister(&flash->mtd);
- if (status == 0)
- kfree(flash);
- return status;
+ WARN_ON(mtd_device_unregister(&flash->mtd));
+
+ kfree(flash);
+
+ return 0;
}
static struct spi_driver dataflash_driver = {
base-commit: 6b75d88fa81b122cce37ebf17428a849ccd3d0f1
--
2.30.2
______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/
^ permalink raw reply related [flat|nested] 8+ messages in thread
* [PATCH 2/4] mtd: mchp23k256: Warn about failure to unregister mtd device
2021-11-08 9:31 [PATCH 1/4] mtd: dataflash: Warn about failure to unregister mtd device Uwe Kleine-König
@ 2021-11-08 9:31 ` Uwe Kleine-König
2021-11-19 18:35 ` Miquel Raynal
2021-11-08 9:31 ` [PATCH 3/4] mtd: mchp48l640: " Uwe Kleine-König
` (2 subsequent siblings)
3 siblings, 1 reply; 8+ messages in thread
From: Uwe Kleine-König @ 2021-11-08 9:31 UTC (permalink / raw)
To: Miquel Raynal, Richard Weinberger, Vignesh Raghavendra
Cc: Mark Brown, linux-mtd, kernel, linux-spi
mtd_device_unregister() shouldn't fail. Wail loudly if it does anyhow.
This matches how other drivers (e.g. nand/raw/nandsim.c) use
mtd_device_unregister().
By returning 0 in the spi remove callback a generic error message by the
spi framework (and nothing else) is suppressed.
Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
---
drivers/mtd/devices/mchp23k256.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/drivers/mtd/devices/mchp23k256.c b/drivers/mtd/devices/mchp23k256.c
index 77c872fd3d83..a8b31bddf14b 100644
--- a/drivers/mtd/devices/mchp23k256.c
+++ b/drivers/mtd/devices/mchp23k256.c
@@ -213,7 +213,9 @@ static int mchp23k256_remove(struct spi_device *spi)
{
struct mchp23k256_flash *flash = spi_get_drvdata(spi);
- return mtd_device_unregister(&flash->mtd);
+ WARN_ON(mtd_device_unregister(&flash->mtd));
+
+ return 0;
}
static const struct of_device_id mchp23k256_of_table[] = {
--
2.30.2
______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/
^ permalink raw reply related [flat|nested] 8+ messages in thread
* [PATCH 3/4] mtd: mchp48l640: Warn about failure to unregister mtd device
2021-11-08 9:31 [PATCH 1/4] mtd: dataflash: Warn about failure to unregister mtd device Uwe Kleine-König
2021-11-08 9:31 ` [PATCH 2/4] mtd: mchp23k256: " Uwe Kleine-König
@ 2021-11-08 9:31 ` Uwe Kleine-König
2021-11-19 18:35 ` Miquel Raynal
2021-11-08 9:31 ` [PATCH 4/4] mtd: sst25l: " Uwe Kleine-König
2021-11-19 18:35 ` [PATCH 1/4] mtd: dataflash: " Miquel Raynal
3 siblings, 1 reply; 8+ messages in thread
From: Uwe Kleine-König @ 2021-11-08 9:31 UTC (permalink / raw)
To: Miquel Raynal, Richard Weinberger, Vignesh Raghavendra
Cc: Mark Brown, linux-mtd, kernel, linux-spi
mtd_device_unregister() shouldn't fail. Wail loudly if it does anyhow.
This matches how other drivers (e.g. nand/raw/nandsim.c) use
mtd_device_unregister().
By returning 0 in the spi remove callback a generic error message by the
spi framework (and nothing else) is suppressed.
Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
---
drivers/mtd/devices/mchp48l640.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/drivers/mtd/devices/mchp48l640.c b/drivers/mtd/devices/mchp48l640.c
index 99400d0fb8c1..231a10790196 100644
--- a/drivers/mtd/devices/mchp48l640.c
+++ b/drivers/mtd/devices/mchp48l640.c
@@ -345,7 +345,9 @@ static int mchp48l640_remove(struct spi_device *spi)
{
struct mchp48l640_flash *flash = spi_get_drvdata(spi);
- return mtd_device_unregister(&flash->mtd);
+ WARN_ON(mtd_device_unregister(&flash->mtd));
+
+ return 0;
}
static const struct of_device_id mchp48l640_of_table[] = {
--
2.30.2
______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/
^ permalink raw reply related [flat|nested] 8+ messages in thread
* [PATCH 4/4] mtd: sst25l: Warn about failure to unregister mtd device
2021-11-08 9:31 [PATCH 1/4] mtd: dataflash: Warn about failure to unregister mtd device Uwe Kleine-König
2021-11-08 9:31 ` [PATCH 2/4] mtd: mchp23k256: " Uwe Kleine-König
2021-11-08 9:31 ` [PATCH 3/4] mtd: mchp48l640: " Uwe Kleine-König
@ 2021-11-08 9:31 ` Uwe Kleine-König
2021-11-19 18:34 ` Miquel Raynal
2021-11-19 18:35 ` [PATCH 1/4] mtd: dataflash: " Miquel Raynal
3 siblings, 1 reply; 8+ messages in thread
From: Uwe Kleine-König @ 2021-11-08 9:31 UTC (permalink / raw)
To: Miquel Raynal, Richard Weinberger, Vignesh Raghavendra
Cc: Mark Brown, linux-mtd, kernel, linux-spi
mtd_device_unregister() shouldn't fail. Wail loudly if it does anyhow.
This matches how other drivers (e.g. nand/raw/nandsim.c) use
mtd_device_unregister().
By returning 0 in the spi remove callback a generic error message by the
spi framework (and nothing else) is suppressed.
Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
---
drivers/mtd/devices/sst25l.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/drivers/mtd/devices/sst25l.c b/drivers/mtd/devices/sst25l.c
index b81c3f0b85f9..7f124c1bfa40 100644
--- a/drivers/mtd/devices/sst25l.c
+++ b/drivers/mtd/devices/sst25l.c
@@ -402,7 +402,9 @@ static int sst25l_remove(struct spi_device *spi)
{
struct sst25l_flash *flash = spi_get_drvdata(spi);
- return mtd_device_unregister(&flash->mtd);
+ WARN_ON(mtd_device_unregister(&flash->mtd));
+
+ return 0;
}
static struct spi_driver sst25l_driver = {
--
2.30.2
______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/
^ permalink raw reply related [flat|nested] 8+ messages in thread
* Re: [PATCH 4/4] mtd: sst25l: Warn about failure to unregister mtd device
2021-11-08 9:31 ` [PATCH 4/4] mtd: sst25l: " Uwe Kleine-König
@ 2021-11-19 18:34 ` Miquel Raynal
0 siblings, 0 replies; 8+ messages in thread
From: Miquel Raynal @ 2021-11-19 18:34 UTC (permalink / raw)
To: Uwe Kleine-König, Miquel Raynal, Richard Weinberger,
Vignesh Raghavendra
Cc: Mark Brown, linux-mtd, kernel, linux-spi
On Mon, 2021-11-08 at 09:31:52 UTC, =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= wrote:
> mtd_device_unregister() shouldn't fail. Wail loudly if it does anyhow.
>
> This matches how other drivers (e.g. nand/raw/nandsim.c) use
> mtd_device_unregister().
>
> By returning 0 in the spi remove callback a generic error message by the
> spi framework (and nothing else) is suppressed.
>
> Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Applied to https://git.kernel.org/pub/scm/linux/kernel/git/mtd/linux.git mtd/next, thanks.
Miquel
______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH 3/4] mtd: mchp48l640: Warn about failure to unregister mtd device
2021-11-08 9:31 ` [PATCH 3/4] mtd: mchp48l640: " Uwe Kleine-König
@ 2021-11-19 18:35 ` Miquel Raynal
0 siblings, 0 replies; 8+ messages in thread
From: Miquel Raynal @ 2021-11-19 18:35 UTC (permalink / raw)
To: Uwe Kleine-König, Miquel Raynal, Richard Weinberger,
Vignesh Raghavendra
Cc: Mark Brown, linux-mtd, kernel, linux-spi
On Mon, 2021-11-08 at 09:31:51 UTC, =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= wrote:
> mtd_device_unregister() shouldn't fail. Wail loudly if it does anyhow.
>
> This matches how other drivers (e.g. nand/raw/nandsim.c) use
> mtd_device_unregister().
>
> By returning 0 in the spi remove callback a generic error message by the
> spi framework (and nothing else) is suppressed.
>
> Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Applied to https://git.kernel.org/pub/scm/linux/kernel/git/mtd/linux.git mtd/next, thanks.
Miquel
______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH 2/4] mtd: mchp23k256: Warn about failure to unregister mtd device
2021-11-08 9:31 ` [PATCH 2/4] mtd: mchp23k256: " Uwe Kleine-König
@ 2021-11-19 18:35 ` Miquel Raynal
0 siblings, 0 replies; 8+ messages in thread
From: Miquel Raynal @ 2021-11-19 18:35 UTC (permalink / raw)
To: Uwe Kleine-König, Miquel Raynal, Richard Weinberger,
Vignesh Raghavendra
Cc: Mark Brown, linux-mtd, kernel, linux-spi
On Mon, 2021-11-08 at 09:31:50 UTC, =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= wrote:
> mtd_device_unregister() shouldn't fail. Wail loudly if it does anyhow.
>
> This matches how other drivers (e.g. nand/raw/nandsim.c) use
> mtd_device_unregister().
>
> By returning 0 in the spi remove callback a generic error message by the
> spi framework (and nothing else) is suppressed.
>
> Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Applied to https://git.kernel.org/pub/scm/linux/kernel/git/mtd/linux.git mtd/next, thanks.
Miquel
______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH 1/4] mtd: dataflash: Warn about failure to unregister mtd device
2021-11-08 9:31 [PATCH 1/4] mtd: dataflash: Warn about failure to unregister mtd device Uwe Kleine-König
` (2 preceding siblings ...)
2021-11-08 9:31 ` [PATCH 4/4] mtd: sst25l: " Uwe Kleine-König
@ 2021-11-19 18:35 ` Miquel Raynal
3 siblings, 0 replies; 8+ messages in thread
From: Miquel Raynal @ 2021-11-19 18:35 UTC (permalink / raw)
To: Uwe Kleine-König, Miquel Raynal, Richard Weinberger,
Vignesh Raghavendra
Cc: Mark Brown, linux-mtd, kernel, linux-spi
On Mon, 2021-11-08 at 09:31:49 UTC, =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= wrote:
> mtd_device_unregister() shouldn't fail. Wail loudly if it does anyhow.
>
> This matches how other drivers (e.g. nand/raw/nandsim.c) use
> mtd_device_unregister().
>
> By returning 0 in the spi remove callback a generic error message by the
> spi framework (and nothing else) is suppressed.
>
> Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Applied to https://git.kernel.org/pub/scm/linux/kernel/git/mtd/linux.git mtd/next, thanks.
Miquel
______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/
^ permalink raw reply [flat|nested] 8+ messages in thread
end of thread, other threads:[~2021-11-19 18:36 UTC | newest]
Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-11-08 9:31 [PATCH 1/4] mtd: dataflash: Warn about failure to unregister mtd device Uwe Kleine-König
2021-11-08 9:31 ` [PATCH 2/4] mtd: mchp23k256: " Uwe Kleine-König
2021-11-19 18:35 ` Miquel Raynal
2021-11-08 9:31 ` [PATCH 3/4] mtd: mchp48l640: " Uwe Kleine-König
2021-11-19 18:35 ` Miquel Raynal
2021-11-08 9:31 ` [PATCH 4/4] mtd: sst25l: " Uwe Kleine-König
2021-11-19 18:34 ` Miquel Raynal
2021-11-19 18:35 ` [PATCH 1/4] mtd: dataflash: " Miquel Raynal
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).