From nobody Sun Feb 8 09:16:52 2026 Received: from metis.whiteo.stw.pengutronix.de (metis.whiteo.stw.pengutronix.de [185.203.201.7]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 5521C45943 for ; Wed, 21 Feb 2024 09:54:24 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=185.203.201.7 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708509266; cv=none; b=fGM4qLYRjlYQ0ttuL5FJ4K7pCXga9XBtsHrEQNfrE27P+rGKXEEXGWO7BfVzxokXJpSE0vQmz2J//u2SUuwzVJzI5ONzQLOHYylZhmyaTxSc37l65riCTACyyJ3SqwmQI52JC0hP/D+l8u5cEjmxWSwGtXBnogXqk4iWG69OVhc= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708509266; c=relaxed/simple; bh=Y12US4C+WpRtTcOYvQXBN1eT1BAAVd09UhWYjrdPEuA=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=Igd7EuZw+DHv/s+3GsNlM14UfliZTaDckgcUGlVXbV+3Q57EfE/PrjU2bQrOHJBS3Kpn2hxavuEVhC06xdteY8xNEuWoQ0VUpmusbxjS/cLyips8t4gY4CfkqC402Vstd+hpgwdJaoSU3htpYav5beNvXCcCuxi2+EajPGgi2XE= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=pengutronix.de; spf=pass smtp.mailfrom=pengutronix.de; arc=none smtp.client-ip=185.203.201.7 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=pengutronix.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=pengutronix.de Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.whiteo.stw.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1rcjIp-0007GU-44; Wed, 21 Feb 2024 10:54:11 +0100 Received: from [2a0a:edc0:0:900:1d::77] (helo=ptz.office.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1rcjIo-0020pL-Cd; Wed, 21 Feb 2024 10:54:10 +0100 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.96) (envelope-from ) id 1rcjIo-008mZ5-0z; Wed, 21 Feb 2024 10:54:10 +0100 From: =?UTF-8?q?Uwe=20Kleine-K=C3=B6nig?= To: Arnd Bergmann , Greg Kroah-Hartman Cc: kernel@pengutronix.de, Claudiu Beznea , Nicolas Ferre , Alexandre Belloni , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [PATCH 01/11] misc: atmel-ssc: Convert to platform remove callback returning void Date: Wed, 21 Feb 2024 10:53:45 +0100 Message-ID: <45719fc31bb893bb9ab1450057e9cb7f399e9ee2.1708508896.git.u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.43.0 In-Reply-To: References: Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" X-Developer-Signature: v=1; a=openpgp-sha256; l=1745; i=u.kleine-koenig@pengutronix.de; h=from:subject:message-id; bh=Y12US4C+WpRtTcOYvQXBN1eT1BAAVd09UhWYjrdPEuA=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBl1cgr2tbo0Q/3qRAJuARuaXItbnWGugcp9POOK W5AvGtmhbqJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZdXIKwAKCRCPgPtYfRL+ TnN6CACloQR+H7u0kOPEPLRucMXlrOPNZwitEdE/qVCXMT1E8X6LEmDLkoSUCW4dkuX33c1t/4Q GxSJ57XRUTivvl07ita9G85rDW/qdzXeDRA2WVdfn7002TSZUb91TjSfA7Zb23aC0l0QBp/e36v LxM6TnMFGa14GmvuKdIwDACXLr8D3qchqvdHF0an1Ze2Y9Ad26MOgSZejPYfNi2YxEGB1y+TgwA GL270oYjPgPziv9fTufK7RcDRSYEDOOatU6p57nVJ9qmaKJI5AOgoXcwWRmhZN6We/owjE8GcCH ueBVQCjvLGLnQy8HLnbUaq4W4eCtpqmlE/Tno3azHtM1YwI9 X-Developer-Key: i=u.kleine-koenig@pengutronix.de; a=openpgp; fpr=0D2511F322BFAB1C1580266BE2DCDD9132669BD6 Content-Transfer-Encoding: quoted-printable X-SA-Exim-Connect-IP: 2a0a:edc0:0:c01:1d::a2 X-SA-Exim-Mail-From: ukl@pengutronix.de X-SA-Exim-Scanned: No (on metis.whiteo.stw.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-kernel@vger.kernel.org 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 ignored (apart from emitting a warning) 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. Eventually after all drivers are converted, .remove_new() will be renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-K=C3=B6nig Acked-by: Arnd Bergmann Acked-by: Nicolas Ferre --- drivers/misc/atmel-ssc.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/misc/atmel-ssc.c b/drivers/misc/atmel-ssc.c index ee590c4a1537..6eac0f335915 100644 --- a/drivers/misc/atmel-ssc.c +++ b/drivers/misc/atmel-ssc.c @@ -251,7 +251,7 @@ static int ssc_probe(struct platform_device *pdev) return 0; } =20 -static int ssc_remove(struct platform_device *pdev) +static void ssc_remove(struct platform_device *pdev) { struct ssc_device *ssc =3D platform_get_drvdata(pdev); =20 @@ -260,8 +260,6 @@ static int ssc_remove(struct platform_device *pdev) mutex_lock(&user_lock); list_del(&ssc->list); mutex_unlock(&user_lock); - - return 0; } =20 static struct platform_driver ssc_driver =3D { @@ -271,7 +269,7 @@ static struct platform_driver ssc_driver =3D { }, .id_table =3D atmel_ssc_devtypes, .probe =3D ssc_probe, - .remove =3D ssc_remove, + .remove_new =3D ssc_remove, }; module_platform_driver(ssc_driver); =20 --=20 2.43.0 From nobody Sun Feb 8 09:16:52 2026 Received: from metis.whiteo.stw.pengutronix.de (metis.whiteo.stw.pengutronix.de [185.203.201.7]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 5527545945 for ; Wed, 21 Feb 2024 09:54:24 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=185.203.201.7 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708509266; cv=none; b=JilQwnxM6AwvzimdfzPh2AY9f5g6Kkt+nXaQ6174L72o2pd7LuSljr4iBCAUbbax46M5GIVl6YUJ9RVh1AEOvd1AwbG6S3XNZKT4ZQ/BY00xdW5OvMjw4VYSjYIgmXmE9JC0zzsTUtEZ4Ey6tvko3bdiBD41Xh4zTSBHW/tmYMc= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708509266; c=relaxed/simple; bh=ceIfAJGD21yqrCu3pRBnl7qS6woYhZWPmCbj1WktHEw=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=n92wZDK5OZW6q7svlTZUsY+zO4zwubOaCFFnPxwX+UYrDLBoCqb+xaG/rjTir0vZQpmWrbpiRH51goYq8WcgR+xQxjgxGY0BGkuRC8Z6Vfyl8Lc5zaS9zVvepwd029v2JY6phC6gaO112yWrFnyhYGcISBHDkAbF3zTpJNVwRJs= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=pengutronix.de; spf=pass smtp.mailfrom=pengutronix.de; arc=none smtp.client-ip=185.203.201.7 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=pengutronix.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=pengutronix.de Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.whiteo.stw.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1rcjIp-0007GV-Kv; Wed, 21 Feb 2024 10:54:11 +0100 Received: from [2a0a:edc0:0:900:1d::77] (helo=ptz.office.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1rcjIo-0020pO-Go; Wed, 21 Feb 2024 10:54:10 +0100 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.96) (envelope-from ) id 1rcjIo-008mZ9-1N; Wed, 21 Feb 2024 10:54:10 +0100 From: =?UTF-8?q?Uwe=20Kleine-K=C3=B6nig?= To: Arnd Bergmann , Greg Kroah-Hartman Cc: kernel@pengutronix.de, Frederic Barrat , Andrew Donnellan , linuxppc-dev@lists.ozlabs.org, linux-kernel@vger.kernel.org Subject: [PATCH 02/11] cxl: Convert to platform remove callback returning void Date: Wed, 21 Feb 2024 10:53:46 +0100 Message-ID: X-Mailer: git-send-email 2.43.0 In-Reply-To: References: Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" X-Developer-Signature: v=1; a=openpgp-sha256; l=1743; i=u.kleine-koenig@pengutronix.de; h=from:subject:message-id; bh=ceIfAJGD21yqrCu3pRBnl7qS6woYhZWPmCbj1WktHEw=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBl1cgt8CRj7FyjoliavbQtoyeJoVa/eIfWpBiD0 I22MkayPfCJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZdXILQAKCRCPgPtYfRL+ TnmxCACPUIWrtGTTucmi+16fEgSXVpRrmtRZyFotM2Ky/2rMpHxG8L4jWkle7RHMSm/JWMEfQnt EzSNutI6wb4kZP9bn1ibHhzzlybBmqXY40SYB3BMmzIL9WxTe5egQdEHO2zbIdAiLkhLwmu3+zn moPHodSmLV/tgalWnDiuSvzXnGlDFLRB2vvlhE7LetAFQ55i1v4HDxEJdInctDklrzdk83aHfuY qq8v0u7lTym/HSHvuUSvE4UyR0PIdYBO3kcMaykO4H8AoYAVJl7eA3STIiq8HeY8v73Wf/nA4e2 G3Db7C6soCl7+vZAQXisdhDfNfd7MIRdO6gGSw0T54bnDAxR X-Developer-Key: i=u.kleine-koenig@pengutronix.de; a=openpgp; fpr=0D2511F322BFAB1C1580266BE2DCDD9132669BD6 Content-Transfer-Encoding: quoted-printable X-SA-Exim-Connect-IP: 2a0a:edc0:0:c01:1d::a2 X-SA-Exim-Mail-From: ukl@pengutronix.de X-SA-Exim-Scanned: No (on metis.whiteo.stw.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-kernel@vger.kernel.org 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 ignored (apart from emitting a warning) 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. Eventually after all drivers are converted, .remove_new() will be renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-K=C3=B6nig Acked-by: Andrew Donnellan Acked-by: Arnd Bergmann --- drivers/misc/cxl/of.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/drivers/misc/cxl/of.c b/drivers/misc/cxl/of.c index 25ce725035e7..bcc005dff1c0 100644 --- a/drivers/misc/cxl/of.c +++ b/drivers/misc/cxl/of.c @@ -431,7 +431,7 @@ int cxl_of_read_adapter_properties(struct cxl *adapter,= struct device_node *np) return 0; } =20 -static int cxl_of_remove(struct platform_device *pdev) +static void cxl_of_remove(struct platform_device *pdev) { struct cxl *adapter; int afu; @@ -441,7 +441,6 @@ static int cxl_of_remove(struct platform_device *pdev) cxl_guest_remove_afu(adapter->afu[afu]); =20 cxl_guest_remove_adapter(adapter); - return 0; } =20 static void cxl_of_shutdown(struct platform_device *pdev) @@ -501,6 +500,6 @@ struct platform_driver cxl_of_driver =3D { .owner =3D THIS_MODULE }, .probe =3D cxl_of_probe, - .remove =3D cxl_of_remove, + .remove_new =3D cxl_of_remove, .shutdown =3D cxl_of_shutdown, }; --=20 2.43.0 From nobody Sun Feb 8 09:16:52 2026 Received: from metis.whiteo.stw.pengutronix.de (metis.whiteo.stw.pengutronix.de [185.203.201.7]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 50CA741C63 for ; Wed, 21 Feb 2024 09:54:23 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=185.203.201.7 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708509264; cv=none; b=dBUGIuN4wlP0YYLqIK9GOS3fIZN64kuF77Y8XBoy6OFRhrv2Bwi34u0NrLv4h1kYwFix1cTOvXFlQEFjb5DSOzJGKpN/Sh1Njk+PktnUFOMOEEgDDpIQDP5Jbh6zXS68DdIXgrXVXT9IcxB6Fkl0yS3VssN6TQqGPv7V5cW9vsQ= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708509264; c=relaxed/simple; bh=OnqiDENxLgv+Hdr/2dddEJW1stD4i0Wo/6jjciqiaTE=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=ZU+1Y+3EaW6D5VQvhSATrXpZ6WpNoPuGX8zLbB4alRNhYaGOTmXkE7AoTGnixrCdAMygpuFYVrhKtUL5CYnA5Xc4bvW9bMG+7vuBlaX5sSj9ox6nw+JSAmqz4OdMMDYAIz5PASdzdA5z/iBuyW4ppZ5Ti2btbl1tfNeOPzr0Aag= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=pengutronix.de; spf=pass smtp.mailfrom=pengutronix.de; arc=none smtp.client-ip=185.203.201.7 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=pengutronix.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=pengutronix.de Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.whiteo.stw.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1rcjIp-0007Gf-U7; Wed, 21 Feb 2024 10:54:11 +0100 Received: from [2a0a:edc0:0:900:1d::77] (helo=ptz.office.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1rcjIo-0020pR-Lq; Wed, 21 Feb 2024 10:54:10 +0100 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.96) (envelope-from ) id 1rcjIo-008mZJ-1t; Wed, 21 Feb 2024 10:54:10 +0100 From: =?UTF-8?q?Uwe=20Kleine-K=C3=B6nig?= To: Arnd Bergmann , Greg Kroah-Hartman Cc: kernel@pengutronix.de, Srinivas Kandagatla , Amol Maheshwari , linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 03/11] misc: fastrpc: Convert to platform remove callback returning void Date: Wed, 21 Feb 2024 10:53:47 +0100 Message-ID: X-Mailer: git-send-email 2.43.0 In-Reply-To: References: Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" X-Developer-Signature: v=1; a=openpgp-sha256; l=1933; i=u.kleine-koenig@pengutronix.de; h=from:subject:message-id; bh=OnqiDENxLgv+Hdr/2dddEJW1stD4i0Wo/6jjciqiaTE=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBl1cguyuD3xtkWfev8vaKM8wwcSRnbzBHzwrofI qZ5Jb33IlyJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZdXILgAKCRCPgPtYfRL+ TrJAB/937rVXXIrU6xLenhr5DP9/kGRz5bnAUD40kOuLGbiouZwQn1jl6jXmCPcSlHnJYH1KIjp VEj9kngIHiZEzmIQKhPP1PGtMTL1YdLdxaRG/Uj+BWjwAmaS/Tk923kPHx8dbJxGUNZ+nO//PQs Rp82zzqv9TkoNEkF7bnDSrsXf5+P2LYT4dNVJTZECPISPNKCkarxxXO5CiQ8o/fisL+TfWsegE2 DhS9vJn+Atd16osTyVrFskEV6QVvtabMj4xmQedKbjInl+6UaIj1KqJHN1ATWQXeQcueUqO7Np4 FEsUw7jA1fXzq6fjIYZklGs225Te2PBvMkwy31g6BbPbCBUg X-Developer-Key: i=u.kleine-koenig@pengutronix.de; a=openpgp; fpr=0D2511F322BFAB1C1580266BE2DCDD9132669BD6 Content-Transfer-Encoding: quoted-printable X-SA-Exim-Connect-IP: 2a0a:edc0:0:c01:1d::a2 X-SA-Exim-Mail-From: ukl@pengutronix.de X-SA-Exim-Scanned: No (on metis.whiteo.stw.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-kernel@vger.kernel.org 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 ignored (apart from emitting a warning) 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. Eventually after all drivers are converted, .remove_new() will be renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-K=C3=B6nig Acked-by: Arnd Bergmann --- drivers/misc/fastrpc.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/misc/fastrpc.c b/drivers/misc/fastrpc.c index 03319a1fa97f..0bfff1d42da2 100644 --- a/drivers/misc/fastrpc.c +++ b/drivers/misc/fastrpc.c @@ -2183,7 +2183,7 @@ static int fastrpc_cb_probe(struct platform_device *p= dev) return 0; } =20 -static int fastrpc_cb_remove(struct platform_device *pdev) +static void fastrpc_cb_remove(struct platform_device *pdev) { struct fastrpc_channel_ctx *cctx =3D dev_get_drvdata(pdev->dev.parent); struct fastrpc_session_ctx *sess =3D dev_get_drvdata(&pdev->dev); @@ -2198,8 +2198,6 @@ static int fastrpc_cb_remove(struct platform_device *= pdev) } } spin_unlock_irqrestore(&cctx->lock, flags); - - return 0; } =20 static const struct of_device_id fastrpc_match_table[] =3D { @@ -2209,7 +2207,7 @@ static const struct of_device_id fastrpc_match_table[= ] =3D { =20 static struct platform_driver fastrpc_cb_driver =3D { .probe =3D fastrpc_cb_probe, - .remove =3D fastrpc_cb_remove, + .remove_new =3D fastrpc_cb_remove, .driver =3D { .name =3D "qcom,fastrpc-cb", .of_match_table =3D fastrpc_match_table, --=20 2.43.0 From nobody Sun Feb 8 09:16:52 2026 Received: from metis.whiteo.stw.pengutronix.de (metis.whiteo.stw.pengutronix.de [185.203.201.7]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 61BC43FB2A for ; Wed, 21 Feb 2024 09:54:20 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=185.203.201.7 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708509262; cv=none; b=FJ+t9fnKbYSNjhGPcOjpNHBptJddZEYpl2B26gUWbRTCt/BnwBKFN6KhxnkhzfnAHF2YsRPx0bstf/i0YvW4/eHdveE87OYybLBN87v8I04whQOJmSPBQ8UIm7m14m+DjOHly3iphWwfkG+2N93OGvDe5HcdTip/7888bGHHGqE= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708509262; c=relaxed/simple; bh=1Z54PMlB3uNqDfv1xecC8r8Edn2ML2Zvp9x4nuVYV3s=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=I/lkOw/6/vJy8i4NKB4/6uilIDnlfhU0FqqWd+vUIoYl7KjeLam5Ksl/+EF2+EY8o/tg+gxXv25sOiaRpepQZ72N9KxaIFUr3hEtgiZeji6BV8X+vvSClwdFo/CIO4pf9rahoCElQqRZMd46Sa46VHmFZRgYJ06yisHN+neJw6k= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=pengutronix.de; spf=pass smtp.mailfrom=pengutronix.de; arc=none smtp.client-ip=185.203.201.7 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=pengutronix.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=pengutronix.de Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.whiteo.stw.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1rcjIp-0007Gg-8w; Wed, 21 Feb 2024 10:54:11 +0100 Received: from [2a0a:edc0:0:900:1d::77] (helo=ptz.office.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1rcjIo-0020pU-Qo; Wed, 21 Feb 2024 10:54:10 +0100 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.96) (envelope-from ) id 1rcjIo-008mZN-2Q; Wed, 21 Feb 2024 10:54:10 +0100 From: =?UTF-8?q?Uwe=20Kleine-K=C3=B6nig?= To: Arnd Bergmann , Greg Kroah-Hartman Cc: kernel@pengutronix.de, John Stultz , linux-kernel@vger.kernel.org Subject: [PATCH 04/11] misc: hisi_hikey_usb: Convert to platform remove callback returning void Date: Wed, 21 Feb 2024 10:53:48 +0100 Message-ID: <8775e9573fec55c5fc04151800829e9aeafc5dda.1708508896.git.u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.43.0 In-Reply-To: References: Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" X-Developer-Signature: v=1; a=openpgp-sha256; l=1945; i=u.kleine-koenig@pengutronix.de; h=from:subject:message-id; bh=1Z54PMlB3uNqDfv1xecC8r8Edn2ML2Zvp9x4nuVYV3s=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBl1cgv2nbHxGDWaticI3bDrXDbYlbfZUnXlTE+1 zv94VRrZ6+JATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZdXILwAKCRCPgPtYfRL+ Tg4CCAClj1GP7ZrUNgTlSi/kreAIKQ/JhxiKDe18AYkwFXhy6iBSkctLx7qsuIt29uelDFx0KSx E3YteCh6vLx3BPASCUeA1pKoWr9aFwkkuyY3q6qULNG2oB+Q75GwtxU9tQKBArBE8u6ykOXmulP 6g5451qNLZJC1zXJD3xBZYi1UGJm9VOaAXv4U3zKMBTkfDhNLIeAiZsu1c+POgXN4o0qc63GQ+c hMxPV+YK4wjToqrIeLlJgNHTPVdujfSPxKMkQzXNs/wvEQHjmnb70eljV5mRq3obp296Z0cpXCR 778EN4lfI4y4+BwRI4hTzv4hyfI/6gyfx/ygU4xK0A+egwYK X-Developer-Key: i=u.kleine-koenig@pengutronix.de; a=openpgp; fpr=0D2511F322BFAB1C1580266BE2DCDD9132669BD6 Content-Transfer-Encoding: quoted-printable X-SA-Exim-Connect-IP: 2a0a:edc0:0:c01:1d::a2 X-SA-Exim-Mail-From: ukl@pengutronix.de X-SA-Exim-Scanned: No (on metis.whiteo.stw.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-kernel@vger.kernel.org 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 ignored (apart from emitting a warning) 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. Eventually after all drivers are converted, .remove_new() will be renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-K=C3=B6nig Acked-by: Arnd Bergmann Acked-by: John Stultz --- drivers/misc/hisi_hikey_usb.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/misc/hisi_hikey_usb.c b/drivers/misc/hisi_hikey_usb.c index 2165ec35a343..8f55db8938e6 100644 --- a/drivers/misc/hisi_hikey_usb.c +++ b/drivers/misc/hisi_hikey_usb.c @@ -239,7 +239,7 @@ static int hisi_hikey_usb_probe(struct platform_device = *pdev) return 0; } =20 -static int hisi_hikey_usb_remove(struct platform_device *pdev) +static void hisi_hikey_usb_remove(struct platform_device *pdev) { struct hisi_hikey_usb *hisi_hikey_usb =3D platform_get_drvdata(pdev); =20 @@ -251,8 +251,6 @@ static int hisi_hikey_usb_remove(struct platform_devic= e *pdev) } else { hub_power_ctrl(hisi_hikey_usb, HUB_VBUS_POWER_OFF); } - - return 0; } =20 static const struct of_device_id id_table_hisi_hikey_usb[] =3D { @@ -263,7 +261,7 @@ MODULE_DEVICE_TABLE(of, id_table_hisi_hikey_usb); =20 static struct platform_driver hisi_hikey_usb_driver =3D { .probe =3D hisi_hikey_usb_probe, - .remove =3D hisi_hikey_usb_remove, + .remove_new =3D hisi_hikey_usb_remove, .driver =3D { .name =3D DEVICE_DRIVER_NAME, .of_match_table =3D id_table_hisi_hikey_usb, --=20 2.43.0 From nobody Sun Feb 8 09:16:52 2026 Received: from metis.whiteo.stw.pengutronix.de (metis.whiteo.stw.pengutronix.de [185.203.201.7]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 0B56E4122C for ; Wed, 21 Feb 2024 09:54:22 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=185.203.201.7 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708509264; cv=none; b=JiahHmt6F3XqTgyjlrZMgKkiEL+UrrpalHpBx2Owftsaw2pG1/vpyzEAQB9L9lwLyOsjpmMINu1x+me8tcGRUnTqveObKw95cUi64+VTVfmlBGyo5BUmAB0xdtD+cLEFV5WoHvPUL0+F1XxrXnyvvp/sQ6HHcRhyXUdlpQSuz2A= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708509264; c=relaxed/simple; bh=pBTwRO+68pmeBClQENCyiZhNulNXrYvaN43H1/Tgtwk=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=XHcsAhCt9o/vmWLsXIKLJnGEFqC1cQavYyj2Mk+XiFdubxtTKSsC2rqvDFByDrTAMhZhTl09Eg2EF9jOWSjXTdVeY+Mo6PIoZXlZjpq/CCSD3M5xCYqRUHVjaEhuOcG+NO+KF85Jqy3nO5sJnupeXdvnr+LA2SVX91HTx2ZJJ2M= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=pengutronix.de; spf=pass smtp.mailfrom=pengutronix.de; arc=none smtp.client-ip=185.203.201.7 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=pengutronix.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=pengutronix.de Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.whiteo.stw.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1rcjIq-0007Gn-0v; Wed, 21 Feb 2024 10:54:12 +0100 Received: from [2a0a:edc0:0:900:1d::77] (helo=ptz.office.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1rcjIo-0020pY-Vl; Wed, 21 Feb 2024 10:54:10 +0100 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.96) (envelope-from ) id 1rcjIo-008mZR-2u; Wed, 21 Feb 2024 10:54:10 +0100 From: =?UTF-8?q?Uwe=20Kleine-K=C3=B6nig?= To: Arnd Bergmann , Greg Kroah-Hartman Cc: kernel@pengutronix.de, Tomas Winkler , linux-kernel@vger.kernel.org Subject: [PATCH 05/11] mei: vsc: Convert to platform remove callback returning void Date: Wed, 21 Feb 2024 10:53:49 +0100 Message-ID: <8e14f0b1cea107e613fa0075b3379a9f1e7ef63f.1708508896.git.u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.43.0 In-Reply-To: References: Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" X-Developer-Signature: v=1; a=openpgp-sha256; l=1846; i=u.kleine-koenig@pengutronix.de; h=from:subject:message-id; bh=pBTwRO+68pmeBClQENCyiZhNulNXrYvaN43H1/Tgtwk=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBl1cgw8NkD13QTQZX8go+76yoqIK8/+/4AehWyh LaTaGfMegmJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZdXIMAAKCRCPgPtYfRL+ Tn1CCACAxm+y17S67+v7bI8mm/v4cAoJwqrtu2QKtfu0YuxBlcn5sx32MLvVBzwpYWTI04lXdDL IAsSxCw5uKS++0JG/UuZY49PwAwU3khoLS+/sLug+5c0MGU18JxDJgYE1BfRaIEiMXnTphzjZHP //s4mBPUhibQi0+cG/B/6z8h1xJYjKHPVDfSAsxYpoXO6LbcE1v9/gKGVa0KxLJHh5/C7E7YEMf rUaH30or6kvvqJ9yDC8w7uAGjM7/PPOC73dePRaDsE3NkeaHLnsvyki+gV2VsHvU7cJa54HGPOB oNIkPYl1XYpkUupbfLCes3zwOK8d49og7fJbOZ/F4+/s4z2+ X-Developer-Key: i=u.kleine-koenig@pengutronix.de; a=openpgp; fpr=0D2511F322BFAB1C1580266BE2DCDD9132669BD6 Content-Transfer-Encoding: quoted-printable X-SA-Exim-Connect-IP: 2a0a:edc0:0:c01:1d::a2 X-SA-Exim-Mail-From: ukl@pengutronix.de X-SA-Exim-Scanned: No (on metis.whiteo.stw.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-kernel@vger.kernel.org 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 ignored (apart from emitting a warning) 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. Eventually after all drivers are converted, .remove_new() will be renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-K=C3=B6nig Acked-by: Arnd Bergmann --- drivers/misc/mei/platform-vsc.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/misc/mei/platform-vsc.c b/drivers/misc/mei/platform-vs= c.c index 8d303c6c0000..6c9f00bcb94b 100644 --- a/drivers/misc/mei/platform-vsc.c +++ b/drivers/misc/mei/platform-vsc.c @@ -384,7 +384,7 @@ static int mei_vsc_probe(struct platform_device *pdev) return ret; } =20 -static int mei_vsc_remove(struct platform_device *pdev) +static void mei_vsc_remove(struct platform_device *pdev) { struct mei_device *mei_dev =3D platform_get_drvdata(pdev); =20 @@ -395,8 +395,6 @@ static int mei_vsc_remove(struct platform_device *pdev) mei_disable_interrupts(mei_dev); =20 mei_deregister(mei_dev); - - return 0; } =20 static int mei_vsc_suspend(struct device *dev) @@ -433,7 +431,7 @@ MODULE_DEVICE_TABLE(platform, mei_vsc_id_table); =20 static struct platform_driver mei_vsc_drv =3D { .probe =3D mei_vsc_probe, - .remove =3D mei_vsc_remove, + .remove_new =3D mei_vsc_remove, .id_table =3D mei_vsc_id_table, .driver =3D { .name =3D MEI_VSC_DRV_NAME, --=20 2.43.0 From nobody Sun Feb 8 09:16:52 2026 Received: from metis.whiteo.stw.pengutronix.de (metis.whiteo.stw.pengutronix.de [185.203.201.7]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 9F5173FB22 for ; Wed, 21 Feb 2024 09:54:19 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=185.203.201.7 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708509261; cv=none; b=Nqc8su8iiRHjHv9xLqI+qztzVu+ik350ZWyZB1kdfKvTJcAC5312x+eADPIJJtv2KlQiBPrxv6tWuf5lQiVuOUQ39VZC1WEYRI2xH5BL/bAWljMReUMQ1VLcdCmWzMLM8iprSzGIE7LSr48e1o9AfK40OYnuzmPvx89XPuGthMs= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708509261; c=relaxed/simple; bh=ir78vHUD8SOpgHLYnJu/TctAQqKxSR//CX4Gftp+PpY=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=FIljlpyBRxm6Nk/BHN+/mhP9SPcaX0bioeMuVshx6fFGgFFQ4U+1ZHAcOTPtVUBn+2grWpVUy1z4g/AAjVadH/a0u1ZIMVcuVENgek7Y55BXLF7R9CvAic/LdkI79e/B3M03u5TUiEa0JGYQOyAPSwbJ3X/PowTDR/sOKua6K/M= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=pengutronix.de; spf=pass smtp.mailfrom=pengutronix.de; arc=none smtp.client-ip=185.203.201.7 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=pengutronix.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=pengutronix.de Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.whiteo.stw.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1rcjIp-0007Gx-Gz; Wed, 21 Feb 2024 10:54:11 +0100 Received: from [2a0a:edc0:0:900:1d::77] (helo=ptz.office.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1rcjIp-0020pc-4K; Wed, 21 Feb 2024 10:54:11 +0100 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.96) (envelope-from ) id 1rcjIp-008mZV-0B; Wed, 21 Feb 2024 10:54:11 +0100 From: =?UTF-8?q?Uwe=20Kleine-K=C3=B6nig?= To: Arnd Bergmann , Greg Kroah-Hartman Cc: kernel@pengutronix.de, linux-kernel@vger.kernel.org Subject: [PATCH 06/11] misc: open-dice: Convert to platform remove callback returning void Date: Wed, 21 Feb 2024 10:53:50 +0100 Message-ID: <8e7179794ffbcaa4ad3d0db50cc4aa03f377fc8c.1708508896.git.u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.43.0 In-Reply-To: References: Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" X-Developer-Signature: v=1; a=openpgp-sha256; l=1730; i=u.kleine-koenig@pengutronix.de; h=from:subject:message-id; bh=ir78vHUD8SOpgHLYnJu/TctAQqKxSR//CX4Gftp+PpY=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBl1cgxxQVwARjfqVxgcJw3tXAI+x5CthZ2JXeuX Ph3s96a2UWJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZdXIMQAKCRCPgPtYfRL+ Tl/4B/oDzrUTvZhPFmAHuCemhm9wCHb2gzHHLh8/xzfjRirJyt1OK4OSn80BF3Fj6lJ/QC9UIIa VWVwciSnaQ/sbGJl5HfT7LmcggyYQJwLj3SYMD0PnBcKNE3anhI2I2M+zsmbH+F5Tyb3rITMq5V b09z6B2AxH7mV+RpaNEMBqIxfNb8z/rbcUZfJuRm20nHEJ4Rc9E4zWvU49ulXImF8l/+fRK/U8A xRzIgeQ3oXKx/5w33e6iLPMUcytIefLP1TV74ngh5mKrbee6t3y+c84IjH+q1WDodDPI2dIAmx7 XXZIEbS89r+gDjyCfxz6j2EO0NX9Q9P3JtRTahMPQeBPlLSz X-Developer-Key: i=u.kleine-koenig@pengutronix.de; a=openpgp; fpr=0D2511F322BFAB1C1580266BE2DCDD9132669BD6 Content-Transfer-Encoding: quoted-printable X-SA-Exim-Connect-IP: 2a0a:edc0:0:c01:1d::a2 X-SA-Exim-Mail-From: ukl@pengutronix.de X-SA-Exim-Scanned: No (on metis.whiteo.stw.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-kernel@vger.kernel.org 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 ignored (apart from emitting a warning) 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. Eventually after all drivers are converted, .remove_new() will be renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-K=C3=B6nig Acked-by: Arnd Bergmann --- drivers/misc/open-dice.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/drivers/misc/open-dice.c b/drivers/misc/open-dice.c index d279a4f195e2..1e3eb2aa44d9 100644 --- a/drivers/misc/open-dice.c +++ b/drivers/misc/open-dice.c @@ -165,12 +165,11 @@ static int __init open_dice_probe(struct platform_dev= ice *pdev) return 0; } =20 -static int open_dice_remove(struct platform_device *pdev) +static void open_dice_remove(struct platform_device *pdev) { struct open_dice_drvdata *drvdata =3D platform_get_drvdata(pdev); =20 misc_deregister(&drvdata->misc); - return 0; } =20 static const struct of_device_id open_dice_of_match[] =3D { @@ -179,7 +178,7 @@ static const struct of_device_id open_dice_of_match[] = =3D { }; =20 static struct platform_driver open_dice_driver =3D { - .remove =3D open_dice_remove, + .remove_new =3D open_dice_remove, .driver =3D { .name =3D DRIVER_NAME, .of_match_table =3D open_dice_of_match, --=20 2.43.0 From nobody Sun Feb 8 09:16:52 2026 Received: from metis.whiteo.stw.pengutronix.de (metis.whiteo.stw.pengutronix.de [185.203.201.7]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 9F53C3FB29 for ; Wed, 21 Feb 2024 09:54:19 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=185.203.201.7 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708509261; cv=none; b=qoFCWPhpTrq2WMjs9CyhPYBaUU2il9fAa/2t/bkIocYIGDjHbfRx40ME7MY3Ha9w39Aeg2kxi5FkP1dc8LprAJPGmb6T3L1+qAt1LLv53Ka/bikiAEMTphoEYD5RFABoKuzKPd97Svm/G3aSlCXOaZVU/LWyD1ILHV+PxwRUK/8= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708509261; c=relaxed/simple; bh=wV5kOQQfXa7GmI/jCQbHnD85OwAc3mvAy5KiOozQ2RI=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=UdOAzhzmFhAGKit7NIf9IXZbtwbkLQG3Uy/v4Srxs2gRAd4E581+1sOy85dJgixLIP0i5JuxPvqSJzsZwTjt8zAhlcyoCS0x1GzvX4H4c+4jiDlAQmYIEhYyIT+6rByntTVc55Qq2IL6oPKW8sNT2c4gWHhfymnz6VHzJXmFNqc= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=pengutronix.de; spf=pass smtp.mailfrom=pengutronix.de; arc=none smtp.client-ip=185.203.201.7 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=pengutronix.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=pengutronix.de Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.whiteo.stw.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1rcjIp-0007H1-MV; Wed, 21 Feb 2024 10:54:11 +0100 Received: from [2a0a:edc0:0:900:1d::77] (helo=ptz.office.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1rcjIp-0020pg-9a; Wed, 21 Feb 2024 10:54:11 +0100 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.96) (envelope-from ) id 1rcjIp-008mZZ-0h; Wed, 21 Feb 2024 10:54:11 +0100 From: =?UTF-8?q?Uwe=20Kleine-K=C3=B6nig?= To: Arnd Bergmann , Greg Kroah-Hartman Cc: kernel@pengutronix.de, linux-kernel@vger.kernel.org Subject: [PATCH 07/11] misc: sram: Convert to platform remove callback returning void Date: Wed, 21 Feb 2024 10:53:51 +0100 Message-ID: <946ebc33a01bf700171257cd219fbe8626bc0c99.1708508896.git.u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.43.0 In-Reply-To: References: Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" X-Developer-Signature: v=1; a=openpgp-sha256; l=1783; i=u.kleine-koenig@pengutronix.de; h=from:subject:message-id; bh=wV5kOQQfXa7GmI/jCQbHnD85OwAc3mvAy5KiOozQ2RI=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBl1cgyU0JVrN1V9zkvCCkVIv3zFiQ9RASp2zLO2 TXJgFhQxNiJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZdXIMgAKCRCPgPtYfRL+ Tt0IB/4+erNGWGYeMSgID+MQEJcmU9vfMnLacTUdPxy2z0hZTGvKHZMHO0QnctylkeRNDsMKWIe faR2xZK05iHhn2xdEL94o3LW+5G8CpiSx/69zX7p5Jdq5tCtd/b/VTZe5b0bZjTOU8Rjzo3WKCA H6/R2DZOoDvzeF8Ft7Riukq2UZqArzqZVgW85qYRsMK0RAWfdKTSgxqI0iWgsJ93lgwCClX1NnH qOanxSL8Nq0vHI9mc0rruWscMeGFG4wR1FbPhVTGkUdnb5uU7kw2hH3+rbds3pXKrl53G4hOfNv TerGfXEJEim+xDev9xi7671TvTDex/E4drmQlEP3WNEnlYBw X-Developer-Key: i=u.kleine-koenig@pengutronix.de; a=openpgp; fpr=0D2511F322BFAB1C1580266BE2DCDD9132669BD6 Content-Transfer-Encoding: quoted-printable X-SA-Exim-Connect-IP: 2a0a:edc0:0:c01:1d::a2 X-SA-Exim-Mail-From: ukl@pengutronix.de X-SA-Exim-Scanned: No (on metis.whiteo.stw.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-kernel@vger.kernel.org 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 ignored (apart from emitting a warning) 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. Eventually after all drivers are converted, .remove_new() will be renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-K=C3=B6nig Acked-by: Arnd Bergmann --- drivers/misc/sram.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/misc/sram.c b/drivers/misc/sram.c index e248c0a8882f..546eb06a40d0 100644 --- a/drivers/misc/sram.c +++ b/drivers/misc/sram.c @@ -435,7 +435,7 @@ static int sram_probe(struct platform_device *pdev) return ret; } =20 -static int sram_remove(struct platform_device *pdev) +static void sram_remove(struct platform_device *pdev) { struct sram_dev *sram =3D platform_get_drvdata(pdev); =20 @@ -443,8 +443,6 @@ static int sram_remove(struct platform_device *pdev) =20 if (sram->pool && gen_pool_avail(sram->pool) < gen_pool_size(sram->pool)) dev_err(sram->dev, "removed while SRAM allocated\n"); - - return 0; } =20 static struct platform_driver sram_driver =3D { @@ -453,7 +451,7 @@ static struct platform_driver sram_driver =3D { .of_match_table =3D sram_dt_ids, }, .probe =3D sram_probe, - .remove =3D sram_remove, + .remove_new =3D sram_remove, }; =20 static int __init sram_init(void) --=20 2.43.0 From nobody Sun Feb 8 09:16:52 2026 Received: from metis.whiteo.stw.pengutronix.de (metis.whiteo.stw.pengutronix.de [185.203.201.7]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 50E2F41C7C for ; Wed, 21 Feb 2024 09:54:23 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=185.203.201.7 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708509265; cv=none; b=e135Gd7V/BMzRqWlz9EQiMmS5L9jleMHktRf2/CU/l6qrzEC28bDnU2zQR2OmL7EU2xmYgyWrvkpLvN73Udb5yRw+QIVhsjWbIKUBxHV7dWJ+F+FCNU98C5OIzA6rPcwP/vVD720GC5KRKXy9w7h6hLfMoSisYPK5S/WiMvdXgg= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708509265; c=relaxed/simple; bh=aE2QGkb/6v1mhMB4aBC3dwinRin5nmjBq8EsbULi2eA=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=IkEDkEytATl9fu6GUIV5EOrz6desSteO/XTUFf5+hVI7RgH1dyxMJtChUXuSYNfnVPSfx1kHxnjWLKMUuAck/7mWwmmVnvrhE3z4vc0JYLV7I6Hz2kbvYFEKGacEBsHkkaFHXCIn+M/fTgS+xmleQfsbvt+hUIH7zwOiVZqHbXQ= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=pengutronix.de; spf=pass smtp.mailfrom=pengutronix.de; arc=none smtp.client-ip=185.203.201.7 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=pengutronix.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=pengutronix.de Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.whiteo.stw.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1rcjIp-0007HE-Sj; Wed, 21 Feb 2024 10:54:11 +0100 Received: from [2a0a:edc0:0:900:1d::77] (helo=ptz.office.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1rcjIp-0020pk-Eo; Wed, 21 Feb 2024 10:54:11 +0100 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.96) (envelope-from ) id 1rcjIp-008mZd-1D; Wed, 21 Feb 2024 10:54:11 +0100 From: =?UTF-8?q?Uwe=20Kleine-K=C3=B6nig?= To: Arnd Bergmann , Greg Kroah-Hartman Cc: kernel@pengutronix.de, "Jiri Slaby (SUSE)" , Justin Stitt , Kees Cook , linux-kernel@vger.kernel.org Subject: [PATCH 08/11] misc: ti-st: st_kim: Convert to platform remove callback returning void Date: Wed, 21 Feb 2024 10:53:52 +0100 Message-ID: <250337c967bdb5019a3c9fe8e0d082cd65400227.1708508896.git.u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.43.0 In-Reply-To: References: Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" X-Developer-Signature: v=1; a=openpgp-sha256; l=1888; i=u.kleine-koenig@pengutronix.de; h=from:subject:message-id; bh=aE2QGkb/6v1mhMB4aBC3dwinRin5nmjBq8EsbULi2eA=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBl1cg0VyGHhH5aEiLrau5zEWJKmdo3VSy8JU2JK /8AmoaGesyJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZdXINAAKCRCPgPtYfRL+ Tg+wCACJqAUmJJeiHN3VJX89/LpaNfHZTU8DqYeEtV3tbDV6DLtnLj48kNZ7B+nBdyV4RNBSIgx QlPp9RmR0sIcwSMXIQ/9IrRyyi+a3dpiXCCxEVNgyrkVBIDleBvOmH8/porxH5w4lqt9eZksOAF o/Tq4+suHDB0R3ix88Sg7/NJXcTVZ3msKth4JcyftBSTtKS0LzUnFzLEmj7KFPMB6vQb8gwPS/9 XQ0y7Cts8mGL1SfsQran2oGCQEtmdDn2EEWXKg5xQWtGyCQUbk0vNDUMIZCp0HSL+F3WC9zxgyS FJoui8e5Rsf+yB736dRJCNsHQ+iuXLbO0yWdKyJhBdhaDZUq X-Developer-Key: i=u.kleine-koenig@pengutronix.de; a=openpgp; fpr=0D2511F322BFAB1C1580266BE2DCDD9132669BD6 Content-Transfer-Encoding: quoted-printable X-SA-Exim-Connect-IP: 2a0a:edc0:0:c01:1d::a2 X-SA-Exim-Mail-From: ukl@pengutronix.de X-SA-Exim-Scanned: No (on metis.whiteo.stw.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-kernel@vger.kernel.org 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 ignored (apart from emitting a warning) 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. Eventually after all drivers are converted, .remove_new() will be renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-K=C3=B6nig Acked-by: Arnd Bergmann --- drivers/misc/ti-st/st_kim.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/drivers/misc/ti-st/st_kim.c b/drivers/misc/ti-st/st_kim.c index 4b1be0bb6ac0..47ebe80bf849 100644 --- a/drivers/misc/ti-st/st_kim.c +++ b/drivers/misc/ti-st/st_kim.c @@ -774,7 +774,7 @@ static int kim_probe(struct platform_device *pdev) return err; } =20 -static int kim_remove(struct platform_device *pdev) +static void kim_remove(struct platform_device *pdev) { /* free the GPIOs requested */ struct ti_st_plat_data *pdata =3D pdev->dev.platform_data; @@ -798,7 +798,6 @@ static int kim_remove(struct platform_device *pdev) =20 kfree(kim_gdata); kim_gdata =3D NULL; - return 0; } =20 static int kim_suspend(struct platform_device *pdev, pm_message_t state) @@ -825,7 +824,7 @@ static int kim_resume(struct platform_device *pdev) /* entry point for ST KIM module, called in from ST Core */ static struct platform_driver kim_platform_driver =3D { .probe =3D kim_probe, - .remove =3D kim_remove, + .remove_new =3D kim_remove, .suspend =3D kim_suspend, .resume =3D kim_resume, .driver =3D { --=20 2.43.0 From nobody Sun Feb 8 09:16:52 2026 Received: from metis.whiteo.stw.pengutronix.de (metis.whiteo.stw.pengutronix.de [185.203.201.7]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 61B933FB07 for ; Wed, 21 Feb 2024 09:54:20 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=185.203.201.7 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708509261; cv=none; b=ClKc0hFntk9t2F51CzwOBE2+J6bhu+QLebAo81vfXKAWloHNMBb1LEsqaBC26WXOcK1B/2tEr/omjNGfQ6/xPCYBlrm7eNPjXnG0KzPaAeZC+OkmGYD2LDLbR5Em8b1GjiHzc8r0SmxneabuEO3ZUVKqveEjLDr7pT4pBbPnGoc= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708509261; c=relaxed/simple; bh=Z0Jdss8Z9N+X/4fQqWurmfEHx8ej0cUV7yavwKcWUYQ=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=Xbt3g6geMLNhSzaCIU8/iBNpaIBMO5nh1eaSKAqqOCFzVWTquCJc3aP6eeu4GLtWpOsN2nmy75Afg8YV9dSsKU7zy6O/cvqa+GakbklGfWMggkMLOosm9VmbjB2bFiaIwI8lQIGScJpWt5mXWi6EjUI3DMM39h3dxl0wsLdFLRg= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=pengutronix.de; spf=pass smtp.mailfrom=pengutronix.de; arc=none smtp.client-ip=185.203.201.7 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=pengutronix.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=pengutronix.de Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.whiteo.stw.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1rcjIq-0007Ha-07; Wed, 21 Feb 2024 10:54:12 +0100 Received: from [2a0a:edc0:0:900:1d::77] (helo=ptz.office.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1rcjIp-0020pn-JA; Wed, 21 Feb 2024 10:54:11 +0100 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.96) (envelope-from ) id 1rcjIp-008mZh-1e; Wed, 21 Feb 2024 10:54:11 +0100 From: =?UTF-8?q?Uwe=20Kleine-K=C3=B6nig?= To: Arnd Bergmann , Greg Kroah-Hartman Cc: kernel@pengutronix.de, linux-kernel@vger.kernel.org Subject: [PATCH 09/11] misc: vcpu_stall_detector: Convert to platform remove callback returning void Date: Wed, 21 Feb 2024 10:53:53 +0100 Message-ID: <4b964bd133f5af11cabd51a4d8ed95025583eb93.1708508896.git.u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.43.0 In-Reply-To: References: Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" X-Developer-Signature: v=1; a=openpgp-sha256; l=1945; i=u.kleine-koenig@pengutronix.de; h=from:subject:message-id; bh=Z0Jdss8Z9N+X/4fQqWurmfEHx8ej0cUV7yavwKcWUYQ=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBl1cg1Zgtpxn81Nmf1C4B2gjhJAWay7ZKxRNAmC cIykPiy3SGJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZdXINQAKCRCPgPtYfRL+ Ti2oB/9djHRbvore2tsWl0WNdQ7Y9WUHziJ2s44R9yJzRFpf+POxHER8z/IyIoq0IxFaaZk6+Qi CPoopjpGUTxVeAoEeCfC1/rTyLC0A6tRdx1vn2sm5ZEYtyjd9V1dd160bDflDUWtYVa30wi9pxh YHVO8nhwZd5XMHfKBoDvEAV1gXPKvh0n6NhqterWPONvPCLJ3KsZo+3KApxpoMLIkjUe+IOeqxS 925Joz9+kVRcKPiMqXl7LKgxZiDLEbS3h2/B2z4uNjGvGkvMe/uRfRgyu2B5QD+DePFDJAFhWxO XaVodlKUvE/gLCe30VqVT2ZBCXwaSwyIx/Gqx6Vh6eLBWTop X-Developer-Key: i=u.kleine-koenig@pengutronix.de; a=openpgp; fpr=0D2511F322BFAB1C1580266BE2DCDD9132669BD6 Content-Transfer-Encoding: quoted-printable X-SA-Exim-Connect-IP: 2a0a:edc0:0:c01:1d::a2 X-SA-Exim-Mail-From: ukl@pengutronix.de X-SA-Exim-Scanned: No (on metis.whiteo.stw.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-kernel@vger.kernel.org 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 ignored (apart from emitting a warning) 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. Eventually after all drivers are converted, .remove_new() will be renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-K=C3=B6nig Acked-by: Arnd Bergmann --- drivers/misc/vcpu_stall_detector.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/misc/vcpu_stall_detector.c b/drivers/misc/vcpu_stall_d= etector.c index 6479c962da1a..e2015c87f03f 100644 --- a/drivers/misc/vcpu_stall_detector.c +++ b/drivers/misc/vcpu_stall_detector.c @@ -187,7 +187,7 @@ static int vcpu_stall_detect_probe(struct platform_devi= ce *pdev) return ret; } =20 -static int vcpu_stall_detect_remove(struct platform_device *pdev) +static void vcpu_stall_detect_remove(struct platform_device *pdev) { int cpu; =20 @@ -195,8 +195,6 @@ static int vcpu_stall_detect_remove(struct platform_dev= ice *pdev) =20 for_each_possible_cpu(cpu) stop_stall_detector_cpu(cpu); - - return 0; } =20 static const struct of_device_id vcpu_stall_detect_of_match[] =3D { @@ -208,7 +206,7 @@ MODULE_DEVICE_TABLE(of, vcpu_stall_detect_of_match); =20 static struct platform_driver vcpu_stall_detect_driver =3D { .probe =3D vcpu_stall_detect_probe, - .remove =3D vcpu_stall_detect_remove, + .remove_new =3D vcpu_stall_detect_remove, .driver =3D { .name =3D KBUILD_MODNAME, .of_match_table =3D vcpu_stall_detect_of_match, --=20 2.43.0 From nobody Sun Feb 8 09:16:52 2026 Received: from metis.whiteo.stw.pengutronix.de (metis.whiteo.stw.pengutronix.de [185.203.201.7]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 551F945942 for ; Wed, 21 Feb 2024 09:54:24 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=185.203.201.7 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708509267; cv=none; b=rr/OGQu4M5QfJZ3dGkB4dyaoF8LDAHUFBYVCmkblTabOeEgTsmaApl1QdHo1FkodcdXMqIOGFUa9fHoNR1/uNkhszk9OJLliBGxsfX5FF+nz/HToBm4nGYJElF2hyie0bHpERKoCGy3C2Pq9ylmr2WGHvbJXtKQrYFkDrvlLd7Q= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708509267; c=relaxed/simple; bh=VxfuHppooGvLYcqyujJixgDeq0NOYDY6Z9s4et8wZLo=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=NCkehV5qNdSLJWUvPyTphs5yDIrKIY9xgCXOZTtz1Wu+oSThCrmXu1KDRNV16TDHaOhobTeHA+bVu8EoTIA+DKWPoGREviZ0Af1bz2X0VOS1EkZXO/PXO3MPTJsHz6uXLdD3iGZCmDMnlUN79DP3MJESKmL6DUZq+IaYsGPqrYI= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=pengutronix.de; spf=pass smtp.mailfrom=pengutronix.de; arc=none smtp.client-ip=185.203.201.7 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=pengutronix.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=pengutronix.de Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.whiteo.stw.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1rcjIq-0007IJ-7A; Wed, 21 Feb 2024 10:54:12 +0100 Received: from [2a0a:edc0:0:900:1d::77] (helo=ptz.office.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1rcjIp-0020ps-OU; Wed, 21 Feb 2024 10:54:11 +0100 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.96) (envelope-from ) id 1rcjIp-008mZl-2B; Wed, 21 Feb 2024 10:54:11 +0100 From: =?UTF-8?q?Uwe=20Kleine-K=C3=B6nig?= To: Arnd Bergmann , Greg Kroah-Hartman Cc: kernel@pengutronix.de, Derek Kiernan , Dragan Cvetic , Michal Simek , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [PATCH 10/11] misc: xilinx_sdfec: Convert to platform remove callback returning void Date: Wed, 21 Feb 2024 10:53:54 +0100 Message-ID: <705b89c3cd7c0a42ce3f482f202204f5e3377aa2.1708508896.git.u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.43.0 In-Reply-To: References: Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" X-Developer-Signature: v=1; a=openpgp-sha256; l=1818; i=u.kleine-koenig@pengutronix.de; h=from:subject:message-id; bh=VxfuHppooGvLYcqyujJixgDeq0NOYDY6Z9s4et8wZLo=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBl1cg2clFZNoEecENcB6Zbo4fh4KajT1/bgMUhP rY2buIYSW+JATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZdXINgAKCRCPgPtYfRL+ Tv/BB/91akfTAn2h0Yk5ZAIm5zYDFPx58IDzHHkvqb5tNofqwSlKI1M8QJS5qBt9Cp2oJAEFBHo Iz8fJy0AFPsz6NXCijBB67WKMgP1QM6fDWp7VhbvrdxfAmvg3BYZdfsli2k9C6VLiUz6HV5ik2r vzaZXcvbn6IfsZgq2QbqN6cuzIw6o3JZnAWNCtD1Qbc5pCqtihs/tb4e9xH3g8o0qk828mEPdl4 ig5tVjYbZmDyI0RiNJH971F9zREqpBmCMnrDU1bdCcfTAK04gj2kq9/piSa+sQC9nvd3IuvOTTX Lbb8JXa7zmKluQXUKCIzc6HCoeUNWi62SFiPldsWqOiP3MeN X-Developer-Key: i=u.kleine-koenig@pengutronix.de; a=openpgp; fpr=0D2511F322BFAB1C1580266BE2DCDD9132669BD6 Content-Transfer-Encoding: quoted-printable X-SA-Exim-Connect-IP: 2a0a:edc0:0:c01:1d::a2 X-SA-Exim-Mail-From: ukl@pengutronix.de X-SA-Exim-Scanned: No (on metis.whiteo.stw.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-kernel@vger.kernel.org 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 ignored (apart from emitting a warning) 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. Eventually after all drivers are converted, .remove_new() will be renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-K=C3=B6nig Acked-by: Arnd Bergmann --- drivers/misc/xilinx_sdfec.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/drivers/misc/xilinx_sdfec.c b/drivers/misc/xilinx_sdfec.c index 94a0ee19bf20..ea433695f4c4 100644 --- a/drivers/misc/xilinx_sdfec.c +++ b/drivers/misc/xilinx_sdfec.c @@ -1420,7 +1420,7 @@ static int xsdfec_probe(struct platform_device *pdev) return err; } =20 -static int xsdfec_remove(struct platform_device *pdev) +static void xsdfec_remove(struct platform_device *pdev) { struct xsdfec_dev *xsdfec; =20 @@ -1428,7 +1428,6 @@ static int xsdfec_remove(struct platform_device *pdev) misc_deregister(&xsdfec->miscdev); ida_free(&dev_nrs, xsdfec->dev_id); xsdfec_disable_all_clks(&xsdfec->clks); - return 0; } =20 static const struct of_device_id xsdfec_of_match[] =3D { @@ -1445,7 +1444,7 @@ static struct platform_driver xsdfec_driver =3D { .of_match_table =3D xsdfec_of_match, }, .probe =3D xsdfec_probe, - .remove =3D xsdfec_remove, + .remove_new =3D xsdfec_remove, }; =20 module_platform_driver(xsdfec_driver); --=20 2.43.0 From nobody Sun Feb 8 09:16:52 2026 Received: from metis.whiteo.stw.pengutronix.de (metis.whiteo.stw.pengutronix.de [185.203.201.7]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 5529E45953 for ; Wed, 21 Feb 2024 09:54:24 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=185.203.201.7 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708509266; cv=none; b=AQ7jhWJl2rAQa7VYxM+hl5stUhuQ+t64m8Ts7IVEebj8ZLQ704/mOfFad/ZZlUxz0fGWhnVZsu+rtxiwXbbzw6hEhT1SmH6m3xXJABiPquDRd5fo2+goCIHHt5pKJ5LfxwcGEUCedhYkTfIu9lfMXYqeZhEb7ZGK6BXbiKvK7Sw= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708509266; c=relaxed/simple; bh=aVX7CawhH3qa0cDrgvRo+u3JaL3iPMKiw1wYFuGdRaA=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=nBjCzgvqF499pdlfM6I3PL349qz1Fjg82Z4bEo/1RXxvMV09KqlZkQHl1Hotwz/9bWbilcq/BsKNa+mTKZuipgL9MCdUJnDrfcykleYDNYI9CDWzYSKqrvrWPGNlLDPXzPQ0ZV703nCCbbu+ohUhtw7m9Md8jcVfIok6tyVpthw= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=pengutronix.de; spf=pass smtp.mailfrom=pengutronix.de; arc=none smtp.client-ip=185.203.201.7 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=pengutronix.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=pengutronix.de Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.whiteo.stw.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1rcjIq-0007Ik-Ec; Wed, 21 Feb 2024 10:54:12 +0100 Received: from [2a0a:edc0:0:900:1d::77] (helo=ptz.office.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1rcjIp-0020pw-TW; Wed, 21 Feb 2024 10:54:11 +0100 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.96) (envelope-from ) id 1rcjIp-008mZp-2h; Wed, 21 Feb 2024 10:54:11 +0100 From: =?UTF-8?q?Uwe=20Kleine-K=C3=B6nig?= To: Arnd Bergmann , Greg Kroah-Hartman Cc: kernel@pengutronix.de, Appana Durga Kedareswara rao , Michal Simek , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [PATCH 11/11] misc: xilinx_tmr_inject: Convert to platform remove callback returning void Date: Wed, 21 Feb 2024 10:53:55 +0100 Message-ID: <198112757eac0fc004677a4757ce48ae7c7194ab.1708508896.git.u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.43.0 In-Reply-To: References: Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" X-Developer-Signature: v=1; a=openpgp-sha256; l=1764; i=u.kleine-koenig@pengutronix.de; h=from:subject:message-id; bh=aVX7CawhH3qa0cDrgvRo+u3JaL3iPMKiw1wYFuGdRaA=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBl1cg3i12P3AFF5hN9xxxKjObFB8Opb/S6JiL7Y QyrNxpImmuJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZdXINwAKCRCPgPtYfRL+ TkIDB/40DS+jNpK7mW/zj5sYEayFRQSSPz+4UZyoeR+sn9fVwBQa7GRLchbqI+O0PU72agCU/sa ifrDHoMM3ErDbjQ4wP5m3ABLfT96BtYkAtvMdSCi3k/TuVIKWklzZF4jvnv4IZ23xO1wih3Ibcn 55Rt3k928CsxAY1O3rwc8ajXJ3juNX/zQ/M6iQg2vkLPKaNa62+9abmBwiayzX5XmAk0F8z/sPy 3sHR2OjHxZNP3ia5S664f/Z5qBBtz8dVEMHGTj0HRN7toPOKK9z2YhQfoqT+CeQvQvc2wy4k1D6 /rBQuL7EvJ3qe5zU2KbqjGVu1YPvHG6Q5fLYQC22gi2Q8a9u X-Developer-Key: i=u.kleine-koenig@pengutronix.de; a=openpgp; fpr=0D2511F322BFAB1C1580266BE2DCDD9132669BD6 Content-Transfer-Encoding: quoted-printable X-SA-Exim-Connect-IP: 2a0a:edc0:0:c01:1d::a2 X-SA-Exim-Mail-From: ukl@pengutronix.de X-SA-Exim-Scanned: No (on metis.whiteo.stw.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-kernel@vger.kernel.org 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 ignored (apart from emitting a warning) 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. Eventually after all drivers are converted, .remove_new() will be renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-K=C3=B6nig Acked-by: Arnd Bergmann --- drivers/misc/xilinx_tmr_inject.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/drivers/misc/xilinx_tmr_inject.c b/drivers/misc/xilinx_tmr_inj= ect.c index 9fc5835bfebc..73c6da7d0963 100644 --- a/drivers/misc/xilinx_tmr_inject.c +++ b/drivers/misc/xilinx_tmr_inject.c @@ -143,11 +143,10 @@ static int xtmr_inject_probe(struct platform_device *= pdev) return 0; } =20 -static int xtmr_inject_remove(struct platform_device *pdev) +static void xtmr_inject_remove(struct platform_device *pdev) { debugfs_remove_recursive(dbgfs_root); dbgfs_root =3D NULL; - return 0; } =20 static const struct of_device_id xtmr_inject_of_match[] =3D { @@ -164,7 +163,7 @@ static struct platform_driver xtmr_inject_driver =3D { .of_match_table =3D xtmr_inject_of_match, }, .probe =3D xtmr_inject_probe, - .remove =3D xtmr_inject_remove, + .remove_new =3D xtmr_inject_remove, }; module_platform_driver(xtmr_inject_driver); MODULE_AUTHOR("Advanced Micro Devices, Inc"); --=20 2.43.0