All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2] mtd: rawnand: atmel: Warn about failure to unregister mtd device
@ 2022-06-07  6:25 ` Uwe Kleine-König
  0 siblings, 0 replies; 4+ messages in thread
From: Uwe Kleine-König @ 2022-06-07  6:25 UTC (permalink / raw)
  To: Tudor Ambarus, Miquel Raynal, Richard Weinberger,
	Vignesh Raghavendra, Nicolas Ferre, Alexandre Belloni,
	Claudiu Beznea
  Cc: linux-mtd, linux-arm-kernel, kernel

The Linux device core doesn't intend remove callbacks to fail. If an
error code is returned the device is removed anyhow. So wail loudly if
the atmel specific remove callback fails and return 0 anyhow to suppress
the generic (and little helpful) error message by the device core.

This is a preparation for making platform remove callbacks return void.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
---
Hello,

this patch was part of a bigger series[1] for (implicit) v1. As the patches
of this series have no interdependencies and all but this one were
were considered ok, I'm just resending this patch, as adviced by Miquel
Raynal.

Best regards
Uwe

[1] https://lore.kernel.org/linux-mtd/20220603210758.148493-9-u.kleine-koenig@pengutronix.de

 drivers/mtd/nand/raw/atmel/nand-controller.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/mtd/nand/raw/atmel/nand-controller.c b/drivers/mtd/nand/raw/atmel/nand-controller.c
index 6ef14442c71a..c9ac3baf68c0 100644
--- a/drivers/mtd/nand/raw/atmel/nand-controller.c
+++ b/drivers/mtd/nand/raw/atmel/nand-controller.c
@@ -2629,7 +2629,9 @@ static int atmel_nand_controller_remove(struct platform_device *pdev)
 {
 	struct atmel_nand_controller *nc = platform_get_drvdata(pdev);
 
-	return nc->caps->ops->remove(nc);
+	WARN_ON(nc->caps->ops->remove(nc));
+
+	return 0;
 }
 
 static __maybe_unused int atmel_nand_controller_resume(struct device *dev)

base-commit: 4b0986a3613c92f4ec1bdc7f60ec66fea135991f
-- 
2.36.1


______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [PATCH v2] mtd: rawnand: atmel: Warn about failure to unregister mtd device
@ 2022-06-07  6:25 ` Uwe Kleine-König
  0 siblings, 0 replies; 4+ messages in thread
From: Uwe Kleine-König @ 2022-06-07  6:25 UTC (permalink / raw)
  To: Tudor Ambarus, Miquel Raynal, Richard Weinberger,
	Vignesh Raghavendra, Nicolas Ferre, Alexandre Belloni,
	Claudiu Beznea
  Cc: linux-mtd, linux-arm-kernel, kernel

The Linux device core doesn't intend remove callbacks to fail. If an
error code is returned the device is removed anyhow. So wail loudly if
the atmel specific remove callback fails and return 0 anyhow to suppress
the generic (and little helpful) error message by the device core.

This is a preparation for making platform remove callbacks return void.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
---
Hello,

this patch was part of a bigger series[1] for (implicit) v1. As the patches
of this series have no interdependencies and all but this one were
were considered ok, I'm just resending this patch, as adviced by Miquel
Raynal.

Best regards
Uwe

[1] https://lore.kernel.org/linux-mtd/20220603210758.148493-9-u.kleine-koenig@pengutronix.de

 drivers/mtd/nand/raw/atmel/nand-controller.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/mtd/nand/raw/atmel/nand-controller.c b/drivers/mtd/nand/raw/atmel/nand-controller.c
index 6ef14442c71a..c9ac3baf68c0 100644
--- a/drivers/mtd/nand/raw/atmel/nand-controller.c
+++ b/drivers/mtd/nand/raw/atmel/nand-controller.c
@@ -2629,7 +2629,9 @@ static int atmel_nand_controller_remove(struct platform_device *pdev)
 {
 	struct atmel_nand_controller *nc = platform_get_drvdata(pdev);
 
-	return nc->caps->ops->remove(nc);
+	WARN_ON(nc->caps->ops->remove(nc));
+
+	return 0;
 }
 
 static __maybe_unused int atmel_nand_controller_resume(struct device *dev)

base-commit: 4b0986a3613c92f4ec1bdc7f60ec66fea135991f
-- 
2.36.1


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH v2] mtd: rawnand: atmel: Warn about failure to unregister mtd device
  2022-06-07  6:25 ` Uwe Kleine-König
@ 2022-06-09 13:09   ` Miquel Raynal
  -1 siblings, 0 replies; 4+ messages in thread
From: Miquel Raynal @ 2022-06-09 13:09 UTC (permalink / raw)
  To: Uwe Kleine-König, Tudor Ambarus, Miquel Raynal,
	Richard Weinberger, Vignesh Raghavendra, Nicolas Ferre,
	Alexandre Belloni, Claudiu Beznea
  Cc: linux-mtd, linux-arm-kernel, kernel

On Tue, 2022-06-07 at 06:25:03 UTC, =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= wrote:
> The Linux device core doesn't intend remove callbacks to fail. If an
> error code is returned the device is removed anyhow. So wail loudly if
> the atmel specific remove callback fails and return 0 anyhow to suppress
> the generic (and little helpful) error message by the device core.
> 
> This is a preparation for making platform remove callbacks return void.
> 
> 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] 4+ messages in thread

* Re: [PATCH v2] mtd: rawnand: atmel: Warn about failure to unregister mtd device
@ 2022-06-09 13:09   ` Miquel Raynal
  0 siblings, 0 replies; 4+ messages in thread
From: Miquel Raynal @ 2022-06-09 13:09 UTC (permalink / raw)
  To: Uwe Kleine-König, Tudor Ambarus, Miquel Raynal,
	Richard Weinberger, Vignesh Raghavendra, Nicolas Ferre,
	Alexandre Belloni, Claudiu Beznea
  Cc: linux-mtd, linux-arm-kernel, kernel

On Tue, 2022-06-07 at 06:25:03 UTC, =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= wrote:
> The Linux device core doesn't intend remove callbacks to fail. If an
> error code is returned the device is removed anyhow. So wail loudly if
> the atmel specific remove callback fails and return 0 anyhow to suppress
> the generic (and little helpful) error message by the device core.
> 
> This is a preparation for making platform remove callbacks return void.
> 
> 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-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2022-06-09 13:10 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-06-07  6:25 [PATCH v2] mtd: rawnand: atmel: Warn about failure to unregister mtd device Uwe Kleine-König
2022-06-07  6:25 ` Uwe Kleine-König
2022-06-09 13:09 ` Miquel Raynal
2022-06-09 13:09   ` Miquel Raynal

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.