From: "Uwe Kleine-König" <u.kleine-koenig@pengutronix.de> To: Miquel Raynal <miquel.raynal@bootlin.com>, Vignesh Raghavendra <vigneshr@ti.com>, Vladimir Zapolskiy <vz@mleia.com>, Geert Uytterhoeven <geert@linux-m68k.org>, Dmitry Torokhov <dmitry.torokhov@gmail.com> Cc: Richard Weinberger <richard@nod.at>, linux-mtd@lists.infradead.org, linux-arm-kernel@lists.infradead.org, kernel@pengutronix.de Subject: [PATCH 22/49] mtd: rawnand: lpc32xx_mlc: Convert to platform remove callback returning void Date: Sat, 1 Apr 2023 18:19:11 +0200 [thread overview] Message-ID: <20230401161938.2503204-23-u.kleine-koenig@pengutronix.de> (raw) In-Reply-To: <20230401161938.2503204-1-u.kleine-koenig@pengutronix.de> The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is (mostly) ignored and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> --- drivers/mtd/nand/raw/lpc32xx_mlc.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/mtd/nand/raw/lpc32xx_mlc.c b/drivers/mtd/nand/raw/lpc32xx_mlc.c index ae7f6429a5f6..b3136ae6f4e9 100644 --- a/drivers/mtd/nand/raw/lpc32xx_mlc.c +++ b/drivers/mtd/nand/raw/lpc32xx_mlc.c @@ -827,7 +827,7 @@ static int lpc32xx_nand_probe(struct platform_device *pdev) /* * Remove NAND device */ -static int lpc32xx_nand_remove(struct platform_device *pdev) +static void lpc32xx_nand_remove(struct platform_device *pdev) { struct lpc32xx_nand_host *host = platform_get_drvdata(pdev); struct nand_chip *chip = &host->nand_chip; @@ -846,8 +846,6 @@ static int lpc32xx_nand_remove(struct platform_device *pdev) lpc32xx_wp_enable(host); gpiod_put(host->wp_gpio); - - return 0; } static int lpc32xx_nand_resume(struct platform_device *pdev) @@ -889,7 +887,7 @@ MODULE_DEVICE_TABLE(of, lpc32xx_nand_match); static struct platform_driver lpc32xx_nand_driver = { .probe = lpc32xx_nand_probe, - .remove = lpc32xx_nand_remove, + .remove_new = lpc32xx_nand_remove, .resume = pm_ptr(lpc32xx_nand_resume), .suspend = pm_ptr(lpc32xx_nand_suspend), .driver = { -- 2.39.2 ______________________________________________________ Linux MTD discussion mailing list http://lists.infradead.org/mailman/listinfo/linux-mtd/
WARNING: multiple messages have this Message-ID (diff)
From: "Uwe Kleine-König" <u.kleine-koenig@pengutronix.de> To: Miquel Raynal <miquel.raynal@bootlin.com>, Vignesh Raghavendra <vigneshr@ti.com>, Vladimir Zapolskiy <vz@mleia.com>, Geert Uytterhoeven <geert@linux-m68k.org>, Dmitry Torokhov <dmitry.torokhov@gmail.com> Cc: Richard Weinberger <richard@nod.at>, linux-mtd@lists.infradead.org, linux-arm-kernel@lists.infradead.org, kernel@pengutronix.de Subject: [PATCH 22/49] mtd: rawnand: lpc32xx_mlc: Convert to platform remove callback returning void Date: Sat, 1 Apr 2023 18:19:11 +0200 [thread overview] Message-ID: <20230401161938.2503204-23-u.kleine-koenig@pengutronix.de> (raw) In-Reply-To: <20230401161938.2503204-1-u.kleine-koenig@pengutronix.de> The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is (mostly) ignored and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> --- drivers/mtd/nand/raw/lpc32xx_mlc.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/mtd/nand/raw/lpc32xx_mlc.c b/drivers/mtd/nand/raw/lpc32xx_mlc.c index ae7f6429a5f6..b3136ae6f4e9 100644 --- a/drivers/mtd/nand/raw/lpc32xx_mlc.c +++ b/drivers/mtd/nand/raw/lpc32xx_mlc.c @@ -827,7 +827,7 @@ static int lpc32xx_nand_probe(struct platform_device *pdev) /* * Remove NAND device */ -static int lpc32xx_nand_remove(struct platform_device *pdev) +static void lpc32xx_nand_remove(struct platform_device *pdev) { struct lpc32xx_nand_host *host = platform_get_drvdata(pdev); struct nand_chip *chip = &host->nand_chip; @@ -846,8 +846,6 @@ static int lpc32xx_nand_remove(struct platform_device *pdev) lpc32xx_wp_enable(host); gpiod_put(host->wp_gpio); - - return 0; } static int lpc32xx_nand_resume(struct platform_device *pdev) @@ -889,7 +887,7 @@ MODULE_DEVICE_TABLE(of, lpc32xx_nand_match); static struct platform_driver lpc32xx_nand_driver = { .probe = lpc32xx_nand_probe, - .remove = lpc32xx_nand_remove, + .remove_new = lpc32xx_nand_remove, .resume = pm_ptr(lpc32xx_nand_resume), .suspend = pm_ptr(lpc32xx_nand_suspend), .driver = { -- 2.39.2 _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
next prev parent reply other threads:[~2023-04-01 16:20 UTC|newest] Thread overview: 118+ messages / expand[flat|nested] mbox.gz Atom feed top 2023-04-01 16:18 [PATCH 00/49] mtd: nand: Convert to platform remove callback returning void Uwe Kleine-König 2023-04-01 16:18 ` Uwe Kleine-König 2023-04-01 16:18 ` Uwe Kleine-König 2023-04-01 16:18 ` Uwe Kleine-König 2023-04-01 16:18 ` [PATCH 01/49] mtd: nand: mxic-ecc: " Uwe Kleine-König 2023-04-01 16:18 ` [PATCH 02/49] mtd: onenand: generic: " Uwe Kleine-König 2023-04-01 16:18 ` [PATCH 03/49] mtd: onenand: omap2: " Uwe Kleine-König 2023-04-01 16:18 ` [PATCH 04/49] mtd: onenand: samsung: " Uwe Kleine-König 2023-04-01 16:18 ` [PATCH 05/49] mtd: rawnand: ams-delta: " Uwe Kleine-König 2023-04-01 16:18 ` [PATCH 06/49] mtd: rawnand: arasan: " Uwe Kleine-König 2023-04-01 16:18 ` [PATCH 07/49] mtd: rawnand: atmel: " Uwe Kleine-König 2023-04-01 16:18 ` Uwe Kleine-König 2023-04-03 8:37 ` Nicolas Ferre 2023-04-03 8:37 ` Nicolas Ferre 2023-04-01 16:18 ` [PATCH 08/49] mtd: rawnand: au1550nd: " Uwe Kleine-König 2023-04-01 16:18 ` [PATCH 09/49] mtd: rawnand: bcm47xxnflash: " Uwe Kleine-König 2023-04-01 16:18 ` [PATCH 10/49] mtd: rawnand: cadence: " Uwe Kleine-König 2023-04-01 16:19 ` [PATCH 11/49] mtd: rawnand: davinci: " Uwe Kleine-König 2023-04-01 16:19 ` [PATCH 12/49] mtd: rawnand: denali_dt: " Uwe Kleine-König 2023-04-01 16:19 ` [PATCH 13/49] mtd: rawnand: fsl_elbc: " Uwe Kleine-König 2023-04-01 16:19 ` [PATCH 14/49] mtd: rawnand: fsl_ifc: " Uwe Kleine-König 2023-04-01 16:19 ` [PATCH 15/49] mtd: rawnand: fsl_upm: " Uwe Kleine-König 2023-04-01 16:19 ` [PATCH 16/49] mtd: rawnand: fsmc: " Uwe Kleine-König 2023-04-01 16:19 ` [PATCH 17/49] mtd: rawnand: gpio: " Uwe Kleine-König 2023-04-01 16:19 ` [PATCH 18/49] mtd: rawnand: gpmi: " Uwe Kleine-König 2023-04-01 16:19 ` [PATCH 19/49] mtd: rawnand: hisi504: " Uwe Kleine-König 2023-04-01 16:19 ` [PATCH 20/49] mtd: rawnand: ingenic: " Uwe Kleine-König 2023-04-01 16:19 ` Uwe Kleine-König 2023-04-01 16:42 ` Paul Cercueil 2023-04-01 16:42 ` Paul Cercueil 2023-04-06 12:14 ` Philippe Mathieu-Daudé 2023-04-06 12:14 ` Philippe Mathieu-Daudé 2023-04-01 16:19 ` [PATCH 21/49] mtd: rawnand: intel: " Uwe Kleine-König 2023-04-01 21:24 ` Martin Blumenstingl 2023-04-01 16:19 ` Uwe Kleine-König [this message] 2023-04-01 16:19 ` [PATCH 22/49] mtd: rawnand: lpc32xx_mlc: " Uwe Kleine-König 2023-04-01 16:19 ` [PATCH 23/49] mtd: rawnand: lpc32xx_slc: " Uwe Kleine-König 2023-04-01 16:19 ` Uwe Kleine-König 2023-04-01 16:19 ` [PATCH 24/49] mtd: rawnand: marvell: " Uwe Kleine-König 2023-04-01 16:19 ` [PATCH 25/49] mtd: rawnand: meson: " Uwe Kleine-König 2023-04-01 16:19 ` Uwe Kleine-König 2023-04-01 16:19 ` Uwe Kleine-König 2023-04-01 21:31 ` Martin Blumenstingl 2023-04-01 21:31 ` Martin Blumenstingl 2023-04-01 21:31 ` Martin Blumenstingl 2023-04-01 16:19 ` [PATCH 26/49] mtd: rawnand: mpc5121_nfc: " Uwe Kleine-König 2023-04-01 16:19 ` [PATCH 27/49] mtd: rawnand: mtk: " Uwe Kleine-König 2023-04-01 16:19 ` Uwe Kleine-König 2023-04-01 16:19 ` Uwe Kleine-König 2023-04-01 16:19 ` [PATCH 28/49] mtd: rawnand: mxc: " Uwe Kleine-König 2023-04-01 16:19 ` [PATCH 29/49] mtd: rawnand: mxic: " Uwe Kleine-König 2023-04-01 16:19 ` [PATCH 30/49] mtd: rawnand: ndfc: " Uwe Kleine-König 2023-04-01 16:19 ` [PATCH 31/49] mtd: rawnand: omap2: " Uwe Kleine-König 2023-04-01 16:19 ` [PATCH 32/49] mtd: rawnand: omap_elm: " Uwe Kleine-König 2023-04-03 10:55 ` Roger Quadros 2023-04-01 16:19 ` [PATCH 33/49] mtd: rawnand: orion: " Uwe Kleine-König 2023-04-01 16:19 ` [PATCH 34/49] mtd: rawnand: oxnas: " Uwe Kleine-König 2023-04-01 16:19 ` Uwe Kleine-König 2023-04-01 16:19 ` [PATCH 35/49] mtd: rawnand: pasemi: " Uwe Kleine-König 2023-04-01 16:19 ` [PATCH 36/49] mtd: rawnand: pl35x: " Uwe Kleine-König 2023-04-01 16:19 ` [PATCH 37/49] mtd: rawnand: plat: " Uwe Kleine-König 2023-04-01 16:19 ` [PATCH 38/49] mtd: rawnand: qcom: " Uwe Kleine-König 2023-04-01 16:19 ` Uwe Kleine-König 2023-04-01 16:19 ` [PATCH 39/49] mtd: rawnand: renesas: " Uwe Kleine-König 2023-04-01 16:19 ` Uwe Kleine-König 2023-04-03 7:18 ` Geert Uytterhoeven 2023-04-03 7:18 ` Geert Uytterhoeven 2023-04-01 16:19 ` [PATCH 40/49] mtd: rawnand: rockchip: " Uwe Kleine-König 2023-04-01 16:19 ` Uwe Kleine-König 2023-04-01 16:19 ` Uwe Kleine-König 2023-04-01 19:04 ` Heiko Stübner 2023-04-01 19:04 ` Heiko Stübner 2023-04-01 19:04 ` Heiko Stübner 2023-04-01 16:19 ` [PATCH 41/49] mtd: rawnand: s3c2410: " Uwe Kleine-König 2023-04-01 16:19 ` [PATCH 42/49] mtd: rawnand: sh_flctl: " Uwe Kleine-König 2023-04-01 16:19 ` [PATCH 43/49] mtd: rawnand: sharpsl: " Uwe Kleine-König 2023-04-01 16:19 ` [PATCH 44/49] mtd: rawnand: socrates: " Uwe Kleine-König 2023-04-01 16:19 ` [PATCH 45/49] mtd: rawnand: stm32_fmc2: " Uwe Kleine-König 2023-04-01 16:19 ` Uwe Kleine-König 2023-04-01 16:19 ` [PATCH 46/49] mtd: rawnand: sunxi: " Uwe Kleine-König 2023-04-01 16:19 ` Uwe Kleine-König 2023-04-01 16:19 ` Uwe Kleine-König 2023-04-01 16:31 ` Jernej Škrabec 2023-04-01 16:31 ` Jernej Škrabec 2023-04-01 16:31 ` Jernej Škrabec 2023-04-01 16:19 ` [PATCH 47/49] mtd: rawnand: tegra: " Uwe Kleine-König 2023-04-01 16:19 ` Uwe Kleine-König 2023-04-05 11:13 ` Thierry Reding 2023-04-05 11:13 ` Thierry Reding 2023-04-01 16:19 ` [PATCH 48/49] mtd: rawnand: vf610_nfc: " Uwe Kleine-König 2023-04-01 16:19 ` [PATCH 49/49] mtd: rawnand: xway: " Uwe Kleine-König 2023-04-03 16:29 ` [PATCH 00/49] mtd: nand: " Tudor Ambarus 2023-04-03 16:29 ` Tudor Ambarus 2023-04-03 16:29 ` Tudor Ambarus 2023-04-03 16:29 ` Tudor Ambarus 2023-04-07 8:10 ` Miquel Raynal 2023-04-07 8:10 ` Miquel Raynal 2023-04-07 8:10 ` Miquel Raynal 2023-04-07 8:10 ` Miquel Raynal 2023-04-08 18:53 ` [PATCH] " Uwe Kleine-König 2023-04-08 18:53 ` Uwe Kleine-König 2023-04-08 18:53 ` Uwe Kleine-König 2023-04-08 18:53 ` Uwe Kleine-König 2023-04-10 5:08 ` Vanessa Page 2023-04-10 5:37 ` Tudor Ambarus 2023-04-10 5:37 ` Tudor Ambarus 2023-04-10 5:37 ` Tudor Ambarus 2023-04-10 5:37 ` Tudor Ambarus 2023-04-11 8:20 ` Miquel Raynal 2023-04-11 8:20 ` Miquel Raynal 2023-04-11 8:20 ` Miquel Raynal 2023-04-11 8:20 ` Miquel Raynal 2023-04-11 11:11 ` Uwe Kleine-König 2023-04-11 11:11 ` Uwe Kleine-König 2023-04-11 11:11 ` Uwe Kleine-König 2023-04-11 11:11 ` Uwe Kleine-König 2023-04-11 11:26 ` Uwe Kleine-König 2023-04-11 12:50 ` Miquel Raynal
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=20230401161938.2503204-23-u.kleine-koenig@pengutronix.de \ --to=u.kleine-koenig@pengutronix.de \ --cc=dmitry.torokhov@gmail.com \ --cc=geert@linux-m68k.org \ --cc=kernel@pengutronix.de \ --cc=linux-arm-kernel@lists.infradead.org \ --cc=linux-mtd@lists.infradead.org \ --cc=miquel.raynal@bootlin.com \ --cc=richard@nod.at \ --cc=vigneshr@ti.com \ --cc=vz@mleia.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: linkBe sure your reply has a Subject: header at the top and a blank line before the message body.
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.