From patchwork Sun Mar 26 14:30:26 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= X-Patchwork-Id: 13188129 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id A9654C761AF for ; Sun, 26 Mar 2023 14:32:36 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232350AbjCZOcf (ORCPT ); Sun, 26 Mar 2023 10:32:35 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59754 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230198AbjCZOcd (ORCPT ); Sun, 26 Mar 2023 10:32:33 -0400 Received: from metis.ext.pengutronix.de (metis.ext.pengutronix.de [IPv6:2001:67c:670:201:290:27ff:fe1d:cc33]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 607D461B1 for ; Sun, 26 Mar 2023 07:32:31 -0700 (PDT) Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.ext.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pgRQ3-0007kh-TF; Sun, 26 Mar 2023 16:32:27 +0200 Received: from [2a0a:edc0:0:900:1d::77] (helo=ptz.office.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtp (Exim 4.94.2) (envelope-from ) id 1pgRQ2-006rYd-7G; Sun, 26 Mar 2023 16:32:26 +0200 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1pgRQ1-0088Tl-98; Sun, 26 Mar 2023 16:32:25 +0200 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Hans Verkuil , Mauro Carvalho Chehab Cc: linux-media@vger.kernel.org, kernel@pengutronix.de Subject: [PATCH 001/117] media: cec-gpio: Convert to platform remove callback returning void Date: Sun, 26 Mar 2023 16:30:26 +0200 Message-Id: <20230326143224.572654-2-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230326143224.572654-1-u.kleine-koenig@pengutronix.de> References: <20230326143224.572654-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1762; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=CWo4O15bZJborxNexNwz9+q/5sIhuzdg9zysz4LyIFY=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBkIFZ1TrjSxRt0uTHZxZVpndQyyHNG9EFU5z8jR rcEfnAQArWJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZCBWdQAKCRCPgPtYfRL+ TpIEB/0RCrgpwW2RUyZqZQZ9MY4hMoLiIsTdeksJr9HBimUtK6d7a+0pT0moIR23de7IzFE61ji k0lXXaf0TpoDya6RM15RpCWPDW75QSz8ONa5w5OiDjx2UfiHot36nM57YXLtgFi9kVyOtSIHPVo c518rU0gJ9KTYkTnSZURXd05tu+fZgE5xc/TgFdqjGmqVJ0hTf/d5yRm0U3ste/O8RwRwvG3rpK //XMZ1gE8yaQNJwbo4ogwuNtoQI04hCI0+hGbG+D0lSCS61qCmfYG4fqNSko1Ti8ME/OhUIsMKl 84C2BZLiVA0TBfhHIY8k0DxCiMROcb+joBxGtSF3KIGBf0Cz X-Developer-Key: i=u.kleine-koenig@pengutronix.de; a=openpgp; fpr=0D2511F322BFAB1C1580266BE2DCDD9132669BD6 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.ext.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-media@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@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 (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 --- drivers/media/cec/platform/cec-gpio/cec-gpio.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/drivers/media/cec/platform/cec-gpio/cec-gpio.c b/drivers/media/cec/platform/cec-gpio/cec-gpio.c index c8c4efc83f5f..ff34490fd869 100644 --- a/drivers/media/cec/platform/cec-gpio/cec-gpio.c +++ b/drivers/media/cec/platform/cec-gpio/cec-gpio.c @@ -269,13 +269,12 @@ static int cec_gpio_probe(struct platform_device *pdev) return ret; } -static int cec_gpio_remove(struct platform_device *pdev) +static void cec_gpio_remove(struct platform_device *pdev) { struct cec_gpio *cec = platform_get_drvdata(pdev); cec_notifier_cec_adap_unregister(cec->notifier, cec->adap); cec_unregister_adapter(cec->adap); - return 0; } static const struct of_device_id cec_gpio_match[] = { @@ -288,7 +287,7 @@ MODULE_DEVICE_TABLE(of, cec_gpio_match); static struct platform_driver cec_gpio_pdrv = { .probe = cec_gpio_probe, - .remove = cec_gpio_remove, + .remove_new = cec_gpio_remove, .driver = { .name = "cec-gpio", .of_match_table = cec_gpio_match, From patchwork Sun Mar 26 14:30:28 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= X-Patchwork-Id: 13188128 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 82164C6FD1C for ; Sun, 26 Mar 2023 14:32:35 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232328AbjCZOce (ORCPT ); Sun, 26 Mar 2023 10:32:34 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59734 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229887AbjCZOcd (ORCPT ); Sun, 26 Mar 2023 10:32:33 -0400 Received: from metis.ext.pengutronix.de (metis.ext.pengutronix.de [IPv6:2001:67c:670:201:290:27ff:fe1d:cc33]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 621786593 for ; Sun, 26 Mar 2023 07:32:31 -0700 (PDT) Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.ext.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pgRQ4-0007kk-15; Sun, 26 Mar 2023 16:32:28 +0200 Received: from [2a0a:edc0:0:900:1d::77] (helo=ptz.office.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtp (Exim 4.94.2) (envelope-from ) id 1pgRQ3-006rYt-AI; Sun, 26 Mar 2023 16:32:27 +0200 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1pgRQ1-0088Tr-PT; Sun, 26 Mar 2023 16:32:25 +0200 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Hans Verkuil , Mauro Carvalho Chehab Cc: linux-media@vger.kernel.org, kernel@pengutronix.de Subject: [PATCH 002/117] media: cec-gpio: Convert to platform remove callback returning void Date: Sun, 26 Mar 2023 16:30:28 +0200 Message-Id: <20230326143224.572654-4-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230326143224.572654-1-u.kleine-koenig@pengutronix.de> References: <20230326143224.572654-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1762; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=CWo4O15bZJborxNexNwz9+q/5sIhuzdg9zysz4LyIFY=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBkIFZ3TrjSxRt0uTHZxZVpndQyyHNG9EFU5z8jR rcEfnAQArWJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZCBWdwAKCRCPgPtYfRL+ TgycB/42fhG74gGQo3G4/e1cfXQqHl5tBsdNRGHU7PpdrH3edCIcQbG+RnHsgo0KTt2Tb/cc9Tc qzN6dIw+Q49AtkCUP2kyn7WsMoij+s8nJFp4KFtVzt/rIWHZy+fpyFT7zmO925lCtsPB5S2FjxS SwhYQz1q+Ohnvo4h2pRpPNfNBSmmToawfoUo72ZpHk+iziZyy1Hd+Ifbol+CeZd5gtYDZhtlVHB 6vj3Ba8IMSHdK2RF8JwBJXtW3JwxG/vfSdHO0jRc832HnK5XrpWC/k/sifuxT7CnmYswI61mtOr 8QcGcu8HrnZCtekbnMPVs98mT0iLL+7MhjZKRxNYAuHqWeyS X-Developer-Key: i=u.kleine-koenig@pengutronix.de; a=openpgp; fpr=0D2511F322BFAB1C1580266BE2DCDD9132669BD6 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.ext.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-media@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@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 (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 --- drivers/media/cec/platform/cec-gpio/cec-gpio.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/drivers/media/cec/platform/cec-gpio/cec-gpio.c b/drivers/media/cec/platform/cec-gpio/cec-gpio.c index c8c4efc83f5f..ff34490fd869 100644 --- a/drivers/media/cec/platform/cec-gpio/cec-gpio.c +++ b/drivers/media/cec/platform/cec-gpio/cec-gpio.c @@ -269,13 +269,12 @@ static int cec_gpio_probe(struct platform_device *pdev) return ret; } -static int cec_gpio_remove(struct platform_device *pdev) +static void cec_gpio_remove(struct platform_device *pdev) { struct cec_gpio *cec = platform_get_drvdata(pdev); cec_notifier_cec_adap_unregister(cec->notifier, cec->adap); cec_unregister_adapter(cec->adap); - return 0; } static const struct of_device_id cec_gpio_match[] = { @@ -288,7 +287,7 @@ MODULE_DEVICE_TABLE(of, cec_gpio_match); static struct platform_driver cec_gpio_pdrv = { .probe = cec_gpio_probe, - .remove = cec_gpio_remove, + .remove_new = cec_gpio_remove, .driver = { .name = "cec-gpio", .of_match_table = cec_gpio_match, From patchwork Sun Mar 26 14:30:30 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= X-Patchwork-Id: 13188150 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id D789FC74A5B for ; Sun, 26 Mar 2023 14:33:00 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232519AbjCZOc7 (ORCPT ); Sun, 26 Mar 2023 10:32:59 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59860 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232384AbjCZOch (ORCPT ); Sun, 26 Mar 2023 10:32:37 -0400 Received: from metis.ext.pengutronix.de (metis.ext.pengutronix.de [IPv6:2001:67c:670:201:290:27ff:fe1d:cc33]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 373686593 for ; Sun, 26 Mar 2023 07:32:36 -0700 (PDT) Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.ext.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pgRQ3-0007kj-TF; Sun, 26 Mar 2023 16:32:27 +0200 Received: from [2a0a:edc0:0:900:1d::77] (helo=ptz.office.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtp (Exim 4.94.2) (envelope-from ) id 1pgRQ3-006rYp-3e; Sun, 26 Mar 2023 16:32:27 +0200 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1pgRQ2-0088Ty-6C; Sun, 26 Mar 2023 16:32:26 +0200 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Hans Verkuil , Mauro Carvalho Chehab , Benson Leung , =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= , Scott Chao , Rory Liu , Ajye Huang Cc: Guenter Roeck , linux-media@vger.kernel.org, chrome-platform@lists.linux.dev, kernel@pengutronix.de Subject: [PATCH 003/117] media: cros-ec-cec: Convert to platform remove callback returning void Date: Sun, 26 Mar 2023 16:30:30 +0200 Message-Id: <20230326143224.572654-6-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230326143224.572654-1-u.kleine-koenig@pengutronix.de> References: <20230326143224.572654-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1824; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=7R9wKQxWA44fiXMEYARiwDyElWOf/YQkKOdlXBlMzbk=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBkIFZ58QDpXlzM0zNEkr6TWGtNeAotmE8ENdA8i +nW33qtuOqJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZCBWeQAKCRCPgPtYfRL+ TppCB/93wZB5ZjDqzIYqffIxt9i6KyyUwipLcXNpswTw47lIhAn5FcKeus4st6tmtZ9gC57A0PS YBGYErj+uD/ZpXkqx+WV8d6Kg8ZdVtdHQT2UJ0oWq7sYZQ5sLUkMiTZpjMTExnDnDQm6UAAdKg2 lsgaq8WvIB1Yx673JBmi/3wfpiOgj6+QafjuBatj9RAIBua1ZEvwp283bA148WxMLjXQKN3n2wA q9iTk9wW6eprs/tlMK9uaLI7sv/IvzqWOueE2Oi2EKEIYzCA8iTG67jNlMMOCOb9WB7ywTIDqO1 x05Bd/N2YZ6DxAgWKoCkhP9CtAHzyI7U270VeZaO15g1WaO1 X-Developer-Key: i=u.kleine-koenig@pengutronix.de; a=openpgp; fpr=0D2511F322BFAB1C1580266BE2DCDD9132669BD6 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.ext.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-media@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@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 (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 Reviewed-by: Guenter Roeck --- drivers/media/cec/platform/cros-ec/cros-ec-cec.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/media/cec/platform/cros-ec/cros-ec-cec.c b/drivers/media/cec/platform/cros-ec/cros-ec-cec.c index 960432230bbf..3d2600af9fc1 100644 --- a/drivers/media/cec/platform/cros-ec/cros-ec-cec.c +++ b/drivers/media/cec/platform/cros-ec/cros-ec-cec.c @@ -326,7 +326,7 @@ static int cros_ec_cec_probe(struct platform_device *pdev) return ret; } -static int cros_ec_cec_remove(struct platform_device *pdev) +static void cros_ec_cec_remove(struct platform_device *pdev) { struct cros_ec_cec *cros_ec_cec = platform_get_drvdata(pdev); struct device *dev = &pdev->dev; @@ -346,13 +346,11 @@ static int cros_ec_cec_remove(struct platform_device *pdev) cec_notifier_cec_adap_unregister(cros_ec_cec->notify, cros_ec_cec->adap); cec_unregister_adapter(cros_ec_cec->adap); - - return 0; } static struct platform_driver cros_ec_cec_driver = { .probe = cros_ec_cec_probe, - .remove = cros_ec_cec_remove, + .remove_new = cros_ec_cec_remove, .driver = { .name = DRV_NAME, .pm = &cros_ec_cec_pm_ops, From patchwork Sun Mar 26 14:30:31 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= X-Patchwork-Id: 13188135 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 5B1A7C77B62 for ; Sun, 26 Mar 2023 14:32:42 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232400AbjCZOcl (ORCPT ); Sun, 26 Mar 2023 10:32:41 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59808 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232339AbjCZOce (ORCPT ); Sun, 26 Mar 2023 10:32:34 -0400 Received: from metis.ext.pengutronix.de (metis.ext.pengutronix.de [IPv6:2001:67c:670:201:290:27ff:fe1d:cc33]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D0AF565AC for ; Sun, 26 Mar 2023 07:32:32 -0700 (PDT) Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.ext.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pgRQ4-0007kr-D7; Sun, 26 Mar 2023 16:32:28 +0200 Received: from [2a0a:edc0:0:900:1d::77] (helo=ptz.office.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtp (Exim 4.94.2) (envelope-from ) id 1pgRQ3-006rYy-LC; Sun, 26 Mar 2023 16:32:27 +0200 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1pgRQ2-0088U2-Ca; Sun, 26 Mar 2023 16:32:26 +0200 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Neil Armstrong , Hans Verkuil , Mauro Carvalho Chehab , Kevin Hilman Cc: Jerome Brunet , Martin Blumenstingl , linux-media@vger.kernel.org, linux-amlogic@lists.infradead.org, linux-arm-kernel@lists.infradead.org, kernel@pengutronix.de Subject: [PATCH 004/117] media: ao-cec-g12a: Convert to platform remove callback returning void Date: Sun, 26 Mar 2023 16:30:31 +0200 Message-Id: <20230326143224.572654-7-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230326143224.572654-1-u.kleine-koenig@pengutronix.de> References: <20230326143224.572654-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=2005; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=v1wYGsh94W2lZgFeQJwM78nPF+W6bmgfpxjhbc5mNVE=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBkIFZ71dphtajewDN9c9hG2KxI9Sc8tzx2SkZbo HDC3rcHxbKJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZCBWewAKCRCPgPtYfRL+ Tr6rCACJ5dd9wV3bKSu9kvblrZbNIhyIOzeYRxGMF/5SPdamElcP0qqsv960558Vb6Nz1qeTP3t EhZAqGmghQIP7sia/5v9oWXOQyCtaRoHecq7X+TdL2E1BmiGmGGAh4EWX4PS2etoZ0Cp6Llblr6 yucTSe3Anc9LELmrN5Kq1TCU8/Sxv3L0dGvLR2k+yppvduOlWsD3gZAVlwmRsbVDy7/+mqTu323 GEZb18L83DSZh3DWo8felBcyQVCd+jo/agxDgy7Q+nsBzOzoRjvzMgh6JUI1c8wWCPXvQhNDcwX 92epQ4KNdNKMDy/UhyqnQyHbQtSQgdIb6hS63u8u6hH03pPC X-Developer-Key: i=u.kleine-koenig@pengutronix.de; a=openpgp; fpr=0D2511F322BFAB1C1580266BE2DCDD9132669BD6 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.ext.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-media@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@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 (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 Reviewed-by: Martin Blumenstingl --- drivers/media/cec/platform/meson/ao-cec-g12a.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/media/cec/platform/meson/ao-cec-g12a.c b/drivers/media/cec/platform/meson/ao-cec-g12a.c index 68fe6d6a8178..51294b9b6cd5 100644 --- a/drivers/media/cec/platform/meson/ao-cec-g12a.c +++ b/drivers/media/cec/platform/meson/ao-cec-g12a.c @@ -744,7 +744,7 @@ static int meson_ao_cec_g12a_probe(struct platform_device *pdev) return ret; } -static int meson_ao_cec_g12a_remove(struct platform_device *pdev) +static void meson_ao_cec_g12a_remove(struct platform_device *pdev) { struct meson_ao_cec_g12a_device *ao_cec = platform_get_drvdata(pdev); @@ -753,8 +753,6 @@ static int meson_ao_cec_g12a_remove(struct platform_device *pdev) cec_notifier_cec_adap_unregister(ao_cec->notify, ao_cec->adap); cec_unregister_adapter(ao_cec->adap); - - return 0; } static const struct meson_ao_cec_g12a_data ao_cec_g12a_data = { @@ -780,7 +778,7 @@ MODULE_DEVICE_TABLE(of, meson_ao_cec_g12a_of_match); static struct platform_driver meson_ao_cec_g12a_driver = { .probe = meson_ao_cec_g12a_probe, - .remove = meson_ao_cec_g12a_remove, + .remove_new = meson_ao_cec_g12a_remove, .driver = { .name = "meson-ao-cec-g12a", .of_match_table = of_match_ptr(meson_ao_cec_g12a_of_match), From patchwork Sun Mar 26 14:30:32 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= X-Patchwork-Id: 13188130 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id B71E9C77B61 for ; Sun, 26 Mar 2023 14:32:37 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232362AbjCZOcg (ORCPT ); Sun, 26 Mar 2023 10:32:36 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59774 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232323AbjCZOce (ORCPT ); Sun, 26 Mar 2023 10:32:34 -0400 Received: from metis.ext.pengutronix.de (metis.ext.pengutronix.de [IPv6:2001:67c:670:201:290:27ff:fe1d:cc33]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B66AF59DB for ; Sun, 26 Mar 2023 07:32:32 -0700 (PDT) Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.ext.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pgRQ4-0007lN-Qf; Sun, 26 Mar 2023 16:32:28 +0200 Received: from [2a0a:edc0:0:900:1d::77] (helo=ptz.office.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtp (Exim 4.94.2) (envelope-from ) id 1pgRQ4-006rZC-4F; Sun, 26 Mar 2023 16:32:28 +0200 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1pgRQ2-0088U6-JU; Sun, 26 Mar 2023 16:32:26 +0200 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Neil Armstrong , Hans Verkuil , Mauro Carvalho Chehab , Kevin Hilman Cc: Jerome Brunet , Martin Blumenstingl , linux-media@vger.kernel.org, linux-amlogic@lists.infradead.org, linux-arm-kernel@lists.infradead.org, kernel@pengutronix.de Subject: [PATCH 005/117] media: ao-cec: Convert to platform remove callback returning void Date: Sun, 26 Mar 2023 16:30:32 +0200 Message-Id: <20230326143224.572654-8-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230326143224.572654-1-u.kleine-koenig@pengutronix.de> References: <20230326143224.572654-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1917; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=T42yo2zTTmIkn3GXSFDOaa/xozG97/RfNm55diexSxI=; b=owGbwMvMwMXY3/A7olbonx/jabUkhhSFsJovD344vJ19Nu3j9tuvcjkPH01uN1b2VZC26H36b 1vXTO9pnYzGLAyMXAyyYoos9o1rMq2q5CI71/67DDOIlQlkCgMXpwBMZMYCDoZOlmdfKxeylh38 lMt5wERbf8WFaq/GQGH5Sn2xpErPvyfjAy4fv/r83K2bHRJqXoX2J8uDo0OuXG7Sd/xkZeCpdjB gxu/88iklj4OcNuZKrPNMVYu4retkYd528P37NVmc+VYMBhHXM1vSlNmetLL28LxJSuruPJR/W6 v3+NUl+u28m1sbjSzCyrZlXImrzk943WZasXL7f9XbiY93nTxbs7F+tmJW7temi6/f+703u1K8J 7Uq7dbFnEeLjtWba5n8nvby0uvGD40CQd98izLrbk34+s80S9NI+5uoU5SA7++m0N1PtaV+W6om TpK+5CNlbNO25ALr8buOYl/MXnAfmPbnpezztVvazWrMAQ== X-Developer-Key: i=u.kleine-koenig@pengutronix.de; a=openpgp; fpr=0D2511F322BFAB1C1580266BE2DCDD9132669BD6 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.ext.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-media@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@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 (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 Reviewed-by: Martin Blumenstingl --- drivers/media/cec/platform/meson/ao-cec.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/media/cec/platform/meson/ao-cec.c b/drivers/media/cec/platform/meson/ao-cec.c index 6b440f0635d9..f6f51a34f7bd 100644 --- a/drivers/media/cec/platform/meson/ao-cec.c +++ b/drivers/media/cec/platform/meson/ao-cec.c @@ -696,7 +696,7 @@ static int meson_ao_cec_probe(struct platform_device *pdev) return ret; } -static int meson_ao_cec_remove(struct platform_device *pdev) +static void meson_ao_cec_remove(struct platform_device *pdev) { struct meson_ao_cec_device *ao_cec = platform_get_drvdata(pdev); @@ -704,8 +704,6 @@ static int meson_ao_cec_remove(struct platform_device *pdev) cec_notifier_cec_adap_unregister(ao_cec->notify, ao_cec->adap); cec_unregister_adapter(ao_cec->adap); - - return 0; } static const struct of_device_id meson_ao_cec_of_match[] = { @@ -716,7 +714,7 @@ MODULE_DEVICE_TABLE(of, meson_ao_cec_of_match); static struct platform_driver meson_ao_cec_driver = { .probe = meson_ao_cec_probe, - .remove = meson_ao_cec_remove, + .remove_new = meson_ao_cec_remove, .driver = { .name = "meson-ao-cec", .of_match_table = of_match_ptr(meson_ao_cec_of_match), From patchwork Sun Mar 26 14:30:33 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= X-Patchwork-Id: 13188148 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 742FFC77B61 for ; Sun, 26 Mar 2023 14:32:57 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232377AbjCZOcz (ORCPT ); Sun, 26 Mar 2023 10:32:55 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59922 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232387AbjCZOci (ORCPT ); Sun, 26 Mar 2023 10:32:38 -0400 Received: from metis.ext.pengutronix.de (metis.ext.pengutronix.de [IPv6:2001:67c:670:201:290:27ff:fe1d:cc33]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6199A6EAF for ; Sun, 26 Mar 2023 07:32:37 -0700 (PDT) Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.ext.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pgRQ4-0007kx-CV; Sun, 26 Mar 2023 16:32:28 +0200 Received: from [2a0a:edc0:0:900:1d::77] (helo=ptz.office.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtp (Exim 4.94.2) (envelope-from ) id 1pgRQ3-006rYz-Lv; Sun, 26 Mar 2023 16:32:27 +0200 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1pgRQ2-0088U9-RW; Sun, 26 Mar 2023 16:32:26 +0200 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Marek Szyprowski , Hans Verkuil , Mauro Carvalho Chehab Cc: linux-samsung-soc@vger.kernel.org, linux-media@vger.kernel.org, kernel@pengutronix.de Subject: [PATCH 006/117] media: s5p_cec: Convert to platform remove callback returning void Date: Sun, 26 Mar 2023 16:30:33 +0200 Message-Id: <20230326143224.572654-9-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230326143224.572654-1-u.kleine-koenig@pengutronix.de> References: <20230326143224.572654-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1775; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=tcL5tkmuSnS1HmL16JCmXlgKNGuUJ0rYD9dyuN308RI=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBkIFZ9l7PCy4kTO1trNzbj+ciNYh9efVmRJt/RW G9iM/wommaJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZCBWfQAKCRCPgPtYfRL+ TjAxCACYlbgxZ3vtA7orhIDBO1GfWZ5YMpAmrpb3TuUcz7zhPFbfjOe7YgIlYmQ5BbWhpk8TgpX EvoHt845y/GnxBsYEx3d7oVYZyv0J7fr2V5fYQIai0HgxJXHKsOFxMBDC0ddjbZwsnYy9O4JuBG LKIkWoYCTEzG8iQgJwazfLOOiwgVHV9UJB5zKLqXxZQU1eggfbOMCH8STL/P7xEoGEwzZ/SU5AF sOLQUaeJs/7XaHVTtArKHCsAp4Pr9rgE5ZXwsNIxQreVWIxznM0BLd0KQOceFmI/AzOV0DKJz09 8JfW+0OordTnpai/X3cNIKqB2deGntXcxa/+hlEIXO1GdBrM X-Developer-Key: i=u.kleine-koenig@pengutronix.de; a=openpgp; fpr=0D2511F322BFAB1C1580266BE2DCDD9132669BD6 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.ext.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-media@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@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 (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 --- drivers/media/cec/platform/s5p/s5p_cec.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/drivers/media/cec/platform/s5p/s5p_cec.c b/drivers/media/cec/platform/s5p/s5p_cec.c index 0a30e7acdc10..51ab4a80aafe 100644 --- a/drivers/media/cec/platform/s5p/s5p_cec.c +++ b/drivers/media/cec/platform/s5p/s5p_cec.c @@ -249,14 +249,13 @@ static int s5p_cec_probe(struct platform_device *pdev) return ret; } -static int s5p_cec_remove(struct platform_device *pdev) +static void s5p_cec_remove(struct platform_device *pdev) { struct s5p_cec_dev *cec = platform_get_drvdata(pdev); cec_notifier_cec_adap_unregister(cec->notifier, cec->adap); cec_unregister_adapter(cec->adap); pm_runtime_disable(&pdev->dev); - return 0; } static int __maybe_unused s5p_cec_runtime_suspend(struct device *dev) @@ -295,7 +294,7 @@ MODULE_DEVICE_TABLE(of, s5p_cec_match); static struct platform_driver s5p_cec_pdrv = { .probe = s5p_cec_probe, - .remove = s5p_cec_remove, + .remove_new = s5p_cec_remove, .driver = { .name = CEC_NAME, .of_match_table = s5p_cec_match, From patchwork Sun Mar 26 14:30:34 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= X-Patchwork-Id: 13188131 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 0738EC74A5B for ; Sun, 26 Mar 2023 14:32:39 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232385AbjCZOch (ORCPT ); Sun, 26 Mar 2023 10:32:37 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59804 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232330AbjCZOce (ORCPT ); Sun, 26 Mar 2023 10:32:34 -0400 Received: from metis.ext.pengutronix.de (metis.ext.pengutronix.de [IPv6:2001:67c:670:201:290:27ff:fe1d:cc33]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 61FDA658D for ; Sun, 26 Mar 2023 07:32:31 -0700 (PDT) Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.ext.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pgRQ4-0007lb-Sc; Sun, 26 Mar 2023 16:32:28 +0200 Received: from [2a0a:edc0:0:900:1d::77] (helo=ptz.office.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtp (Exim 4.94.2) (envelope-from ) id 1pgRQ4-006rZH-7k; Sun, 26 Mar 2023 16:32:28 +0200 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1pgRQ3-0088UC-2X; Sun, 26 Mar 2023 16:32:27 +0200 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Ettore Chimenti , Hans Verkuil , Mauro Carvalho Chehab Cc: linux-media@vger.kernel.org, kernel@pengutronix.de Subject: [PATCH 007/117] media: seco-cec: Convert to platform remove callback returning void Date: Sun, 26 Mar 2023 16:30:34 +0200 Message-Id: <20230326143224.572654-10-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230326143224.572654-1-u.kleine-koenig@pengutronix.de> References: <20230326143224.572654-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1754; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=opknbcOaz9XAlkEWcpTYnQvvZUcCAnIWXl7+s62C8BA=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBkIFZ+x42d2VhJal8h9RkkF/JNldzmr7jV4XXVb 4LynSO1wzCJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZCBWfgAKCRCPgPtYfRL+ To8xCACRXsSYopUCVyDUJuiche2ywDONpOUaIUPNZnfC28fsyt5srKfvJ9SZawoI4S3qMVkptZZ xcoXyRxl1irRGlrwqTQh/oe6D98lqXjRff+qE+SRo9A2fCplrR7XW3Ggwg69mfFSsF7UDywQqsk 4XAcZFWgbVvnhkA4eXB/GqSDmnLqTAkm+VrxT4vm4m1OuvYqXwRUSNij6l0YARLeucL8YPPo383 Cw1dJrrsQoJTahf4XMtTV6KjS7HRIYCHsuvScnhwTB/kQjmL2P8Z3xOA1tH+iRV9A09A0MceXEv QWEuUNnYn5fzvyXsn09ISn6dIrFNYqNFFhUua0z/ZLEsirz0 X-Developer-Key: i=u.kleine-koenig@pengutronix.de; a=openpgp; fpr=0D2511F322BFAB1C1580266BE2DCDD9132669BD6 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.ext.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-media@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@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 (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 --- drivers/media/cec/platform/seco/seco-cec.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/media/cec/platform/seco/seco-cec.c b/drivers/media/cec/platform/seco/seco-cec.c index 580905e3d066..5d4c5a2cae09 100644 --- a/drivers/media/cec/platform/seco/seco-cec.c +++ b/drivers/media/cec/platform/seco/seco-cec.c @@ -668,7 +668,7 @@ static int secocec_probe(struct platform_device *pdev) return ret; } -static int secocec_remove(struct platform_device *pdev) +static void secocec_remove(struct platform_device *pdev) { struct secocec_data *secocec = platform_get_drvdata(pdev); u16 val; @@ -686,8 +686,6 @@ static int secocec_remove(struct platform_device *pdev) release_region(BRA_SMB_BASE_ADDR, 7); dev_dbg(&pdev->dev, "CEC device removed\n"); - - return 0; } #ifdef CONFIG_PM_SLEEP @@ -780,7 +778,7 @@ static struct platform_driver secocec_driver = { .pm = SECOCEC_PM_OPS, }, .probe = secocec_probe, - .remove = secocec_remove, + .remove_new = secocec_remove, }; module_platform_driver(secocec_driver); From patchwork Sun Mar 26 14:30:35 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= X-Patchwork-Id: 13188141 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 4BF37C74A5B for ; Sun, 26 Mar 2023 14:32:49 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232446AbjCZOcr (ORCPT ); Sun, 26 Mar 2023 10:32:47 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59850 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232365AbjCZOcg (ORCPT ); Sun, 26 Mar 2023 10:32:36 -0400 Received: from metis.ext.pengutronix.de (metis.ext.pengutronix.de [IPv6:2001:67c:670:201:290:27ff:fe1d:cc33]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id EE91261B1 for ; Sun, 26 Mar 2023 07:32:33 -0700 (PDT) Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.ext.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pgRQ6-0007mj-4E; Sun, 26 Mar 2023 16:32:30 +0200 Received: from [2a0a:edc0:0:900:1d::77] (helo=ptz.office.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtp (Exim 4.94.2) (envelope-from ) id 1pgRQ4-006rZc-S6; Sun, 26 Mar 2023 16:32:28 +0200 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1pgRQ3-0088UG-9G; Sun, 26 Mar 2023 16:32:27 +0200 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Alain Volmat , Hans Verkuil , Mauro Carvalho Chehab Cc: linux-media@vger.kernel.org, kernel@pengutronix.de Subject: [PATCH 008/117] media: stih-cec: Convert to platform remove callback returning void Date: Sun, 26 Mar 2023 16:30:35 +0200 Message-Id: <20230326143224.572654-11-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230326143224.572654-1-u.kleine-koenig@pengutronix.de> References: <20230326143224.572654-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1739; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=oysvyHhF1RsezmNGArgGVCyDvKBVEIhYUQ1ZumlOgsc=; b=owGbwMvMwMXY3/A7olbonx/jabUkhhSFsPqXGrzNJ9emHn7WlR2dtXruJNP3yz/kPJM88eLtm kk8gu9ndjIaszAwcjHIiimy2DeuybSqkovsXPvvMswgViaQKQxcnAIwEfki9l/Mh6fLp4g9VJz1 KnhPnHyZYeLs68UFvae2L10TkOYdlX+3wmnuVm32VVazN/OmFq5ufSHo46MkzbXPsyfOpYT3Tnb 8z+LzOiHra7p+i/xl1TEIeDh5vRCPknLCxIm+auuTmV4+jGisefWgOdeY7+6mrPcOxpz/qnUsV1 p/XGbaLsWoljlXVPt01u4slmkN5h3xE1OXfBV9mxR7eoVz7t96/b2/cuTEl0owJ52WYWh9UnAs7 +NKU66E5kuHyrzLMmUdjAP3H4n7mntNdLOJj5LPM+/gHc1VXCpbVide0XqRd7bqvtavVxIlwgZy O0vOm284wDFPqeK33ZXFrx47cbsn2crpTv6/vn/CSeHHAA== X-Developer-Key: i=u.kleine-koenig@pengutronix.de; a=openpgp; fpr=0D2511F322BFAB1C1580266BE2DCDD9132669BD6 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.ext.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-media@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@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 (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 --- drivers/media/cec/platform/sti/stih-cec.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/media/cec/platform/sti/stih-cec.c b/drivers/media/cec/platform/sti/stih-cec.c index 4edbdd09535d..a20fc5c0c88d 100644 --- a/drivers/media/cec/platform/sti/stih-cec.c +++ b/drivers/media/cec/platform/sti/stih-cec.c @@ -364,14 +364,12 @@ static int stih_cec_probe(struct platform_device *pdev) return ret; } -static int stih_cec_remove(struct platform_device *pdev) +static void stih_cec_remove(struct platform_device *pdev) { struct stih_cec *cec = platform_get_drvdata(pdev); cec_notifier_cec_adap_unregister(cec->notifier, cec->adap); cec_unregister_adapter(cec->adap); - - return 0; } static const struct of_device_id stih_cec_match[] = { @@ -384,7 +382,7 @@ MODULE_DEVICE_TABLE(of, stih_cec_match); static struct platform_driver stih_cec_pdrv = { .probe = stih_cec_probe, - .remove = stih_cec_remove, + .remove_new = stih_cec_remove, .driver = { .name = CEC_NAME, .of_match_table = stih_cec_match, From patchwork Sun Mar 26 14:30:36 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= X-Patchwork-Id: 13188158 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id BAB25C77B61 for ; Sun, 26 Mar 2023 14:33:10 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230129AbjCZOdJ (ORCPT ); Sun, 26 Mar 2023 10:33:09 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60336 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232410AbjCZOco (ORCPT ); Sun, 26 Mar 2023 10:32:44 -0400 Received: from metis.ext.pengutronix.de (metis.ext.pengutronix.de [IPv6:2001:67c:670:201:290:27ff:fe1d:cc33]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 624417DA7 for ; Sun, 26 Mar 2023 07:32:42 -0700 (PDT) Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.ext.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pgRQ7-0007lc-KK; Sun, 26 Mar 2023 16:32:31 +0200 Received: from [2a0a:edc0:0:900:1d::77] (helo=ptz.office.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtp (Exim 4.94.2) (envelope-from ) id 1pgRQ4-006rZG-7s; Sun, 26 Mar 2023 16:32:28 +0200 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1pgRQ3-0088UK-G3; Sun, 26 Mar 2023 16:32:27 +0200 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Hans Verkuil , Mauro Carvalho Chehab , Maxime Coquelin , Alexandre Torgue , =?utf-8?q?Uwe_Kleine-K?= =?utf-8?q?=C3=B6nig?= , Sean Young , Sakari Ailus , Ricardo Ribalda , Laurent Pinchart , Yang Yingliang Cc: linux-media@vger.kernel.org, linux-stm32@st-md-mailman.stormreply.com, linux-arm-kernel@lists.infradead.org, kernel@pengutronix.de Subject: [PATCH 009/117] media: stm32-cec: Convert to platform remove callback returning void Date: Sun, 26 Mar 2023 16:30:36 +0200 Message-Id: <20230326143224.572654-12-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230326143224.572654-1-u.kleine-koenig@pengutronix.de> References: <20230326143224.572654-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1831; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=D/UAC+t+fl8c6EjlWf6JDxvuYAMHu5bYFNCcxsw+JGM=; b=owGbwMvMwMXY3/A7olbonx/jabUkhhSFsAbrwF6Dzy1NElLhi5qCVORf8/NW/5rkxW5prSeRa Ppenr2T0ZiFgZGLQVZMkcW+cU2mVZVcZOfaf5dhBrEygUxh4OIUgIloHuRgmPi/2ny+i9XGX9Hv cj8K8asKTHh7eOVSu2VnF1Xrap96r//j2r8PXm1LZ6xN8T5y9nTDdL5ZNQEmzcbVCluNXV/Z2P2 4d0Yz3ldfqP2a+K3Sf3wTdoT9bj0uZ7imZNLdiAU9x49XX9os3W8lemcCVxrrveKYloCYXdW/rH NncoQvWm+w9eq5dTlt3r+dV+09eFp8456QY14NBdtvPt/9RtT4XiKPEUPz3uj8AoX4lhLbZo9NE Rf7PNj3bym/KJ6z4ofQ1rtlH1Tz2F5t0An+d5XbjKnvL9dEnzUiXLUvnRl6ixTMfnVJ5Vw4O+3k i2hB/bkutcdYEi2rN9Z4Kz374r53G5N/sU+X2vp325QTAQ== X-Developer-Key: i=u.kleine-koenig@pengutronix.de; a=openpgp; fpr=0D2511F322BFAB1C1580266BE2DCDD9132669BD6 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.ext.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-media@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@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 (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 --- drivers/media/cec/platform/stm32/stm32-cec.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/media/cec/platform/stm32/stm32-cec.c b/drivers/media/cec/platform/stm32/stm32-cec.c index 7b2db46a5722..ada3d153362a 100644 --- a/drivers/media/cec/platform/stm32/stm32-cec.c +++ b/drivers/media/cec/platform/stm32/stm32-cec.c @@ -344,7 +344,7 @@ static int stm32_cec_probe(struct platform_device *pdev) return ret; } -static int stm32_cec_remove(struct platform_device *pdev) +static void stm32_cec_remove(struct platform_device *pdev) { struct stm32_cec *cec = platform_get_drvdata(pdev); @@ -352,8 +352,6 @@ static int stm32_cec_remove(struct platform_device *pdev) clk_unprepare(cec->clk_hdmi_cec); cec_unregister_adapter(cec->adap); - - return 0; } static const struct of_device_id stm32_cec_of_match[] = { @@ -364,7 +362,7 @@ MODULE_DEVICE_TABLE(of, stm32_cec_of_match); static struct platform_driver stm32_cec_driver = { .probe = stm32_cec_probe, - .remove = stm32_cec_remove, + .remove_new = stm32_cec_remove, .driver = { .name = CEC_NAME, .of_match_table = stm32_cec_of_match, From patchwork Sun Mar 26 14:30:37 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= X-Patchwork-Id: 13188147 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id D0E76C6FD1C for ; Sun, 26 Mar 2023 14:32:55 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232494AbjCZOcy (ORCPT ); Sun, 26 Mar 2023 10:32:54 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59964 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232380AbjCZOch (ORCPT ); Sun, 26 Mar 2023 10:32:37 -0400 Received: from metis.ext.pengutronix.de (metis.ext.pengutronix.de [IPv6:2001:67c:670:201:290:27ff:fe1d:cc33]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5A9717AB1 for ; Sun, 26 Mar 2023 07:32:35 -0700 (PDT) Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.ext.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pgRQ5-0007m3-5H; Sun, 26 Mar 2023 16:32:29 +0200 Received: from [2a0a:edc0:0:900:1d::77] (helo=ptz.office.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtp (Exim 4.94.2) (envelope-from ) id 1pgRQ4-006rZO-El; Sun, 26 Mar 2023 16:32:28 +0200 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1pgRQ3-0088UP-PV; Sun, 26 Mar 2023 16:32:27 +0200 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Hans Verkuil , Mauro Carvalho Chehab , Thierry Reding , Jonathan Hunter Cc: linux-tegra@vger.kernel.org, linux-media@vger.kernel.org, kernel@pengutronix.de Subject: [PATCH 010/117] media: tegra_cec: Convert to platform remove callback returning void Date: Sun, 26 Mar 2023 16:30:37 +0200 Message-Id: <20230326143224.572654-13-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230326143224.572654-1-u.kleine-koenig@pengutronix.de> References: <20230326143224.572654-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1802; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=WdH7zj7jJfhuqfwnTFIvZL9loWPxn7zYQd+ZSpifBkg=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBkIFaBJ/gZrFMF+ndWuQKY8bBkUcpv6VtZTD1ke iKnnmWfPpWJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZCBWgQAKCRCPgPtYfRL+ TqsMB/9bhK7nISK4AJ6iiDvOXMZ0TL7t335DQyf5QD484DG+LlcUDp37CGlG1MZfzi5fckQvF4i LSRyNdQ3wUat+Pfp0WPrlzwVN6/ls+NH039bpF9LVBVIQfUyUWeSuaDCKZq+Hl1AWSFov0RJPB4 oRELcdf/h4URiBQjmqhz6oraiyEzjtKp5/vAF5Wx19n2TsuiM+JRTc93v8TmP2kOuR2+G7lZ3S4 VEf+K1SoOX166LOwKAqi4/OtA9UdHxs9Lb+2EA75JrZhL+yUmy9swIIQOkQxT+t6/ziCePj2YJH s08AbAOnGZ2hv/McNuMT+eKU1scWnkRWgYM4ZaqFkNlZo3Tl X-Developer-Key: i=u.kleine-koenig@pengutronix.de; a=openpgp; fpr=0D2511F322BFAB1C1580266BE2DCDD9132669BD6 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.ext.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-media@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@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 (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 Acked-by: Thierry Reding --- drivers/media/cec/platform/tegra/tegra_cec.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/media/cec/platform/tegra/tegra_cec.c b/drivers/media/cec/platform/tegra/tegra_cec.c index 5e907395ca2e..04dc06e3c42a 100644 --- a/drivers/media/cec/platform/tegra/tegra_cec.c +++ b/drivers/media/cec/platform/tegra/tegra_cec.c @@ -421,7 +421,7 @@ static int tegra_cec_probe(struct platform_device *pdev) return ret; } -static int tegra_cec_remove(struct platform_device *pdev) +static void tegra_cec_remove(struct platform_device *pdev) { struct tegra_cec *cec = platform_get_drvdata(pdev); @@ -429,8 +429,6 @@ static int tegra_cec_remove(struct platform_device *pdev) cec_notifier_cec_adap_unregister(cec->notifier, cec->adap); cec_unregister_adapter(cec->adap); - - return 0; } #ifdef CONFIG_PM @@ -467,7 +465,7 @@ static struct platform_driver tegra_cec_driver = { .of_match_table = of_match_ptr(tegra_cec_of_match), }, .probe = tegra_cec_probe, - .remove = tegra_cec_remove, + .remove_new = tegra_cec_remove, #ifdef CONFIG_PM .suspend = tegra_cec_suspend, From patchwork Sun Mar 26 14:30:38 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= X-Patchwork-Id: 13188137 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 3EC43C761AF for ; Sun, 26 Mar 2023 14:32:44 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232403AbjCZOcn (ORCPT ); Sun, 26 Mar 2023 10:32:43 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59862 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232358AbjCZOcf (ORCPT ); Sun, 26 Mar 2023 10:32:35 -0400 Received: from metis.ext.pengutronix.de (metis.ext.pengutronix.de [IPv6:2001:67c:670:201:290:27ff:fe1d:cc33]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 02BBB6593 for ; Sun, 26 Mar 2023 07:32:34 -0700 (PDT) Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.ext.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pgRQ6-0007mb-5d; Sun, 26 Mar 2023 16:32:30 +0200 Received: from [2a0a:edc0:0:900:1d::77] (helo=ptz.office.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtp (Exim 4.94.2) (envelope-from ) id 1pgRQ4-006rZX-QR; Sun, 26 Mar 2023 16:32:28 +0200 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1pgRQ3-0088US-VS; Sun, 26 Mar 2023 16:32:27 +0200 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Antti Palosaari , Mauro Carvalho Chehab Cc: linux-media@vger.kernel.org, kernel@pengutronix.de Subject: [PATCH 011/117] media: rtl2832_sdr: Convert to platform remove callback returning void Date: Sun, 26 Mar 2023 16:30:38 +0200 Message-Id: <20230326143224.572654-14-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230326143224.572654-1-u.kleine-koenig@pengutronix.de> References: <20230326143224.572654-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1862; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=vE13OBywjSGQAtKRy9vyU6KCfvR9dbYK8EQyoIjKxyI=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBkIFaDpef24v6GE3tEtLjcZf2O1ymSm5hVdjig3 iTbH3k7UkuJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZCBWgwAKCRCPgPtYfRL+ TvXLCACmYC/R1fl7aaM51Fj6pO+D/1fUAWu1Kk0JgBxYe6/fsLbY7k7flAF094PI2DaxXcvR51d CA1a+30ylC+ZTkEcvXm+5mxlH2SCMWavlctSXaFBBg7HAr581H30PymT+wUJZNasWDTP9BdEZY3 eLLEAkWobTMIVv5EQpLP7lOoK+34oEQyRVd41MDsJ0JUCEFTAz6CdN/4Uj6gdC0pW8GmFvvZqeJ wKhoap29YMvn+GI7h/QHKTThsOxH8NjM/w8qbEAVgH+lReReftjxYJOpnuAscGsH7rn5Kk/3eWH 64XettA7uZtwIeoOtO+U/5KSBWdV92GrIpcFPCtrIFhxwRho X-Developer-Key: i=u.kleine-koenig@pengutronix.de; a=openpgp; fpr=0D2511F322BFAB1C1580266BE2DCDD9132669BD6 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.ext.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-media@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@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 (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 --- drivers/media/dvb-frontends/rtl2832_sdr.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/media/dvb-frontends/rtl2832_sdr.c b/drivers/media/dvb-frontends/rtl2832_sdr.c index 05f71d169726..02c619e51641 100644 --- a/drivers/media/dvb-frontends/rtl2832_sdr.c +++ b/drivers/media/dvb-frontends/rtl2832_sdr.c @@ -1463,7 +1463,7 @@ static int rtl2832_sdr_probe(struct platform_device *pdev) return ret; } -static int rtl2832_sdr_remove(struct platform_device *pdev) +static void rtl2832_sdr_remove(struct platform_device *pdev) { struct rtl2832_sdr_dev *dev = platform_get_drvdata(pdev); @@ -1479,8 +1479,6 @@ static int rtl2832_sdr_remove(struct platform_device *pdev) mutex_unlock(&dev->vb_queue_lock); v4l2_device_put(&dev->v4l2_dev); module_put(pdev->dev.parent->driver->owner); - - return 0; } static struct platform_driver rtl2832_sdr_driver = { @@ -1488,7 +1486,7 @@ static struct platform_driver rtl2832_sdr_driver = { .name = "rtl2832_sdr", }, .probe = rtl2832_sdr_probe, - .remove = rtl2832_sdr_remove, + .remove_new = rtl2832_sdr_remove, }; module_platform_driver(rtl2832_sdr_driver); From patchwork Sun Mar 26 14:30:39 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= X-Patchwork-Id: 13188140 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id E619DC77B62 for ; Sun, 26 Mar 2023 14:32:47 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232419AbjCZOcq (ORCPT ); Sun, 26 Mar 2023 10:32:46 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59862 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232366AbjCZOcg (ORCPT ); Sun, 26 Mar 2023 10:32:36 -0400 Received: from metis.ext.pengutronix.de (metis.ext.pengutronix.de [IPv6:2001:67c:670:201:290:27ff:fe1d:cc33]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 09F94769A for ; Sun, 26 Mar 2023 07:32:34 -0700 (PDT) Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.ext.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pgRQ6-0007mZ-5e; Sun, 26 Mar 2023 16:32:30 +0200 Received: from [2a0a:edc0:0:900:1d::77] (helo=ptz.office.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtp (Exim 4.94.2) (envelope-from ) id 1pgRQ4-006rZV-PY; Sun, 26 Mar 2023 16:32:28 +0200 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1pgRQ4-0088UW-5M; Sun, 26 Mar 2023 16:32:28 +0200 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Antti Palosaari , Mauro Carvalho Chehab Cc: linux-media@vger.kernel.org, kernel@pengutronix.de Subject: [PATCH 012/117] media: zd1301_demod: Convert to platform remove callback returning void Date: Sun, 26 Mar 2023 16:30:39 +0200 Message-Id: <20230326143224.572654-15-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230326143224.572654-1-u.kleine-koenig@pengutronix.de> References: <20230326143224.572654-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1807; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=KGyg5wxPpQf62SOk4rkPmy5hBd6lpgaCEsI2pM7AQY0=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBkIFaElWQMJ9rP7c/Ry4PzWH9KbAip5Ny5r6dCS 1NDUMyezWiJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZCBWhAAKCRCPgPtYfRL+ TjJ7B/90iwSvwr87FYoccO18by5fj6GcRwkoz6/ZF4CNt2cAfXMU1bN9z+UEeEjB5HlKvp+3Mpl qcX7UIwW7LK/1DWMJ2U/PVqWLvAllbUxr20mnlFpHZReF9OBlhow8ZtMqD0woxZxuRkNy1MBpz6 hejB3DgV8ARjinsOusYc2xriIFEtDUkdu5E4U5dTQcP8Q7xng3Qa6dZPtd5++6clAOTU8p65j3f eMlqCvG5BsL+p04MfDI+Oxmsb/3bwws6yu/9bnE0oE7iI3bF6eWF9qSD6l8Ovsj25+NzyXNhKL1 sgtGhlycutnO220q8klV2EXRvcXiMhbCp9Mbw7+vaqlKzfL7 X-Developer-Key: i=u.kleine-koenig@pengutronix.de; a=openpgp; fpr=0D2511F322BFAB1C1580266BE2DCDD9132669BD6 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.ext.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-media@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@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 (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 --- drivers/media/dvb-frontends/zd1301_demod.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/media/dvb-frontends/zd1301_demod.c b/drivers/media/dvb-frontends/zd1301_demod.c index bbabe6a2d4f4..17f6e373c13d 100644 --- a/drivers/media/dvb-frontends/zd1301_demod.c +++ b/drivers/media/dvb-frontends/zd1301_demod.c @@ -515,7 +515,7 @@ static int zd1301_demod_probe(struct platform_device *pdev) return ret; } -static int zd1301_demod_remove(struct platform_device *pdev) +static void zd1301_demod_remove(struct platform_device *pdev) { struct zd1301_demod_dev *dev = platform_get_drvdata(pdev); @@ -523,8 +523,6 @@ static int zd1301_demod_remove(struct platform_device *pdev) i2c_del_adapter(&dev->adapter); kfree(dev); - - return 0; } static struct platform_driver zd1301_demod_driver = { @@ -533,7 +531,7 @@ static struct platform_driver zd1301_demod_driver = { .suppress_bind_attrs = true, }, .probe = zd1301_demod_probe, - .remove = zd1301_demod_remove, + .remove_new = zd1301_demod_remove, }; module_platform_driver(zd1301_demod_driver); From patchwork Sun Mar 26 14:30:40 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= X-Patchwork-Id: 13188132 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 1401BC77B6D for ; Sun, 26 Mar 2023 14:32:40 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232392AbjCZOci (ORCPT ); Sun, 26 Mar 2023 10:32:38 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59806 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232329AbjCZOce (ORCPT ); Sun, 26 Mar 2023 10:32:34 -0400 Received: from metis.ext.pengutronix.de (metis.ext.pengutronix.de [IPv6:2001:67c:670:201:290:27ff:fe1d:cc33]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id AFBD465A4 for ; Sun, 26 Mar 2023 07:32:31 -0700 (PDT) Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.ext.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pgRQ5-0007oC-Rm; Sun, 26 Mar 2023 16:32:29 +0200 Received: from [2a0a:edc0:0:900:1d::77] (helo=ptz.office.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtp (Exim 4.94.2) (envelope-from ) id 1pgRQ5-006rZj-2m; Sun, 26 Mar 2023 16:32:29 +0200 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1pgRQ4-0088Ub-BI; Sun, 26 Mar 2023 16:32:28 +0200 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Michael Tretter , Mauro Carvalho Chehab Cc: linux-media@vger.kernel.org, kernel@pengutronix.de Subject: [PATCH 013/117] media: allegro-core: Convert to platform remove callback returning void Date: Sun, 26 Mar 2023 16:30:40 +0200 Message-Id: <20230326143224.572654-16-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230326143224.572654-1-u.kleine-koenig@pengutronix.de> References: <20230326143224.572654-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1871; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=4Oo1zjazIjxZy68wNpIXxepote0I7JeXsYAWMgki8ec=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBkIFaKC8WX4E0wHtRwuoEfL2+1a1is5vcFbrrtJ 3iStDng63SJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZCBWigAKCRCPgPtYfRL+ TsslB/9i4STZ1zcWttm59hZnTTsNfWA+OS5YVJEqYQr/Bb36d6kuuDEZBM+HEZ59q07vB5E6ROp l0fBUuGUqnvz1KePX158d9oH+oXUhoRB9ye50kIbczfzsYbw+4G76lqpjPrye7l+P2cEIz3BCVG WdRCEf8L8u03EnHmARVh+wI4lIwjKIt1adUKZYsy96VxXvUF3mpoutgZrOJtgpwez4zoXTeT8Lb n/fiPOyFliSIFnsaj1UPwNNNwstoVwjjFAbkxdje1J2k4QMJIrLkPVvQZSOuLjVUyWj8GYuI+lo eRctMcsEmDuAI8TQq/lVSTV3718j/kEbMb63VcAViMCatj6D X-Developer-Key: i=u.kleine-koenig@pengutronix.de; a=openpgp; fpr=0D2511F322BFAB1C1580266BE2DCDD9132669BD6 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.ext.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-media@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@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 (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 --- drivers/media/platform/allegro-dvt/allegro-core.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/media/platform/allegro-dvt/allegro-core.c b/drivers/media/platform/allegro-dvt/allegro-core.c index 2423714afcb9..ec03e17727d7 100644 --- a/drivers/media/platform/allegro-dvt/allegro-core.c +++ b/drivers/media/platform/allegro-dvt/allegro-core.c @@ -3919,7 +3919,7 @@ static int allegro_probe(struct platform_device *pdev) return 0; } -static int allegro_remove(struct platform_device *pdev) +static void allegro_remove(struct platform_device *pdev) { struct allegro_dev *dev = platform_get_drvdata(pdev); @@ -3935,8 +3935,6 @@ static int allegro_remove(struct platform_device *pdev) pm_runtime_disable(&dev->plat_dev->dev); v4l2_device_unregister(&dev->v4l2_dev); - - return 0; } static int allegro_runtime_resume(struct device *device) @@ -4006,7 +4004,7 @@ static const struct dev_pm_ops allegro_pm_ops = { static struct platform_driver allegro_driver = { .probe = allegro_probe, - .remove = allegro_remove, + .remove_new = allegro_remove, .driver = { .name = "allegro", .of_match_table = of_match_ptr(allegro_dt_ids), From patchwork Sun Mar 26 14:30:41 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= X-Patchwork-Id: 13188144 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id C2B06C77B62 for ; Sun, 26 Mar 2023 14:32:51 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232447AbjCZOcv (ORCPT ); Sun, 26 Mar 2023 10:32:51 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59920 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232371AbjCZOcg (ORCPT ); Sun, 26 Mar 2023 10:32:36 -0400 Received: from metis.ext.pengutronix.de (metis.ext.pengutronix.de [IPv6:2001:67c:670:201:290:27ff:fe1d:cc33]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8A5087A8D for ; Sun, 26 Mar 2023 07:32:34 -0700 (PDT) Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.ext.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pgRQ6-0007pl-GU; Sun, 26 Mar 2023 16:32:30 +0200 Received: from [2a0a:edc0:0:900:1d::77] (helo=ptz.office.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtp (Exim 4.94.2) (envelope-from ) id 1pgRQ5-006rZp-KM; Sun, 26 Mar 2023 16:32:29 +0200 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1pgRQ4-0088Ug-I6; Sun, 26 Mar 2023 16:32:28 +0200 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Neil Armstrong , Mauro Carvalho Chehab , Kevin Hilman Cc: Jerome Brunet , Martin Blumenstingl , linux-media@vger.kernel.org, linux-amlogic@lists.infradead.org, linux-arm-kernel@lists.infradead.org, kernel@pengutronix.de Subject: [PATCH 014/117] media: ge2d: Convert to platform remove callback returning void Date: Sun, 26 Mar 2023 16:30:41 +0200 Message-Id: <20230326143224.572654-17-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230326143224.572654-1-u.kleine-koenig@pengutronix.de> References: <20230326143224.572654-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1851; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=1Y2LMBpcPDvt234Wp0dDVBnpVYLd4OVe9vUMJb/0CJo=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBkIFaPHpPZLurdzamlVy431QhD+mjXxTj3yEi11 b3JX4DQ1+eJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZCBWjwAKCRCPgPtYfRL+ TokHB/oCVX586LRzYvkBN8oWwTVDT73e7QvszRskadSAbTyrdfG0dcliNNP2ISe6ZClTGMsX//c ojHnF2SfwNbxw1J/KhNver2BUCsy1bQ0sMHPsVpJ1HHhQ7ZxOAT3MYwydcrytIyk+UHZ0K5wcWU jLAfkcBDkCvQfzI5fcZPFEsnUpHmslqTLrKCpVtu0wJ/kgwOSL4yHDt95bFIICKuWj5W6hjEYjn 1ibxLueJ8kwI6/hCJH71RofwjUL+JS/dqvhAYgPWid6NjljemM4La2jMWgNLxSKW3q7JsmT/e6i YUNsIz2i0t8LnFBj9d/gdt31vCQwmE37Kew1ZVkpPGb7cbPq X-Developer-Key: i=u.kleine-koenig@pengutronix.de; a=openpgp; fpr=0D2511F322BFAB1C1580266BE2DCDD9132669BD6 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.ext.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-media@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@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 (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 Reviewed-by: Martin Blumenstingl --- drivers/media/platform/amlogic/meson-ge2d/ge2d.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/media/platform/amlogic/meson-ge2d/ge2d.c b/drivers/media/platform/amlogic/meson-ge2d/ge2d.c index 142d421a8d76..09409908ba5d 100644 --- a/drivers/media/platform/amlogic/meson-ge2d/ge2d.c +++ b/drivers/media/platform/amlogic/meson-ge2d/ge2d.c @@ -1024,7 +1024,7 @@ static int ge2d_probe(struct platform_device *pdev) return ret; } -static int ge2d_remove(struct platform_device *pdev) +static void ge2d_remove(struct platform_device *pdev) { struct meson_ge2d *ge2d = platform_get_drvdata(pdev); @@ -1032,8 +1032,6 @@ static int ge2d_remove(struct platform_device *pdev) v4l2_m2m_release(ge2d->m2m_dev); v4l2_device_unregister(&ge2d->v4l2_dev); clk_disable_unprepare(ge2d->clk); - - return 0; } static const struct of_device_id meson_ge2d_match[] = { @@ -1047,7 +1045,7 @@ MODULE_DEVICE_TABLE(of, meson_ge2d_match); static struct platform_driver ge2d_drv = { .probe = ge2d_probe, - .remove = ge2d_remove, + .remove_new = ge2d_remove, .driver = { .name = "meson-ge2d", .of_match_table = meson_ge2d_match, From patchwork Sun Mar 26 14:30:42 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= X-Patchwork-Id: 13188134 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 7C2B8C74A5B for ; Sun, 26 Mar 2023 14:32:41 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232349AbjCZOck (ORCPT ); Sun, 26 Mar 2023 10:32:40 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59828 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232348AbjCZOcf (ORCPT ); Sun, 26 Mar 2023 10:32:35 -0400 Received: from metis.ext.pengutronix.de (metis.ext.pengutronix.de [IPv6:2001:67c:670:201:290:27ff:fe1d:cc33]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6C79F6EA9 for ; Sun, 26 Mar 2023 07:32:33 -0700 (PDT) Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.ext.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pgRQ6-0007pq-IZ; Sun, 26 Mar 2023 16:32:30 +0200 Received: from [2a0a:edc0:0:900:1d::77] (helo=ptz.office.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtp (Exim 4.94.2) (envelope-from ) id 1pgRQ5-006rZv-N1; Sun, 26 Mar 2023 16:32:29 +0200 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1pgRQ4-0088Uj-OC; Sun, 26 Mar 2023 16:32:28 +0200 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Ming Qian , Shijie Qin , Zhou Peng , Mauro Carvalho Chehab Cc: linux-media@vger.kernel.org, kernel@pengutronix.de Subject: [PATCH 015/117] media: vpu_core: Convert to platform remove callback returning void Date: Sun, 26 Mar 2023 16:30:42 +0200 Message-Id: <20230326143224.572654-18-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230326143224.572654-1-u.kleine-koenig@pengutronix.de> References: <20230326143224.572654-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1884; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=uWJoADSe8unMBF1PXvz1xJOQaeh403qpKoHJWEMsKwk=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBkIFaUVPNuMmBrk/3Jc7xZqrqr/DamAgknp8n6K d6g2HKKPTuJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZCBWlAAKCRCPgPtYfRL+ TjWMB/441xL02tLrXDIlKB0U36Wq2my2ziav0yB9bhhUzZO+cX4mCqRYyo3U/Ywp0Usm1wgoFod PQ2/J1MBE/s6RMlhBdrTnainB06wa30dleElcZ7g2bKYYdNsvaDjzJTGGcGWnhi7KprMlTaBcZg Al8PnjQvCZgr9xoVLcOKYiqgbb0JwGOhRvLPaRy4jNBoxd5ekbbxFfVAb92hwHkXuR9wdF3iky+ mtdAQrC5KKUQ++rS01VX2T8adG1DAJdsciLvQvPtz4XEBxQeWG6deRpajw8NhtmHMjVvu7ExVpN Jhb3dFlvgHtur5VIaPGa9uhXH7jtuocejljpHwbCef77FFCx X-Developer-Key: i=u.kleine-koenig@pengutronix.de; a=openpgp; fpr=0D2511F322BFAB1C1580266BE2DCDD9132669BD6 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.ext.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-media@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@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 (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 --- drivers/media/platform/amphion/vpu_core.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/media/platform/amphion/vpu_core.c b/drivers/media/platform/amphion/vpu_core.c index f9ec1753f7c8..de23627a119a 100644 --- a/drivers/media/platform/amphion/vpu_core.c +++ b/drivers/media/platform/amphion/vpu_core.c @@ -709,7 +709,7 @@ static int vpu_core_probe(struct platform_device *pdev) return ret; } -static int vpu_core_remove(struct platform_device *pdev) +static void vpu_core_remove(struct platform_device *pdev) { struct device *dev = &pdev->dev; struct vpu_core *core = platform_get_drvdata(pdev); @@ -728,8 +728,6 @@ static int vpu_core_remove(struct platform_device *pdev) memunmap(core->rpc.virt); mutex_destroy(&core->lock); mutex_destroy(&core->cmd_lock); - - return 0; } static int __maybe_unused vpu_core_runtime_resume(struct device *dev) @@ -864,7 +862,7 @@ MODULE_DEVICE_TABLE(of, vpu_core_dt_match); static struct platform_driver amphion_vpu_core_driver = { .probe = vpu_core_probe, - .remove = vpu_core_remove, + .remove_new = vpu_core_remove, .driver = { .name = "amphion-vpu-core", .of_match_table = vpu_core_dt_match, From patchwork Sun Mar 26 14:30:43 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= X-Patchwork-Id: 13188136 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 604B1C6FD1C for ; Sun, 26 Mar 2023 14:32:43 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232391AbjCZOcm (ORCPT ); Sun, 26 Mar 2023 10:32:42 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59852 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232354AbjCZOcf (ORCPT ); Sun, 26 Mar 2023 10:32:35 -0400 Received: from metis.ext.pengutronix.de (metis.ext.pengutronix.de [IPv6:2001:67c:670:201:290:27ff:fe1d:cc33]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8A7356EAF for ; Sun, 26 Mar 2023 07:32:33 -0700 (PDT) Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.ext.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pgRQ6-0007pf-IX; Sun, 26 Mar 2023 16:32:30 +0200 Received: from [2a0a:edc0:0:900:1d::77] (helo=ptz.office.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtp (Exim 4.94.2) (envelope-from ) id 1pgRQ5-006rZq-KT; Sun, 26 Mar 2023 16:32:29 +0200 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1pgRQ4-0088Uo-Uu; Sun, 26 Mar 2023 16:32:28 +0200 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Ming Qian , Shijie Qin , Zhou Peng , Mauro Carvalho Chehab Cc: linux-media@vger.kernel.org, kernel@pengutronix.de Subject: [PATCH 016/117] media: vpu_drv: Convert to platform remove callback returning void Date: Sun, 26 Mar 2023 16:30:43 +0200 Message-Id: <20230326143224.572654-19-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230326143224.572654-1-u.kleine-koenig@pengutronix.de> References: <20230326143224.572654-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1832; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=YZU3As1JU5uMnh48yH1TkJ4oIIARcHM6dGrTiWeWn0I=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBkIFaZkORJbhjmkn9LW3tSQz5JIUx8MAcYoaqhz ZofIUYzkseJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZCBWmQAKCRCPgPtYfRL+ TjCAB/9O1Fbw9ePSYF57yEPgOOo0/2KpHyyjJ125pZf7sLTuUs3bbF1pmfJnEmsajysQYOV8C1O FY5zb8Ab5Sil9D4luoKQu0Qs/ECjdXRzd2kBekbLBtgSevq4URkXdxpmy7hJ4UGq47u2l7XJEAB mNlg33otELI2rZLc+BkWK5J/kwZ+fKSdyA5e3ime3H9ln8Bl+NXOso9l9K89b/Kr3oS8C0pq2oq OjBYUYxeX9OeCAzSplVttNEovMldnksz4GIXVcTrL+ixz9WKJnjC+98hDuK8i44i7RvBs0DExbn gblSqqBtB0mvM97M5sPsPLeaN4bHt9LfL4pbJFKkC/UKqxcf X-Developer-Key: i=u.kleine-koenig@pengutronix.de; a=openpgp; fpr=0D2511F322BFAB1C1580266BE2DCDD9132669BD6 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.ext.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-media@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@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 (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 --- drivers/media/platform/amphion/vpu_drv.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/media/platform/amphion/vpu_drv.c b/drivers/media/platform/amphion/vpu_drv.c index f01ce49d27e8..4187b2b5562f 100644 --- a/drivers/media/platform/amphion/vpu_drv.c +++ b/drivers/media/platform/amphion/vpu_drv.c @@ -157,7 +157,7 @@ static int vpu_probe(struct platform_device *pdev) return ret; } -static int vpu_remove(struct platform_device *pdev) +static void vpu_remove(struct platform_device *pdev) { struct vpu_dev *vpu = platform_get_drvdata(pdev); struct device *dev = &pdev->dev; @@ -173,8 +173,6 @@ static int vpu_remove(struct platform_device *pdev) media_device_cleanup(&vpu->mdev); v4l2_device_unregister(&vpu->v4l2_dev); mutex_destroy(&vpu->lock); - - return 0; } static int __maybe_unused vpu_runtime_resume(struct device *dev) @@ -229,7 +227,7 @@ MODULE_DEVICE_TABLE(of, vpu_dt_match); static struct platform_driver amphion_vpu_driver = { .probe = vpu_probe, - .remove = vpu_remove, + .remove_new = vpu_remove, .driver = { .name = "amphion-vpu", .of_match_table = vpu_dt_match, From patchwork Sun Mar 26 14:30:44 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= X-Patchwork-Id: 13188169 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id A1E62C761AF for ; Sun, 26 Mar 2023 14:33:23 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232565AbjCZOdW (ORCPT ); Sun, 26 Mar 2023 10:33:22 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60348 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232434AbjCZOcq (ORCPT ); Sun, 26 Mar 2023 10:32:46 -0400 Received: from metis.ext.pengutronix.de (metis.ext.pengutronix.de [IPv6:2001:67c:670:201:290:27ff:fe1d:cc33]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 178067D94 for ; Sun, 26 Mar 2023 07:32:45 -0700 (PDT) Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.ext.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pgRQA-0007qX-KM; Sun, 26 Mar 2023 16:32:34 +0200 Received: from [2a0a:edc0:0:900:1d::77] (helo=ptz.office.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtp (Exim 4.94.2) (envelope-from ) id 1pgRQ6-006ra3-7V; Sun, 26 Mar 2023 16:32:30 +0200 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1pgRQ5-0088Ut-7N; Sun, 26 Mar 2023 16:32:29 +0200 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Eddie James , Mauro Carvalho Chehab , Joel Stanley Cc: Andrew Jeffery , linux-media@vger.kernel.org, openbmc@lists.ozlabs.org, linux-arm-kernel@lists.infradead.org, linux-aspeed@lists.ozlabs.org, kernel@pengutronix.de Subject: [PATCH 017/117] media: aspeed-video: Convert to platform remove callback returning void Date: Sun, 26 Mar 2023 16:30:44 +0200 Message-Id: <20230326143224.572654-20-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230326143224.572654-1-u.kleine-koenig@pengutronix.de> References: <20230326143224.572654-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1876; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=KutP+Y7ggmovOkH+OeVwSMF2KZqCIcZODewIzhblqao=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBkIFab2ufSfDado4VWw1jF8GYECshQZd+1a/zYg l4extXNT1OJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZCBWmwAKCRCPgPtYfRL+ ToulCACHe8Da4FGG6yr9pXEmGcObel9MPRf1adnzUFyvkzR6IwLKPCgsOK11dGO2PnKVGe8zk61 FO+ohs1dSvLOM3MYJK1qZGCOn1fqXYBVeEkFGBeZBNeQkjVIvGi26NHIvqWuT+2nAQf1BinQzVy afjG1+u8rDvbDemgkbYniZrmNr/bYzmAgC7zcDX6emS/Qd0yyjid3+JIFXrtJaTnwSqAG7tKssB aC7AZ6XbOMypiGzO1y1rnJm2svskBsEECXiCm3gKh842J+BBctxlRgYJHQRHpRMT5zl8NBFd/Fn 3TttGRDOLyBGmP8RZOA3TbM0P+DU++97B6D/AM2ySH1Gh2pE X-Developer-Key: i=u.kleine-koenig@pengutronix.de; a=openpgp; fpr=0D2511F322BFAB1C1580266BE2DCDD9132669BD6 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.ext.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-media@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@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 (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 --- drivers/media/platform/aspeed/aspeed-video.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/media/platform/aspeed/aspeed-video.c b/drivers/media/platform/aspeed/aspeed-video.c index 794d4dc3a654..374eb7781936 100644 --- a/drivers/media/platform/aspeed/aspeed-video.c +++ b/drivers/media/platform/aspeed/aspeed-video.c @@ -2206,7 +2206,7 @@ static int aspeed_video_probe(struct platform_device *pdev) return 0; } -static int aspeed_video_remove(struct platform_device *pdev) +static void aspeed_video_remove(struct platform_device *pdev) { struct device *dev = &pdev->dev; struct v4l2_device *v4l2_dev = dev_get_drvdata(dev); @@ -2228,8 +2228,6 @@ static int aspeed_video_remove(struct platform_device *pdev) aspeed_video_free_buf(video, &video->jpeg); of_reserved_mem_device_release(dev); - - return 0; } static struct platform_driver aspeed_video_driver = { @@ -2238,7 +2236,7 @@ static struct platform_driver aspeed_video_driver = { .of_match_table = aspeed_video_of_match, }, .probe = aspeed_video_probe, - .remove = aspeed_video_remove, + .remove_new = aspeed_video_remove, }; module_platform_driver(aspeed_video_driver); From patchwork Sun Mar 26 14:30:45 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= X-Patchwork-Id: 13188161 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 2F391C77B62 for ; Sun, 26 Mar 2023 14:33:14 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232559AbjCZOdN (ORCPT ); Sun, 26 Mar 2023 10:33:13 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60370 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232420AbjCZOco (ORCPT ); Sun, 26 Mar 2023 10:32:44 -0400 Received: from metis.ext.pengutronix.de (metis.ext.pengutronix.de [IPv6:2001:67c:670:201:290:27ff:fe1d:cc33]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 32F056594 for ; Sun, 26 Mar 2023 07:32:43 -0700 (PDT) Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.ext.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pgRQA-0007qV-Bf; Sun, 26 Mar 2023 16:32:34 +0200 Received: from [2a0a:edc0:0:900:1d::77] (helo=ptz.office.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtp (Exim 4.94.2) (envelope-from ) id 1pgRQ6-006ra2-6n; Sun, 26 Mar 2023 16:32:30 +0200 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1pgRQ5-0088Uw-DV; Sun, 26 Mar 2023 16:32:29 +0200 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Eugen Hristev , Mauro Carvalho Chehab , Nicolas Ferre , Alexandre Belloni , Claudiu Beznea Cc: linux-media@vger.kernel.org, linux-arm-kernel@lists.infradead.org, kernel@pengutronix.de Subject: [PATCH 018/117] media: atmel-isi: Convert to platform remove callback returning void Date: Sun, 26 Mar 2023 16:30:45 +0200 Message-Id: <20230326143224.572654-21-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230326143224.572654-1-u.kleine-koenig@pengutronix.de> References: <20230326143224.572654-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1790; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=OyX9jxWmd9TDLXV+fieICgqwCoyba6GM9yyt29ZPi6E=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBkIFac7ad1LpFyPQNJC8wnhSzLOG+CMdj+T1f0l N+BuNEyOW+JATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZCBWnAAKCRCPgPtYfRL+ TjjQB/0SkQ8CZag8EIFbpLjAq8MXbDjOeOBHJszlZaEOrcNCLzeGFS075jL+aHXMYKo2epVAzIC GF+ND/bI8C7icQ40wiUOZRPAEbbNGd7BBTaset14zyfUdAixzh35tS6mEpGy83xoNVUmKiWhcmT NoPGBr3LnYMA3phkXJ39qdSEUAmXXM6GvC1TFaSa0bS2qR1GGaDlyq0DcToofSeo87b1XTXcly1 v2tsYmixr3YuDajsM6T1thN3E9Hu/NHCqWenZBfWI3sgKiuUFF8DDAFjf/t02bZiLNNqp6h3nGZ Is6wAMVOyNWu0vVo+aOvghzuvEgZMi4+VyVdeg7WObI5zShi X-Developer-Key: i=u.kleine-koenig@pengutronix.de; a=openpgp; fpr=0D2511F322BFAB1C1580266BE2DCDD9132669BD6 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.ext.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-media@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@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 (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 Acked-by: Nicolas Ferre --- drivers/media/platform/atmel/atmel-isi.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/media/platform/atmel/atmel-isi.c b/drivers/media/platform/atmel/atmel-isi.c index 4d15814e4481..b063f980f9e0 100644 --- a/drivers/media/platform/atmel/atmel-isi.c +++ b/drivers/media/platform/atmel/atmel-isi.c @@ -1317,7 +1317,7 @@ static int atmel_isi_probe(struct platform_device *pdev) return ret; } -static int atmel_isi_remove(struct platform_device *pdev) +static void atmel_isi_remove(struct platform_device *pdev) { struct atmel_isi *isi = platform_get_drvdata(pdev); @@ -1329,8 +1329,6 @@ static int atmel_isi_remove(struct platform_device *pdev) v4l2_async_nf_unregister(&isi->notifier); v4l2_async_nf_cleanup(&isi->notifier); v4l2_device_unregister(&isi->v4l2_dev); - - return 0; } #ifdef CONFIG_PM @@ -1368,7 +1366,7 @@ static struct platform_driver atmel_isi_driver = { .pm = &atmel_isi_dev_pm_ops, }, .probe = atmel_isi_probe, - .remove = atmel_isi_remove, + .remove_new = atmel_isi_remove, }; module_platform_driver(atmel_isi_driver); From patchwork Sun Mar 26 14:30:46 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= X-Patchwork-Id: 13188151 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id DC751C77B61 for ; Sun, 26 Mar 2023 14:33:01 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232531AbjCZOdA (ORCPT ); Sun, 26 Mar 2023 10:33:00 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59852 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232389AbjCZOci (ORCPT ); Sun, 26 Mar 2023 10:32:38 -0400 Received: from metis.ext.pengutronix.de (metis.ext.pengutronix.de [IPv6:2001:67c:670:201:290:27ff:fe1d:cc33]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 88B82769A for ; Sun, 26 Mar 2023 07:32:37 -0700 (PDT) Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.ext.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pgRQ7-0007s9-Ff; Sun, 26 Mar 2023 16:32:31 +0200 Received: from [2a0a:edc0:0:900:1d::77] (helo=ptz.office.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtp (Exim 4.94.2) (envelope-from ) id 1pgRQ6-006raN-Qm; Sun, 26 Mar 2023 16:32:30 +0200 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1pgRQ5-0088Uz-KW; Sun, 26 Mar 2023 16:32:29 +0200 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Maxime Ripard , Mauro Carvalho Chehab Cc: linux-media@vger.kernel.org, kernel@pengutronix.de Subject: [PATCH 019/117] media: cdns-csi2rx: Convert to platform remove callback returning void Date: Sun, 26 Mar 2023 16:30:46 +0200 Message-Id: <20230326143224.572654-22-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230326143224.572654-1-u.kleine-koenig@pengutronix.de> References: <20230326143224.572654-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1687; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=xU65GjEXyj0opPkHlCIE1FNxFCt+HXo7iw5YGT1jyYA=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBkIFad5W20jJL1Oi5qOiE7anvJtnHEKiCfjSxmd vWfwn9PU1aJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZCBWnQAKCRCPgPtYfRL+ TsENB/wMGri/ANuQ1nmlCcb42kSiTHeIcYjejVlZ6ytt/FslQjhcsE7qFZLmBAAPLne+DfY2Cj4 OoV2HPPqWVGgvwiTtZSYcccyR7McPfF4Wj569PMdVQXs0/FV3kDZ8lNcQ9ZI0CZFo//zx/KZamb VxaSX//rqZ27oGQhWcE3NADwrQLStEIeQ1ZVrx1J/w7qwmEIJUs5sfWx8q4xespvCnvqz4vkcjb qngtXBpAr6cXUwveTffdXBkVR1djrg04Qk4xdBr17kgNTeJyzO2dnjSgDJ0I7nbdMmKCFP5gn77 x9i6YrTrfl2R/1ttriIbUk0/LFnex54QMKado831KUrcSXTO X-Developer-Key: i=u.kleine-koenig@pengutronix.de; a=openpgp; fpr=0D2511F322BFAB1C1580266BE2DCDD9132669BD6 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.ext.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-media@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@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 (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 --- drivers/media/platform/cadence/cdns-csi2rx.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/media/platform/cadence/cdns-csi2rx.c b/drivers/media/platform/cadence/cdns-csi2rx.c index cc3ebb0d96f6..9755d1c8ceb9 100644 --- a/drivers/media/platform/cadence/cdns-csi2rx.c +++ b/drivers/media/platform/cadence/cdns-csi2rx.c @@ -473,14 +473,12 @@ static int csi2rx_probe(struct platform_device *pdev) return ret; } -static int csi2rx_remove(struct platform_device *pdev) +static void csi2rx_remove(struct platform_device *pdev) { struct csi2rx_priv *csi2rx = platform_get_drvdata(pdev); v4l2_async_unregister_subdev(&csi2rx->subdev); kfree(csi2rx); - - return 0; } static const struct of_device_id csi2rx_of_table[] = { @@ -491,7 +489,7 @@ MODULE_DEVICE_TABLE(of, csi2rx_of_table); static struct platform_driver csi2rx_driver = { .probe = csi2rx_probe, - .remove = csi2rx_remove, + .remove_new = csi2rx_remove, .driver = { .name = "cdns-csi2rx", From patchwork Sun Mar 26 14:30:47 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= X-Patchwork-Id: 13188153 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 43633C74A5B for ; Sun, 26 Mar 2023 14:33:04 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232540AbjCZOdC (ORCPT ); Sun, 26 Mar 2023 10:33:02 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60088 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231258AbjCZOcj (ORCPT ); Sun, 26 Mar 2023 10:32:39 -0400 Received: from metis.ext.pengutronix.de (metis.ext.pengutronix.de [IPv6:2001:67c:670:201:290:27ff:fe1d:cc33]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 062D072B2 for ; Sun, 26 Mar 2023 07:32:39 -0700 (PDT) Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.ext.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pgRQ7-0007rm-7y; Sun, 26 Mar 2023 16:32:31 +0200 Received: from [2a0a:edc0:0:900:1d::77] (helo=ptz.office.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtp (Exim 4.94.2) (envelope-from ) id 1pgRQ6-006raE-KU; Sun, 26 Mar 2023 16:32:30 +0200 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1pgRQ5-0088V5-S7; Sun, 26 Mar 2023 16:32:29 +0200 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Maxime Ripard , Mauro Carvalho Chehab Cc: linux-media@vger.kernel.org, kernel@pengutronix.de Subject: [PATCH 020/117] media: cdns-csi2tx: Convert to platform remove callback returning void Date: Sun, 26 Mar 2023 16:30:47 +0200 Message-Id: <20230326143224.572654-23-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230326143224.572654-1-u.kleine-koenig@pengutronix.de> References: <20230326143224.572654-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1564; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=k/sHZTjAcZMHnFf3yzbCfXXuYcTZH+CQ20zqq6k9664=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBkIFafMWnkh7dHaSJ4lFMiVvgObS7TUCs0a3lCV AgOF1maK2CJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZCBWnwAKCRCPgPtYfRL+ TsT7CACsqw2ZMhuTh1s0U+hukgIiPHtZ+/Tq0fmifdNaname/s+wRJOt/yY49TycK6YcpwDZies NYqwLdaafzP41erAgi4kpBRTg++QYKoxlfWgCprzODeTpVbRO/g7owRs7OZz5WytQ5lduW3BNPl t90jnxhrJ1huoJ7zZm9S+h6YPu7OKfuRph1id+jTW/lpY95w9FSVFXVi6Ar9z0Clfwnr5Vbca1Y lBKVj/HT5i8JqPfRtbZldSgifCgaJAjW/Pi2BMIRAyhH2YFFFTF0hSFG5hHt8GRCVZfJyqC+com yM2vUZBDPQUmAxsoVq/+ihXHxLaBBwMMarQGbQOycZjrz4lR X-Developer-Key: i=u.kleine-koenig@pengutronix.de; a=openpgp; fpr=0D2511F322BFAB1C1580266BE2DCDD9132669BD6 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.ext.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-media@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@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 (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 --- drivers/media/platform/cadence/cdns-csi2tx.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/media/platform/cadence/cdns-csi2tx.c b/drivers/media/platform/cadence/cdns-csi2tx.c index 58e405b69f67..1e0400b7803e 100644 --- a/drivers/media/platform/cadence/cdns-csi2tx.c +++ b/drivers/media/platform/cadence/cdns-csi2tx.c @@ -635,19 +635,17 @@ static int csi2tx_probe(struct platform_device *pdev) return ret; } -static int csi2tx_remove(struct platform_device *pdev) +static void csi2tx_remove(struct platform_device *pdev) { struct csi2tx_priv *csi2tx = platform_get_drvdata(pdev); v4l2_async_unregister_subdev(&csi2tx->subdev); kfree(csi2tx); - - return 0; } static struct platform_driver csi2tx_driver = { .probe = csi2tx_probe, - .remove = csi2tx_remove, + .remove_new = csi2tx_remove, .driver = { .name = "cdns-csi2tx", From patchwork Sun Mar 26 14:30:48 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= X-Patchwork-Id: 13188133 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id D0459C761AF for ; Sun, 26 Mar 2023 14:32:40 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232375AbjCZOcj (ORCPT ); Sun, 26 Mar 2023 10:32:39 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59826 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232349AbjCZOcf (ORCPT ); Sun, 26 Mar 2023 10:32:35 -0400 Received: from metis.ext.pengutronix.de (metis.ext.pengutronix.de [IPv6:2001:67c:670:201:290:27ff:fe1d:cc33]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 577AB6A69 for ; Sun, 26 Mar 2023 07:32:33 -0700 (PDT) Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.ext.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pgRQ7-0007s7-Bc; Sun, 26 Mar 2023 16:32:31 +0200 Received: from [2a0a:edc0:0:900:1d::77] (helo=ptz.office.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtp (Exim 4.94.2) (envelope-from ) id 1pgRQ6-006raJ-Mg; Sun, 26 Mar 2023 16:32:30 +0200 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1pgRQ6-0088V8-2a; Sun, 26 Mar 2023 16:32:30 +0200 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Philipp Zabel , Mauro Carvalho Chehab Cc: linux-media@vger.kernel.org, kernel@pengutronix.de Subject: [PATCH 021/117] media: coda-common: Convert to platform remove callback returning void Date: Sun, 26 Mar 2023 16:30:48 +0200 Message-Id: <20230326143224.572654-24-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230326143224.572654-1-u.kleine-koenig@pengutronix.de> References: <20230326143224.572654-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1811; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=1IVnZnh/c0JmafKC5kvWTPn+P1RgK/mXq3W9vTxKosc=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBkIFaghG8oN6s1LWjjTG7NgOzN+TN9onfjkTAh8 xf+MW2XHRSJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZCBWoAAKCRCPgPtYfRL+ Tgj8B/4vYPfZgrZMMLAUKmleF1wqaPGThMtYwnFPcICrCvwd+UerWR22rDD42BDCsH2tOnNSGGK QRAh8NGkFJrx+9hNeeApyWV94V555GLkC2CUQj6KcfrULww6L4ne32P3bqKzd+vEBd16xrY134A OPFZ4t19pDkCGhrT+MwRZbCHNBTKnD11Q6GJATjsum4ZrsNWDXNhFVsjRjc4mDvkD/IsJ+47Vqm hOaAiTYMcoEsYx3eucgfHWYzNQ8Gmxq5dtXo8Tf6jEAOhMeiHwvsDcHvKehsw9QoyUqMU0yTvnp h3GVimiNkY7Bo6/D9DGLxkXY2J3MgjhFoJ13t94la/WkW+H3 X-Developer-Key: i=u.kleine-koenig@pengutronix.de; a=openpgp; fpr=0D2511F322BFAB1C1580266BE2DCDD9132669BD6 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.ext.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-media@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@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 (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 --- drivers/media/platform/chips-media/coda-common.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/drivers/media/platform/chips-media/coda-common.c b/drivers/media/platform/chips-media/coda-common.c index af71eea04dbd..d013ea5d9d3d 100644 --- a/drivers/media/platform/chips-media/coda-common.c +++ b/drivers/media/platform/chips-media/coda-common.c @@ -3300,7 +3300,7 @@ static int coda_probe(struct platform_device *pdev) return ret; } -static int coda_remove(struct platform_device *pdev) +static void coda_remove(struct platform_device *pdev) { struct coda_dev *dev = platform_get_drvdata(pdev); int i; @@ -3322,7 +3322,6 @@ static int coda_remove(struct platform_device *pdev) coda_free_aux_buf(dev, &dev->workbuf); debugfs_remove_recursive(dev->debugfs_root); ida_destroy(&dev->ida); - return 0; } #ifdef CONFIG_PM @@ -3347,7 +3346,7 @@ static const struct dev_pm_ops coda_pm_ops = { static struct platform_driver coda_driver = { .probe = coda_probe, - .remove = coda_remove, + .remove_new = coda_remove, .driver = { .name = CODA_NAME, .of_match_table = coda_dt_ids, From patchwork Sun Mar 26 14:30:49 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= X-Patchwork-Id: 13188142 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 0ECEAC77B61 for ; Sun, 26 Mar 2023 14:32:50 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232454AbjCZOcs (ORCPT ); Sun, 26 Mar 2023 10:32:48 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59860 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232369AbjCZOcg (ORCPT ); Sun, 26 Mar 2023 10:32:36 -0400 Received: from metis.ext.pengutronix.de (metis.ext.pengutronix.de [IPv6:2001:67c:670:201:290:27ff:fe1d:cc33]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 135267A80 for ; Sun, 26 Mar 2023 07:32:34 -0700 (PDT) Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.ext.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pgRQ7-0007sO-M2; Sun, 26 Mar 2023 16:32:31 +0200 Received: from [2a0a:edc0:0:900:1d::77] (helo=ptz.office.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtp (Exim 4.94.2) (envelope-from ) id 1pgRQ7-006raQ-1A; Sun, 26 Mar 2023 16:32:31 +0200 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1pgRQ6-0088VB-8j; Sun, 26 Mar 2023 16:32:30 +0200 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Mauro Carvalho Chehab , =?utf-8?q?Uwe_Kleine-K=C3=B6?= =?utf-8?q?nig?= , Hans Verkuil Cc: linux-media@vger.kernel.org, kernel@pengutronix.de Subject: [PATCH 022/117] media: pxa_camera: Convert to platform remove callback returning void Date: Sun, 26 Mar 2023 16:30:49 +0200 Message-Id: <20230326143224.572654-25-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230326143224.572654-1-u.kleine-koenig@pengutronix.de> References: <20230326143224.572654-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1842; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=jrpOEJnFdFmE7i1O2jp+S+tb1tnnzMW7ufd8w5AMPfo=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBkIFahI/1zsbMz1QYGND+QaSAeuIc3Bcxfwzb5v c/0Ogn7oSGJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZCBWoQAKCRCPgPtYfRL+ TrycCACTHTqHQc+UqMuSc7jHh6OWlIq7MSuzDsUjgqkow39rxXgvpnPYqJzMuT9SdUDjUQLND9I 7gbqBGgKiDhMIYKprdV6FF06zgBGTx8mx1UyLfE2P+GqjiMpUXZ707rLpHdeTQrhesA2jNVM5Rx pWcD6UpgyNFpo6FoHmtwf0tNvlAHI92tcx7eSvUBg1v5e3lRF/x+5OZK/9a50G2rgkN3dDjffft 8/xbjp3/wkOg2eui8DtKeUgra9KyWVpDRltH6mwhovoJGFQ59mX1b10d6ryG2eAJCdK512/rANC ilNAoBLX38SjLAlZ+HDh+6G4z7pGobOl127X2tzcGTUVWzea X-Developer-Key: i=u.kleine-koenig@pengutronix.de; a=openpgp; fpr=0D2511F322BFAB1C1580266BE2DCDD9132669BD6 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.ext.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-media@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@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 (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 --- drivers/media/platform/intel/pxa_camera.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/media/platform/intel/pxa_camera.c b/drivers/media/platform/intel/pxa_camera.c index 54270d6b6f50..99a6973b4b54 100644 --- a/drivers/media/platform/intel/pxa_camera.c +++ b/drivers/media/platform/intel/pxa_camera.c @@ -2421,7 +2421,7 @@ static int pxa_camera_probe(struct platform_device *pdev) return err; } -static int pxa_camera_remove(struct platform_device *pdev) +static void pxa_camera_remove(struct platform_device *pdev) { struct pxa_camera_dev *pcdev = platform_get_drvdata(pdev); @@ -2437,8 +2437,6 @@ static int pxa_camera_remove(struct platform_device *pdev) v4l2_device_unregister(&pcdev->v4l2_dev); dev_info(&pdev->dev, "PXA Camera driver unloaded\n"); - - return 0; } static const struct dev_pm_ops pxa_camera_pm = { @@ -2459,7 +2457,7 @@ static struct platform_driver pxa_camera_driver = { .of_match_table = of_match_ptr(pxa_camera_of_match), }, .probe = pxa_camera_probe, - .remove = pxa_camera_remove, + .remove_new = pxa_camera_remove, }; module_platform_driver(pxa_camera_driver); From patchwork Sun Mar 26 14:30:50 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= X-Patchwork-Id: 13188138 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 94084C77B61 for ; Sun, 26 Mar 2023 14:32:45 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232417AbjCZOco (ORCPT ); Sun, 26 Mar 2023 10:32:44 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59860 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232356AbjCZOcf (ORCPT ); Sun, 26 Mar 2023 10:32:35 -0400 Received: from metis.ext.pengutronix.de (metis.ext.pengutronix.de [IPv6:2001:67c:670:201:290:27ff:fe1d:cc33]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 925A072B2 for ; Sun, 26 Mar 2023 07:32:33 -0700 (PDT) Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.ext.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pgRQ7-0007sS-NR; Sun, 26 Mar 2023 16:32:31 +0200 Received: from [2a0a:edc0:0:900:1d::77] (helo=ptz.office.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtp (Exim 4.94.2) (envelope-from ) id 1pgRQ7-006raU-41; Sun, 26 Mar 2023 16:32:31 +0200 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1pgRQ6-0088VG-FQ; Sun, 26 Mar 2023 16:32:30 +0200 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Mauro Carvalho Chehab , =?utf-8?q?Uwe_Kleine-K=C3=B6?= =?utf-8?q?nig?= Cc: linux-media@vger.kernel.org, kernel@pengutronix.de Subject: [PATCH 023/117] media: m2m-deinterlace: Convert to platform remove callback returning void Date: Sun, 26 Mar 2023 16:30:50 +0200 Message-Id: <20230326143224.572654-26-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230326143224.572654-1-u.kleine-koenig@pengutronix.de> References: <20230326143224.572654-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1724; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=+x/PkrS1Tyr7WQYINVcetSeb0sHyTBNcxeB7s1QaK1k=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBkIFaisoF7UoJ+hz/n65RKRA7tT7Mcdrihjb9Hs vvJ83uVAEGJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZCBWogAKCRCPgPtYfRL+ TrvoB/4kcAmXRkAFInEKf16jZIXtyBsqXvnZTj+B2HEBqMEJv4lNT1QgGw/9P1GAtaHksEBLXzc TqTydptPG5BEwKu/TTe2HlYpo75zNxTDGR6jDTapk7I9Xmi4vZUqEnoFU0U9SVaml/m643uskxJ LikTfj85SZmcs7wwRT8SH4iLye8gysqDCq2MYFGLoQsVCCKQ2y87RASJ106jH7j53w4358cnm6Q h+GWyvmFvlpzPSkRrCIadiGPL+ZmTF50NJXXgse54S8RzTX8o4mEfqfAGM6wfByLsHZ+pOXfHI7 gsif6R8A7lL0pM0SroRzb3mWF64TjjFOylHH7GZNToUbHWPz X-Developer-Key: i=u.kleine-koenig@pengutronix.de; a=openpgp; fpr=0D2511F322BFAB1C1580266BE2DCDD9132669BD6 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.ext.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-media@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@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 (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 --- drivers/media/platform/m2m-deinterlace.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/media/platform/m2m-deinterlace.c b/drivers/media/platform/m2m-deinterlace.c index 1f89e71cdccf..96b35a5d6174 100644 --- a/drivers/media/platform/m2m-deinterlace.c +++ b/drivers/media/platform/m2m-deinterlace.c @@ -984,7 +984,7 @@ static int deinterlace_probe(struct platform_device *pdev) return ret; } -static int deinterlace_remove(struct platform_device *pdev) +static void deinterlace_remove(struct platform_device *pdev) { struct deinterlace_dev *pcdev = platform_get_drvdata(pdev); @@ -993,13 +993,11 @@ static int deinterlace_remove(struct platform_device *pdev) video_unregister_device(&pcdev->vfd); v4l2_device_unregister(&pcdev->v4l2_dev); dma_release_channel(pcdev->dma_chan); - - return 0; } static struct platform_driver deinterlace_pdrv = { .probe = deinterlace_probe, - .remove = deinterlace_remove, + .remove_new = deinterlace_remove, .driver = { .name = MEM2MEM_NAME, }, From patchwork Sun Mar 26 14:30:51 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= X-Patchwork-Id: 13188143 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 2E2E2C761AF for ; Sun, 26 Mar 2023 14:32:51 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232456AbjCZOcu (ORCPT ); Sun, 26 Mar 2023 10:32:50 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59922 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232372AbjCZOcg (ORCPT ); Sun, 26 Mar 2023 10:32:36 -0400 Received: from metis.ext.pengutronix.de (metis.ext.pengutronix.de [IPv6:2001:67c:670:201:290:27ff:fe1d:cc33]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8AE867AAB for ; Sun, 26 Mar 2023 07:32:34 -0700 (PDT) Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.ext.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pgRQ8-0007t0-2K; Sun, 26 Mar 2023 16:32:32 +0200 Received: from [2a0a:edc0:0:900:1d::77] (helo=ptz.office.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtp (Exim 4.94.2) (envelope-from ) id 1pgRQ7-006raa-ES; Sun, 26 Mar 2023 16:32:31 +0200 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1pgRQ6-0088VJ-Oj; Sun, 26 Mar 2023 16:32:30 +0200 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Mauro Carvalho Chehab , =?utf-8?q?Uwe_Kleine-K=C3=B6?= =?utf-8?q?nig?= , Hans Verkuil Cc: linux-media@vger.kernel.org, kernel@pengutronix.de Subject: [PATCH 024/117] media: marvell: Simplify remove callback Date: Sun, 26 Mar 2023 16:30:51 +0200 Message-Id: <20230326143224.572654-27-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230326143224.572654-1-u.kleine-koenig@pengutronix.de> References: <20230326143224.572654-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1797; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=590D1CAL0pYMC213PLVi2ZUu4XhyxHq+x11/2JonYDU=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBkIFajNsUg4ndB8z7Vo8Sv5E+wNVkolkuE9Z4CN Ilk2XUcK+WJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZCBWowAKCRCPgPtYfRL+ Ts8RB/46TXa6W64pczpya/EuOAOJQhwdTrkiCLX69bXqCoyMiu4wP3y/OziMVIP76bTiKpcQ+71 obiG7os0g0pkifi4+fgkyEr2T30cFUXXfvrNDL0iUbN/M4WRYxbZbVhBfE6Az9le0zp9BLvbCyW rtSgnLcizDd4qVJovTDOr9yPSbLhnewQlMTooM4xGjM+SiNeWEk53XhSBOjz40BJtCO3SPZpB3x zZOOJ+WZ3qYFaWzWUf+zVNXyslp4KTTRHzghPi0wx9gQo8uk1LvLPQdHl8+jgHUx077+7/n+fbP HN7NDDjQZ21eQeAbQ3RAEPtNlQdzA5a1lFNdFNvjLzzxtOXp X-Developer-Key: i=u.kleine-koenig@pengutronix.de; a=openpgp; fpr=0D2511F322BFAB1C1580266BE2DCDD9132669BD6 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.ext.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-media@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org Fold mmpcam_remove() into its only caller mmpcam_platform_remove(). Note that cam can never be zero, as the probe function calls platform_set_drvdata() with a non-NULL argument (or returns an error code in which case .remove() won't be called). Also use mmpcam_remove() as the function name for the remove callback to align to mmpcam_probe() for .probe(). Signed-off-by: Uwe Kleine-König --- drivers/media/platform/marvell/mmp-driver.c | 15 +++------------ 1 file changed, 3 insertions(+), 12 deletions(-) diff --git a/drivers/media/platform/marvell/mmp-driver.c b/drivers/media/platform/marvell/mmp-driver.c index ef22bf8f276c..964c55eacd89 100644 --- a/drivers/media/platform/marvell/mmp-driver.c +++ b/drivers/media/platform/marvell/mmp-driver.c @@ -287,9 +287,9 @@ static int mmpcam_probe(struct platform_device *pdev) return ret; } - -static int mmpcam_remove(struct mmp_camera *cam) +static int mmpcam_remove(struct platform_device *pdev) { + struct mmp_camera *cam = platform_get_drvdata(pdev); struct mcam_camera *mcam = &cam->mcam; mccic_shutdown(mcam); @@ -297,15 +297,6 @@ static int mmpcam_remove(struct mmp_camera *cam) return 0; } -static int mmpcam_platform_remove(struct platform_device *pdev) -{ - struct mmp_camera *cam = platform_get_drvdata(pdev); - - if (cam == NULL) - return -ENODEV; - return mmpcam_remove(cam); -} - /* * Suspend/resume support. */ @@ -369,7 +360,7 @@ MODULE_DEVICE_TABLE(of, mmpcam_of_match); static struct platform_driver mmpcam_driver = { .probe = mmpcam_probe, - .remove = mmpcam_platform_remove, + .remove = mmpcam_remove, .driver = { .name = "mmp-camera", .of_match_table = of_match_ptr(mmpcam_of_match), From patchwork Sun Mar 26 14:30:52 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= X-Patchwork-Id: 13188145 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id B3F2BC6FD1C for ; Sun, 26 Mar 2023 14:32:53 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232469AbjCZOcv (ORCPT ); Sun, 26 Mar 2023 10:32:51 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59948 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232377AbjCZOch (ORCPT ); Sun, 26 Mar 2023 10:32:37 -0400 Received: from metis.ext.pengutronix.de (metis.ext.pengutronix.de [IPv6:2001:67c:670:201:290:27ff:fe1d:cc33]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9D0A859DB for ; Sun, 26 Mar 2023 07:32:34 -0700 (PDT) Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.ext.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pgRQ8-0007tF-79; Sun, 26 Mar 2023 16:32:32 +0200 Received: from [2a0a:edc0:0:900:1d::77] (helo=ptz.office.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtp (Exim 4.94.2) (envelope-from ) id 1pgRQ7-006raf-J7; Sun, 26 Mar 2023 16:32:31 +0200 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1pgRQ6-0088VP-Us; Sun, 26 Mar 2023 16:32:30 +0200 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Mauro Carvalho Chehab , =?utf-8?q?Uwe_Kleine-K=C3=B6?= =?utf-8?q?nig?= , Hans Verkuil Cc: linux-media@vger.kernel.org, kernel@pengutronix.de Subject: [PATCH 025/117] media: marvell: Convert to platform remove callback returning void Date: Sun, 26 Mar 2023 16:30:52 +0200 Message-Id: <20230326143224.572654-28-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230326143224.572654-1-u.kleine-koenig@pengutronix.de> References: <20230326143224.572654-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1711; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=WkwjvPNQqZqMwM8NkSjutUkfQT+Q0krYMsrTvqspSm8=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBkIFakvmd0VNDia30dbil7NHX0yoXlNsh04rFEE a/e5sdBM0iJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZCBWpAAKCRCPgPtYfRL+ TpZPB/44x3gDnaufDqR9s4Wn+JRte77LQFfMUUTj/3UvYWHsDPWx9lJ0zXALwcbNsgmOAtUPUZg GctRrY2McjtSP0RAycDUxOzO64Ae9HLABaP5AyMXsU70Me48NOOTITbNFPZtGDwssp8L1wr44WP 489TUUxNLbSOIanT+husQhHs+AhdbZlAItt4VMsfy4lrDmgu00o7Jg/72ZA0jJUX6CR3kgTrd2h yJcE212G6H4Cc0smGLdgCyFKWrud/3dSI/+6GLQM3TdyFc7Vk0EcVZHLsq94wuK5goWR/winzco efQWzAEwdj06YeBoB/eATcGovCNq3wF97+7wOATcxPPt4+o9 X-Developer-Key: i=u.kleine-koenig@pengutronix.de; a=openpgp; fpr=0D2511F322BFAB1C1580266BE2DCDD9132669BD6 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.ext.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-media@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@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 (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 --- drivers/media/platform/marvell/mmp-driver.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/drivers/media/platform/marvell/mmp-driver.c b/drivers/media/platform/marvell/mmp-driver.c index 964c55eacd89..e93feefb447b 100644 --- a/drivers/media/platform/marvell/mmp-driver.c +++ b/drivers/media/platform/marvell/mmp-driver.c @@ -287,14 +287,13 @@ static int mmpcam_probe(struct platform_device *pdev) return ret; } -static int mmpcam_remove(struct platform_device *pdev) +static void mmpcam_remove(struct platform_device *pdev) { struct mmp_camera *cam = platform_get_drvdata(pdev); struct mcam_camera *mcam = &cam->mcam; mccic_shutdown(mcam); pm_runtime_force_suspend(mcam->dev); - return 0; } /* @@ -360,7 +359,7 @@ MODULE_DEVICE_TABLE(of, mmpcam_of_match); static struct platform_driver mmpcam_driver = { .probe = mmpcam_probe, - .remove = mmpcam_remove, + .remove_new = mmpcam_remove, .driver = { .name = "mmp-camera", .of_match_table = of_match_ptr(mmpcam_of_match), From patchwork Sun Mar 26 14:30:53 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= X-Patchwork-Id: 13188155 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 988FBC77B62 for ; Sun, 26 Mar 2023 14:33:06 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232545AbjCZOdF (ORCPT ); Sun, 26 Mar 2023 10:33:05 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60140 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232348AbjCZOcl (ORCPT ); Sun, 26 Mar 2023 10:32:41 -0400 Received: from metis.ext.pengutronix.de (metis.ext.pengutronix.de [IPv6:2001:67c:670:201:290:27ff:fe1d:cc33]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 099E26593 for ; Sun, 26 Mar 2023 07:32:40 -0700 (PDT) Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.ext.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pgRQ9-0007tl-SP; Sun, 26 Mar 2023 16:32:33 +0200 Received: from [2a0a:edc0:0:900:1d::77] (helo=ptz.office.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtp (Exim 4.94.2) (envelope-from ) id 1pgRQ7-006ran-T5; Sun, 26 Mar 2023 16:32:31 +0200 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1pgRQ7-0088VT-5F; Sun, 26 Mar 2023 16:32:31 +0200 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Bin Liu , Mauro Carvalho Chehab , Matthias Brugger Cc: AngeloGioacchino Del Regno , linux-media@vger.kernel.org, kernel@pengutronix.de, linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org Subject: [PATCH 026/117] media: mtk_jpeg_core: Convert to platform remove callback returning void Date: Sun, 26 Mar 2023 16:30:53 +0200 Message-Id: <20230326143224.572654-29-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230326143224.572654-1-u.kleine-koenig@pengutronix.de> References: <20230326143224.572654-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1942; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=IZIj6Rcya8lyzehME46hWnaWQrNRiQ4RwQC3u+/JWoI=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBkIFalVAS2hpuonmHSWesmFzRyBeyN1VmK+ISfk cRh8yzEC4+JATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZCBWpQAKCRCPgPtYfRL+ TvjzCACGLrL2wp5xaiQ0pyQSsecrPx148r2Ausl3xa6MLBfur3BBV0+z62ql2rlGDxsxI5X2t/5 nEegckpaTWYaEp/8gjbGCoCeXxmFnkHSY2/wq5X0tCgEoxIXkoLHtgRoSEdmY3wO6tyyx0Yszyq U1JUgBCTEZ13ZD49Yy0vBm9RMb5YsiyTDDOn+hSWovzV1tNlKUtBe6kqIzdC0R5YuYcziPoFBSs KAmFHvOp80/bM9edWCUBUC+pKnjUdbunIFfFIf1HE+uO4csbagP9lhXmuH64wrdLOhNPaDx6ZnY 0/K5zMXy7R6OvOO+7uMkxWjgxPdzWviMS8urx4KhxiYhTbJ2 X-Developer-Key: i=u.kleine-koenig@pengutronix.de; a=openpgp; fpr=0D2511F322BFAB1C1580266BE2DCDD9132669BD6 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.ext.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-media@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@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 (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 --- drivers/media/platform/mediatek/jpeg/mtk_jpeg_core.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/media/platform/mediatek/jpeg/mtk_jpeg_core.c b/drivers/media/platform/mediatek/jpeg/mtk_jpeg_core.c index 969516a940ba..e043da5ea325 100644 --- a/drivers/media/platform/mediatek/jpeg/mtk_jpeg_core.c +++ b/drivers/media/platform/mediatek/jpeg/mtk_jpeg_core.c @@ -1790,7 +1790,7 @@ static int mtk_jpeg_probe(struct platform_device *pdev) return ret; } -static int mtk_jpeg_remove(struct platform_device *pdev) +static void mtk_jpeg_remove(struct platform_device *pdev) { struct mtk_jpeg_dev *jpeg = platform_get_drvdata(pdev); @@ -1798,8 +1798,6 @@ static int mtk_jpeg_remove(struct platform_device *pdev) video_unregister_device(jpeg->vdev); v4l2_m2m_release(jpeg->m2m_dev); v4l2_device_unregister(&jpeg->v4l2_dev); - - return 0; } static __maybe_unused int mtk_jpeg_pm_suspend(struct device *dev) @@ -1928,7 +1926,7 @@ MODULE_DEVICE_TABLE(of, mtk_jpeg_match); static struct platform_driver mtk_jpeg_driver = { .probe = mtk_jpeg_probe, - .remove = mtk_jpeg_remove, + .remove_new = mtk_jpeg_remove, .driver = { .name = MTK_JPEG_NAME, .of_match_table = of_match_ptr(mtk_jpeg_match), From patchwork Sun Mar 26 14:30:54 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= X-Patchwork-Id: 13188162 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 5C9C3C77B6E for ; Sun, 26 Mar 2023 14:33:15 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232561AbjCZOdO (ORCPT ); Sun, 26 Mar 2023 10:33:14 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60336 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232356AbjCZOco (ORCPT ); Sun, 26 Mar 2023 10:32:44 -0400 Received: from metis.ext.pengutronix.de (metis.ext.pengutronix.de [IPv6:2001:67c:670:201:290:27ff:fe1d:cc33]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8AFFE6EAF for ; Sun, 26 Mar 2023 07:32:43 -0700 (PDT) Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.ext.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pgRQ9-0007u7-Ss; Sun, 26 Mar 2023 16:32:33 +0200 Received: from [2a0a:edc0:0:900:1d::77] (helo=ptz.office.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtp (Exim 4.94.2) (envelope-from ) id 1pgRQ8-006raq-0o; Sun, 26 Mar 2023 16:32:32 +0200 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1pgRQ7-0088VX-Cx; Sun, 26 Mar 2023 16:32:31 +0200 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Minghsiu Tsai , Houlong Wei , Andrew-CT Chen , Mauro Carvalho Chehab , Matthias Brugger Cc: AngeloGioacchino Del Regno , linux-media@vger.kernel.org, kernel@pengutronix.de, linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org Subject: [PATCH 027/117] media: mtk_mdp_core: Convert to platform remove callback returning void Date: Sun, 26 Mar 2023 16:30:54 +0200 Message-Id: <20230326143224.572654-30-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230326143224.572654-1-u.kleine-koenig@pengutronix.de> References: <20230326143224.572654-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1880; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=y8bSdpHxKUjCtkirbqVmfzAs2Ji59QmvfnVDIgdxzcQ=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBkIFan6YuIoMjUGZnFCQzpGpWS/hnIDnLhYY6Pb Me2nK1dfZ+JATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZCBWpwAKCRCPgPtYfRL+ TnOQB/9uXk4tzwoMLL/P51kVbWyicAA9ErSPE7tziq+q6StcUfDCBSAksMFr/C/N4DYWFnXZrAN ZhskqwE0/YIi8VBK9HVCgFn3ceDMqEVaENs4z5Udpr8cOo0MbRSBnOiVXsb9fMQwdsM63SZJ7j8 gpyngUq86GkXUGoiW1TY0aR5C1och9yyzawc4Eck6F2TzJOFimpCvYXiMK2MIDT/Sl9iaivxHOn oOCWhYTOtE96gymBOk17/xnQjQsLljkPRU+cZILEbUP48q8UcidqLzGmdB+Nl5cKarKt3QKWP4D cs64Ib3/Th4jWpkJBflC9/+R/fNKMJvQle91G7GsWT94GPw5 X-Developer-Key: i=u.kleine-koenig@pengutronix.de; a=openpgp; fpr=0D2511F322BFAB1C1580266BE2DCDD9132669BD6 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.ext.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-media@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@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 (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 --- drivers/media/platform/mediatek/mdp/mtk_mdp_core.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/drivers/media/platform/mediatek/mdp/mtk_mdp_core.c b/drivers/media/platform/mediatek/mdp/mtk_mdp_core.c index d83c4964eaf9..77e310e588e5 100644 --- a/drivers/media/platform/mediatek/mdp/mtk_mdp_core.c +++ b/drivers/media/platform/mediatek/mdp/mtk_mdp_core.c @@ -235,7 +235,7 @@ static int mtk_mdp_probe(struct platform_device *pdev) return ret; } -static int mtk_mdp_remove(struct platform_device *pdev) +static void mtk_mdp_remove(struct platform_device *pdev) { struct mtk_mdp_dev *mdp = platform_get_drvdata(pdev); struct mtk_mdp_comp *comp, *comp_temp; @@ -255,7 +255,6 @@ static int mtk_mdp_remove(struct platform_device *pdev) } dev_dbg(&pdev->dev, "%s driver unloaded\n", pdev->name); - return 0; } static int __maybe_unused mtk_mdp_pm_suspend(struct device *dev) @@ -299,7 +298,7 @@ static const struct dev_pm_ops mtk_mdp_pm_ops = { static struct platform_driver mtk_mdp_driver = { .probe = mtk_mdp_probe, - .remove = mtk_mdp_remove, + .remove_new = mtk_mdp_remove, .driver = { .name = MTK_MDP_MODULE_NAME, .pm = &mtk_mdp_pm_ops, From patchwork Sun Mar 26 14:30:55 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= X-Patchwork-Id: 13188160 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 0863AC761AF for ; Sun, 26 Mar 2023 14:33:13 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231443AbjCZOdL (ORCPT ); Sun, 26 Mar 2023 10:33:11 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60368 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232418AbjCZOco (ORCPT ); Sun, 26 Mar 2023 10:32:44 -0400 Received: from metis.ext.pengutronix.de (metis.ext.pengutronix.de [IPv6:2001:67c:670:201:290:27ff:fe1d:cc33]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 123DB65AC for ; Sun, 26 Mar 2023 07:32:43 -0700 (PDT) Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.ext.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pgRQ9-0007uX-SM; Sun, 26 Mar 2023 16:32:33 +0200 Received: from [2a0a:edc0:0:900:1d::77] (helo=ptz.office.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtp (Exim 4.94.2) (envelope-from ) id 1pgRQ8-006rax-CH; Sun, 26 Mar 2023 16:32:32 +0200 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1pgRQ7-0088Vb-J9; Sun, 26 Mar 2023 16:32:31 +0200 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Mauro Carvalho Chehab , Matthias Brugger , Hans Verkuil , Moudy Ho , Qiheng Lin , =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= Cc: AngeloGioacchino Del Regno , linux-media@vger.kernel.org, kernel@pengutronix.de, linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org Subject: [PATCH 028/117] media: mtk-mdp3-core: Convert to platform remove callback returning void Date: Sun, 26 Mar 2023 16:30:55 +0200 Message-Id: <20230326143224.572654-31-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230326143224.572654-1-u.kleine-koenig@pengutronix.de> References: <20230326143224.572654-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1763; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=jkf5L5dQSyQohhm9KTe95OwaXqfBXlh7AMsHg9iF88o=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBkIFaoSBDTbn24ir03DGKWIxpj0tpH/SFo14z6b AA5Yd1GPEmJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZCBWqAAKCRCPgPtYfRL+ ToTHB/93xJPhkrxuOzwhK6gL5NavTvpgyizxFjQDjhtkK56Kh81623SABfB5cicKJBZkmBD/Eks h7t7fWz2Nq9y+3TAfkeb6D7mfu7euvZCNFM57LMPX2fKRAIORfa4WwtcMCnQaVITlrQCL2gLOvO 4S1GPprLyao83yeakOKSYE4EtFxsma8tmSCtjgCmkOpq7N1E4ZT6nT02OYAh2akkpKLioXVf6Ad aT2DgQVfO8oFJnVMUgPH1F/bCjDXNHvRaxNrWG98hpsAQyGO96M92JYFJuhcaK4J1P8YRNYeDBY bdBT5X+A3LMyFYlcECHJVpCdNaJJuu8/o0B3KvfR/Ibl5VVF X-Developer-Key: i=u.kleine-koenig@pengutronix.de; a=openpgp; fpr=0D2511F322BFAB1C1580266BE2DCDD9132669BD6 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.ext.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-media@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@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 (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 --- drivers/media/platform/mediatek/mdp3/mtk-mdp3-core.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/drivers/media/platform/mediatek/mdp3/mtk-mdp3-core.c b/drivers/media/platform/mediatek/mdp3/mtk-mdp3-core.c index 97edcd9d1c81..041bcad675da 100644 --- a/drivers/media/platform/mediatek/mdp3/mtk-mdp3-core.c +++ b/drivers/media/platform/mediatek/mdp3/mtk-mdp3-core.c @@ -298,14 +298,13 @@ static int mdp_probe(struct platform_device *pdev) return ret; } -static int mdp_remove(struct platform_device *pdev) +static void mdp_remove(struct platform_device *pdev) { struct mdp_dev *mdp = platform_get_drvdata(pdev); v4l2_device_unregister(&mdp->v4l2_dev); dev_dbg(&pdev->dev, "%s driver unloaded\n", pdev->name); - return 0; } static int __maybe_unused mdp_suspend(struct device *dev) @@ -345,7 +344,7 @@ static const struct dev_pm_ops mdp_pm_ops = { static struct platform_driver mdp_driver = { .probe = mdp_probe, - .remove = mdp_remove, + .remove_new = mdp_remove, .driver = { .name = MDP_MODULE_NAME, .pm = &mdp_pm_ops, From patchwork Sun Mar 26 14:30:56 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= X-Patchwork-Id: 13188163 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 3258AC6FD1C for ; Sun, 26 Mar 2023 14:33:17 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232420AbjCZOdP (ORCPT ); Sun, 26 Mar 2023 10:33:15 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60334 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232422AbjCZOco (ORCPT ); Sun, 26 Mar 2023 10:32:44 -0400 Received: from metis.ext.pengutronix.de (metis.ext.pengutronix.de [IPv6:2001:67c:670:201:290:27ff:fe1d:cc33]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D3EDC7DB0 for ; Sun, 26 Mar 2023 07:32:43 -0700 (PDT) Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.ext.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pgRQ9-0007ua-Sq; Sun, 26 Mar 2023 16:32:33 +0200 Received: from [2a0a:edc0:0:900:1d::77] (helo=ptz.office.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtp (Exim 4.94.2) (envelope-from ) id 1pgRQ8-006rb0-Eg; Sun, 26 Mar 2023 16:32:32 +0200 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1pgRQ7-0088Vf-QB; Sun, 26 Mar 2023 16:32:31 +0200 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Tiffany Lin , Andrew-CT Chen , Yunfei Dong , Mauro Carvalho Chehab , Matthias Brugger Cc: AngeloGioacchino Del Regno , linux-media@vger.kernel.org, kernel@pengutronix.de, linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org Subject: [PATCH 029/117] media: mtk_vcodec_dec_drv: Convert to platform remove callback returning void Date: Sun, 26 Mar 2023 16:30:56 +0200 Message-Id: <20230326143224.572654-32-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230326143224.572654-1-u.kleine-koenig@pengutronix.de> References: <20230326143224.572654-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1894; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=O6z10/slUyNl2TD3diJ/WCSRZtqpk39pLLrKXrHKrTk=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBkIFaptPdsjpR2hYatPNI+aLWKfTwo2bR59OOa/ LPnZBIQs1aJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZCBWqQAKCRCPgPtYfRL+ TntbB/0VncSjZPipPwEbM/MkOFDUQEJYwx+uHEot5G61sCpHx1UYJ/7ABORc9e/cM1Eabk724kb 4mGGmjzvCq2fqKy7T4c/GNADCUYQHXz4IvL6wPblz20n+aLcBlFwHy+n9Vf3PQ+bgwmel0OMchB lXXoSynM1iWWiLQEKeJFeolcE9xK0ZIlSCA1L2BuopuervaxVyEJzUeB3sgbCQ8voZ6cuWh2huq mOR8XGkJFulQAQlonFDvGod6TydUJsWAV/osMcOfEfaH6tm0l7cxQiUhEU2DK83bmx02VJ6Ehlv JqqAGF6dB9dEnD88yGwtkNvvYUpbUrQJgLYREDTQ0/av4imk X-Developer-Key: i=u.kleine-koenig@pengutronix.de; a=openpgp; fpr=0D2511F322BFAB1C1580266BE2DCDD9132669BD6 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.ext.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-media@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@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 (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 --- drivers/media/platform/mediatek/vcodec/mtk_vcodec_dec_drv.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/drivers/media/platform/mediatek/vcodec/mtk_vcodec_dec_drv.c b/drivers/media/platform/mediatek/vcodec/mtk_vcodec_dec_drv.c index 174a6eec2f54..2fa5c5e6607c 100644 --- a/drivers/media/platform/mediatek/vcodec/mtk_vcodec_dec_drv.c +++ b/drivers/media/platform/mediatek/vcodec/mtk_vcodec_dec_drv.c @@ -487,7 +487,7 @@ static const struct of_device_id mtk_vcodec_match[] = { MODULE_DEVICE_TABLE(of, mtk_vcodec_match); -static int mtk_vcodec_dec_remove(struct platform_device *pdev) +static void mtk_vcodec_dec_remove(struct platform_device *pdev) { struct mtk_vcodec_dev *dev = platform_get_drvdata(pdev); @@ -509,12 +509,11 @@ static int mtk_vcodec_dec_remove(struct platform_device *pdev) if (!dev->vdec_pdata->is_subdev_supported) pm_runtime_disable(dev->pm.dev); mtk_vcodec_fw_release(dev->fw_handler); - return 0; } static struct platform_driver mtk_vcodec_dec_driver = { .probe = mtk_vcodec_probe, - .remove = mtk_vcodec_dec_remove, + .remove_new = mtk_vcodec_dec_remove, .driver = { .name = MTK_VCODEC_DEC_NAME, .of_match_table = mtk_vcodec_match, From patchwork Sun Mar 26 14:30:57 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= X-Patchwork-Id: 13188171 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id E777FC74A5B for ; Sun, 26 Mar 2023 14:33:25 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232566AbjCZOdY (ORCPT ); Sun, 26 Mar 2023 10:33:24 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60432 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232435AbjCZOcq (ORCPT ); Sun, 26 Mar 2023 10:32:46 -0400 Received: from metis.ext.pengutronix.de (metis.ext.pengutronix.de [IPv6:2001:67c:670:201:290:27ff:fe1d:cc33]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3FD717AB1 for ; Sun, 26 Mar 2023 07:32:45 -0700 (PDT) Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.ext.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pgRQB-0007yF-0u; Sun, 26 Mar 2023 16:32:35 +0200 Received: from [2a0a:edc0:0:900:1d::77] (helo=ptz.office.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtp (Exim 4.94.2) (envelope-from ) id 1pgRQ9-006rbB-E1; Sun, 26 Mar 2023 16:32:33 +0200 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1pgRQ8-0088Vj-0T; Sun, 26 Mar 2023 16:32:32 +0200 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Tiffany Lin , Andrew-CT Chen , Yunfei Dong , Mauro Carvalho Chehab , Matthias Brugger Cc: AngeloGioacchino Del Regno , linux-media@vger.kernel.org, kernel@pengutronix.de, linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org Subject: [PATCH 030/117] media: mtk_vcodec_enc_drv: Convert to platform remove callback returning void Date: Sun, 26 Mar 2023 16:30:57 +0200 Message-Id: <20230326143224.572654-33-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230326143224.572654-1-u.kleine-koenig@pengutronix.de> References: <20230326143224.572654-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1904; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=iWZQWni5H+Z+BEh9nLVGdQ7KridiLmts8udqla8jAqE=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBkIFarZ2Tvj6+2UCxNTYlxWwzIXahGDoc2x8SpM QxSpw33l6yJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZCBWqwAKCRCPgPtYfRL+ Tk3SB/4iM2L2a0F42ERFVuzNvi9MbRs/YSxe0/SmKJMLjJ7qf9uAbuQqOmOwq8IXUZp9mYXT+Au JJ1rtkxh9JEvX/1ZOAbuM+9+Txn/q6Gr4E8sUaHQ95I9ai0nXKmAJV36oboKqxsjlMZwU6gqHwZ ihvXgnKCeP1IJEIPkvMcXcym6yvfQf+sXr2usGHmOHH1YynvZXA8c3+vur63y3RgclWUe4iIohn yu55dnrJLFQY52srRK/nC+s6p5nm6QQq9sRStI6FjgLhRTMpR0ryrx7NpHI9xmieAv3+9xrKnmG nx3wz4OqYuWyzueoHADdA5vthEXfmswE9gHcw5qrejLVdI/J X-Developer-Key: i=u.kleine-koenig@pengutronix.de; a=openpgp; fpr=0D2511F322BFAB1C1580266BE2DCDD9132669BD6 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.ext.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-media@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@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 (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 --- drivers/media/platform/mediatek/vcodec/mtk_vcodec_enc_drv.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/drivers/media/platform/mediatek/vcodec/mtk_vcodec_enc_drv.c b/drivers/media/platform/mediatek/vcodec/mtk_vcodec_enc_drv.c index 9095186d5495..cd0d5da8195a 100644 --- a/drivers/media/platform/mediatek/vcodec/mtk_vcodec_enc_drv.c +++ b/drivers/media/platform/mediatek/vcodec/mtk_vcodec_enc_drv.c @@ -451,7 +451,7 @@ static const struct of_device_id mtk_vcodec_enc_match[] = { }; MODULE_DEVICE_TABLE(of, mtk_vcodec_enc_match); -static int mtk_vcodec_enc_remove(struct platform_device *pdev) +static void mtk_vcodec_enc_remove(struct platform_device *pdev) { struct mtk_vcodec_dev *dev = platform_get_drvdata(pdev); @@ -466,12 +466,11 @@ static int mtk_vcodec_enc_remove(struct platform_device *pdev) v4l2_device_unregister(&dev->v4l2_dev); pm_runtime_disable(dev->pm.dev); mtk_vcodec_fw_release(dev->fw_handler); - return 0; } static struct platform_driver mtk_vcodec_enc_driver = { .probe = mtk_vcodec_probe, - .remove = mtk_vcodec_enc_remove, + .remove_new = mtk_vcodec_enc_remove, .driver = { .name = MTK_VCODEC_ENC_NAME, .of_match_table = mtk_vcodec_enc_match, From patchwork Sun Mar 26 14:30:58 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= X-Patchwork-Id: 13188181 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 69E8EC74A5B for ; Sun, 26 Mar 2023 14:33:37 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232572AbjCZOdg (ORCPT ); Sun, 26 Mar 2023 10:33:36 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60334 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232442AbjCZOct (ORCPT ); Sun, 26 Mar 2023 10:32:49 -0400 Received: from metis.ext.pengutronix.de (metis.ext.pengutronix.de [IPv6:2001:67c:670:201:290:27ff:fe1d:cc33]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D02F77AB1 for ; Sun, 26 Mar 2023 07:32:48 -0700 (PDT) Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.ext.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pgRQB-0007zm-6n; Sun, 26 Mar 2023 16:32:35 +0200 Received: from [2a0a:edc0:0:900:1d::77] (helo=ptz.office.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtp (Exim 4.94.2) (envelope-from ) id 1pgRQ9-006rbF-LU; Sun, 26 Mar 2023 16:32:33 +0200 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1pgRQ8-0088Vn-7D; Sun, 26 Mar 2023 16:32:32 +0200 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Tiffany Lin , Andrew-CT Chen , Yunfei Dong , Minghsiu Tsai , Houlong Wei , Mauro Carvalho Chehab , Matthias Brugger Cc: AngeloGioacchino Del Regno , linux-media@vger.kernel.org, kernel@pengutronix.de, linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org Subject: [PATCH 031/117] media: mtk_vpu: Convert to platform remove callback returning void Date: Sun, 26 Mar 2023 16:30:58 +0200 Message-Id: <20230326143224.572654-34-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230326143224.572654-1-u.kleine-koenig@pengutronix.de> References: <20230326143224.572654-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1833; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=5AnskvbJ9P6qn4bjvfh8odB1G7YnnigrgkIsVya1kFw=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBkIFasvO2cvWqi/Z6zq3C/m+ICsHa4M+7Z3cNjt ZBzIamySpOJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZCBWrAAKCRCPgPtYfRL+ ToTyCACzflSqkfkNslDRxcB7Zlt5Y526OmU7az8FU4sINBxILXtY25jkHnky6BMeeS+In+qLJ3j ogZQT2BX1uJLwC9oVqthcfsca1u1ujUV3ugS0g03UFqvzc1MrdiwcNWd8yEQrrciYoSu26Ju+gc nItJWUAKA49+D6SE+bxte27q0hpfXgCjUf/PLfEpv7wSP/RD9Z2c7QtSK9CGLDKwiCIzw+0UUXo bSg2MJmODWi2mOITVH9Y0bZPtCK0X6z3kyccACRVWK+PBgYNgLVdHraAOG1h2GBQUNSwNuRsClO WnIPUZnDjLzXnR2AbZCXixWhGY6uPuRFzmI8Mk7pcSrwoPg5 X-Developer-Key: i=u.kleine-koenig@pengutronix.de; a=openpgp; fpr=0D2511F322BFAB1C1580266BE2DCDD9132669BD6 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.ext.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-media@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@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 (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 --- drivers/media/platform/mediatek/vpu/mtk_vpu.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/media/platform/mediatek/vpu/mtk_vpu.c b/drivers/media/platform/mediatek/vpu/mtk_vpu.c index 47b684b92f81..5e2bc286f168 100644 --- a/drivers/media/platform/mediatek/vpu/mtk_vpu.c +++ b/drivers/media/platform/mediatek/vpu/mtk_vpu.c @@ -953,7 +953,7 @@ static const struct of_device_id mtk_vpu_match[] = { }; MODULE_DEVICE_TABLE(of, mtk_vpu_match); -static int mtk_vpu_remove(struct platform_device *pdev) +static void mtk_vpu_remove(struct platform_device *pdev) { struct mtk_vpu *vpu = platform_get_drvdata(pdev); @@ -966,8 +966,6 @@ static int mtk_vpu_remove(struct platform_device *pdev) vpu_free_ext_mem(vpu, D_FW); mutex_destroy(&vpu->vpu_mutex); clk_unprepare(vpu->clk); - - return 0; } static int mtk_vpu_suspend(struct device *dev) @@ -1040,7 +1038,7 @@ static const struct dev_pm_ops mtk_vpu_pm = { static struct platform_driver mtk_vpu_driver = { .probe = mtk_vpu_probe, - .remove = mtk_vpu_remove, + .remove_new = mtk_vpu_remove, .driver = { .name = "mtk_vpu", .pm = &mtk_vpu_pm, From patchwork Sun Mar 26 14:30:59 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= X-Patchwork-Id: 13188152 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id AD990C77B62 for ; Sun, 26 Mar 2023 14:33:02 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232539AbjCZOdB (ORCPT ); Sun, 26 Mar 2023 10:33:01 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59956 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232394AbjCZOcj (ORCPT ); Sun, 26 Mar 2023 10:32:39 -0400 Received: from metis.ext.pengutronix.de (metis.ext.pengutronix.de [IPv6:2001:67c:670:201:290:27ff:fe1d:cc33]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id EBBA27DAC for ; Sun, 26 Mar 2023 07:32:37 -0700 (PDT) Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.ext.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pgRQA-0007ve-8U; Sun, 26 Mar 2023 16:32:34 +0200 Received: from [2a0a:edc0:0:900:1d::77] (helo=ptz.office.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtp (Exim 4.94.2) (envelope-from ) id 1pgRQ9-006rb6-3h; Sun, 26 Mar 2023 16:32:33 +0200 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1pgRQ8-0088Vq-Du; Sun, 26 Mar 2023 16:32:32 +0200 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Eugen Hristev , Mauro Carvalho Chehab Cc: linux-media@vger.kernel.org, kernel@pengutronix.de Subject: [PATCH 032/117] media: microchip-csi2dc: Convert to platform remove callback returning void Date: Sun, 26 Mar 2023 16:30:59 +0200 Message-Id: <20230326143224.572654-35-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230326143224.572654-1-u.kleine-koenig@pengutronix.de> References: <20230326143224.572654-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1924; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=HU+5x31YPCAtV24NFHZsy46zuBB0Z96KgSQC2taOM/E=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBkIFatbie/x+UhsBNpmyfeH49PeVHtehzYhWAvG YxC++uN4VGJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZCBWrQAKCRCPgPtYfRL+ Tu5+B/0TxM/hHxseSsIf4lDNHfClCQ2R6yBp4DAY/55Vqg8XOFCPH90syP8XYzIkbFYWWaB3xns WFX5WqY2EBwlaLuPPNVMOzjPw3wWE/KskrosNE2AJ+QFXIA74YzEIuLQXz+gmKOHfDj3lvtSp/+ 028/lITtZc3t29CG1XIPNP6wOZAgf0FSXPMLzjN79QcDTj+67X86qpTnt2iqGRyxCooc/Nm9Gpk Ldd3Xa3eJavj+NvFkIY6R9axPqkn//AT4J32+O3ePH4jOAMzL3h0HOd4Vf/Z5VT2WYuJiERkepG 3ER+02RKMeYt2dj0cgOHgJwlXmhIuplm4pRPtDqZ8Y0EH2Jk X-Developer-Key: i=u.kleine-koenig@pengutronix.de; a=openpgp; fpr=0D2511F322BFAB1C1580266BE2DCDD9132669BD6 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.ext.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-media@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@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 (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 --- drivers/media/platform/microchip/microchip-csi2dc.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/media/platform/microchip/microchip-csi2dc.c b/drivers/media/platform/microchip/microchip-csi2dc.c index d5b359f607ae..bfb3edcf018a 100644 --- a/drivers/media/platform/microchip/microchip-csi2dc.c +++ b/drivers/media/platform/microchip/microchip-csi2dc.c @@ -741,7 +741,7 @@ static int csi2dc_probe(struct platform_device *pdev) return ret; } -static int csi2dc_remove(struct platform_device *pdev) +static void csi2dc_remove(struct platform_device *pdev) { struct csi2dc_device *csi2dc = platform_get_drvdata(pdev); @@ -751,8 +751,6 @@ static int csi2dc_remove(struct platform_device *pdev) v4l2_async_nf_unregister(&csi2dc->notifier); v4l2_async_nf_cleanup(&csi2dc->notifier); media_entity_cleanup(&csi2dc->csi2dc_sd.entity); - - return 0; } static int __maybe_unused csi2dc_runtime_suspend(struct device *dev) @@ -782,7 +780,7 @@ MODULE_DEVICE_TABLE(of, csi2dc_of_match); static struct platform_driver csi2dc_driver = { .probe = csi2dc_probe, - .remove = csi2dc_remove, + .remove_new = csi2dc_remove, .driver = { .name = "microchip-csi2dc", .pm = &csi2dc_dev_pm_ops, From patchwork Sun Mar 26 14:31:00 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= X-Patchwork-Id: 13188157 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 82C41C6FD1C for ; Sun, 26 Mar 2023 14:33:09 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232554AbjCZOdI (ORCPT ); Sun, 26 Mar 2023 10:33:08 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60164 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232378AbjCZOcl (ORCPT ); Sun, 26 Mar 2023 10:32:41 -0400 Received: from metis.ext.pengutronix.de (metis.ext.pengutronix.de [IPv6:2001:67c:670:201:290:27ff:fe1d:cc33]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8A8307D84 for ; Sun, 26 Mar 2023 07:32:40 -0700 (PDT) Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.ext.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pgRQC-00082Z-Cz; Sun, 26 Mar 2023 16:32:36 +0200 Received: from [2a0a:edc0:0:900:1d::77] (helo=ptz.office.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtp (Exim 4.94.2) (envelope-from ) id 1pgRQA-006rbU-5E; Sun, 26 Mar 2023 16:32:34 +0200 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1pgRQ8-0088Vv-Kv; Sun, 26 Mar 2023 16:32:32 +0200 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Eugen Hristev , Mauro Carvalho Chehab Cc: linux-media@vger.kernel.org, kernel@pengutronix.de Subject: [PATCH 033/117] media: microchip-sama5d2-isc: Convert to platform remove callback returning void Date: Sun, 26 Mar 2023 16:31:00 +0200 Message-Id: <20230326143224.572654-36-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230326143224.572654-1-u.kleine-koenig@pengutronix.de> References: <20230326143224.572654-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1945; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=6DLkcjBsFIXRydyOgDhKMvBKli+gRBDanO5gWRa8atU=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBkIFauywHHSaT3npKYmgiU1TU6g94tHBpoJJO4D 3jKRP1UGWeJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZCBWrgAKCRCPgPtYfRL+ TmPWB/9WkVzdAVu+bKuIyvCSS0xpZvohmWGbBt6Tyirkh00kZuY4HUxwsMV7HJWHKeLMDxAdq1W Yma7zktveK8hGD5BenWwRWiTlJvY13xVi7z8XCc93wM07I9h9+m8AZ+EXen0AXXaXfsiJWPQeyB YpKBoC4VpB585k02QiaYxrpowMYLdDrIsYmkCF8GwRxX81tk5tedqzavIv3Bih3VQcewIncMz9w jnQPP/C/FA3G8eLmh73SF49oURSOwjg6dJiaFoVU5kimLp0DNMpUwxuTOhWHwI8tEbk+PfEatcm N7oWefHrsZ+VRDlcTHfeuxUrhnUqvBqWerYXA9qDCs4Agy0K X-Developer-Key: i=u.kleine-koenig@pengutronix.de; a=openpgp; fpr=0D2511F322BFAB1C1580266BE2DCDD9132669BD6 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.ext.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-media@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@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 (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 --- drivers/media/platform/microchip/microchip-sama5d2-isc.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/media/platform/microchip/microchip-sama5d2-isc.c b/drivers/media/platform/microchip/microchip-sama5d2-isc.c index ac4715d91de6..746f4a2fa9f6 100644 --- a/drivers/media/platform/microchip/microchip-sama5d2-isc.c +++ b/drivers/media/platform/microchip/microchip-sama5d2-isc.c @@ -608,7 +608,7 @@ static int microchip_isc_probe(struct platform_device *pdev) return ret; } -static int microchip_isc_remove(struct platform_device *pdev) +static void microchip_isc_remove(struct platform_device *pdev) { struct isc_device *isc = platform_get_drvdata(pdev); @@ -624,8 +624,6 @@ static int microchip_isc_remove(struct platform_device *pdev) clk_disable_unprepare(isc->hclock); microchip_isc_clk_cleanup(isc); - - return 0; } static int __maybe_unused isc_runtime_suspend(struct device *dev) @@ -668,7 +666,7 @@ MODULE_DEVICE_TABLE(of, microchip_isc_of_match); static struct platform_driver microchip_isc_driver = { .probe = microchip_isc_probe, - .remove = microchip_isc_remove, + .remove_new = microchip_isc_remove, .driver = { .name = "microchip-sama5d2-isc", .pm = µchip_isc_dev_pm_ops, From patchwork Sun Mar 26 14:31:01 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= X-Patchwork-Id: 13188154 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 3A3F5C761AF for ; Sun, 26 Mar 2023 14:33:05 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231808AbjCZOdD (ORCPT ); Sun, 26 Mar 2023 10:33:03 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60112 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231821AbjCZOck (ORCPT ); Sun, 26 Mar 2023 10:32:40 -0400 Received: from metis.ext.pengutronix.de (metis.ext.pengutronix.de [IPv6:2001:67c:670:201:290:27ff:fe1d:cc33]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8D78E769A for ; Sun, 26 Mar 2023 07:32:39 -0700 (PDT) Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.ext.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pgRQB-00080x-MR; Sun, 26 Mar 2023 16:32:35 +0200 Received: from [2a0a:edc0:0:900:1d::77] (helo=ptz.office.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtp (Exim 4.94.2) (envelope-from ) id 1pgRQ9-006rbJ-RW; Sun, 26 Mar 2023 16:32:33 +0200 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1pgRQ8-0088Vy-Ug; Sun, 26 Mar 2023 16:32:32 +0200 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Eugen Hristev , Mauro Carvalho Chehab Cc: linux-media@vger.kernel.org, kernel@pengutronix.de Subject: [PATCH 034/117] media: microchip-sama7g5-isc: Convert to platform remove callback returning void Date: Sun, 26 Mar 2023 16:31:01 +0200 Message-Id: <20230326143224.572654-37-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230326143224.572654-1-u.kleine-koenig@pengutronix.de> References: <20230326143224.572654-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1957; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=aZ6EOxtvIZ9tqJoBhbJ70uVfp2VxwkuxUqxOkYcYfD8=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBkIFavjdWydg6gvCNKO9vYNIVb7gpoN3Q6BIsFL WtC64WWL6WJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZCBWrwAKCRCPgPtYfRL+ TgyiB/95gyxi3i81+rXc7N8DS/CdOGQw3t8e7Zu4jf+ElCLvKSyNObTJEUXnE/BsVcwiv58Ryr6 VB6uwaafLts2tQH/u6Slwrggk6QNQltu8Nf7Y9xE7Yidmg0UY8o1NNNVJIJPfm0ThcylRdbV3N0 F7IZTnD7h/6nnxdeTw7QKCRrVgxtbf5nhkjqsYJfKjNNDaqtDZhmFXLPRm62e6hs7PFHu4T43Bl eb8WeGVUxBi52gVo5tNQ6bsy/ImZj7PnqwUTKS/3U7XKVoJIYiY16TnjThYEKaT7xfccVADKaux OOxUBWpGqNXc+7qGUcJyKOsq7E5ESxkpJ4knR7mF1SsG64lY X-Developer-Key: i=u.kleine-koenig@pengutronix.de; a=openpgp; fpr=0D2511F322BFAB1C1580266BE2DCDD9132669BD6 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.ext.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-media@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@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 (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 --- drivers/media/platform/microchip/microchip-sama7g5-isc.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/media/platform/microchip/microchip-sama7g5-isc.c b/drivers/media/platform/microchip/microchip-sama7g5-isc.c index d583eafe5cc1..79ae696764d0 100644 --- a/drivers/media/platform/microchip/microchip-sama7g5-isc.c +++ b/drivers/media/platform/microchip/microchip-sama7g5-isc.c @@ -577,7 +577,7 @@ static int microchip_xisc_probe(struct platform_device *pdev) return ret; } -static int microchip_xisc_remove(struct platform_device *pdev) +static void microchip_xisc_remove(struct platform_device *pdev) { struct isc_device *isc = platform_get_drvdata(pdev); @@ -592,8 +592,6 @@ static int microchip_xisc_remove(struct platform_device *pdev) clk_disable_unprepare(isc->hclock); microchip_isc_clk_cleanup(isc); - - return 0; } static int __maybe_unused xisc_runtime_suspend(struct device *dev) @@ -631,7 +629,7 @@ MODULE_DEVICE_TABLE(of, microchip_xisc_of_match); static struct platform_driver microchip_xisc_driver = { .probe = microchip_xisc_probe, - .remove = microchip_xisc_remove, + .remove_new = microchip_xisc_remove, .driver = { .name = "microchip-sama7g5-xisc", .pm = µchip_xisc_dev_pm_ops, From patchwork Sun Mar 26 14:31:02 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= X-Patchwork-Id: 13188159 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id D651AC77B6C for ; Sun, 26 Mar 2023 14:33:11 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232560AbjCZOdK (ORCPT ); Sun, 26 Mar 2023 10:33:10 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60334 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232411AbjCZOco (ORCPT ); Sun, 26 Mar 2023 10:32:44 -0400 Received: from metis.ext.pengutronix.de (metis.ext.pengutronix.de [IPv6:2001:67c:670:201:290:27ff:fe1d:cc33]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4A2AF7A8D for ; Sun, 26 Mar 2023 07:32:42 -0700 (PDT) Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.ext.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pgRQC-00081j-5s; Sun, 26 Mar 2023 16:32:36 +0200 Received: from [2a0a:edc0:0:900:1d::77] (helo=ptz.office.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtp (Exim 4.94.2) (envelope-from ) id 1pgRQA-006rbN-01; Sun, 26 Mar 2023 16:32:34 +0200 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1pgRQ9-0088W1-4g; Sun, 26 Mar 2023 16:32:33 +0200 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Dmitry Osipenko , Mauro Carvalho Chehab , Thierry Reding , Jonathan Hunter Cc: linux-media@vger.kernel.org, linux-tegra@vger.kernel.org, kernel@pengutronix.de Subject: [PATCH 035/117] media: vde: Convert to platform remove callback returning void Date: Sun, 26 Mar 2023 16:31:02 +0200 Message-Id: <20230326143224.572654-38-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230326143224.572654-1-u.kleine-koenig@pengutronix.de> References: <20230326143224.572654-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1896; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=DwvC+rbFxTPbMN3MsoLH2dmtGYionTkUjlSwJHUAVv4=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBkIFaxEqz1BUsSzfeMNzBe48IMR2VpMvzt6Qin4 S6GyPlp+R+JATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZCBWsQAKCRCPgPtYfRL+ TkY0B/4/aM5qKHWLnx5AyelmAxDLgZjU4AwgkO8xIxD++qUNTPEykPbW1EuESF0UdxdDMOwVog+ y+Pw9sT516FzfehgAG3CCo5/8QJNb3owvegECw7XFN8jCYSZnOCRXOBpsQSCDQgbMwdTEAr17KP JlYc/RtQ2j6UHE3tvo6sc0mGNskiIAuyDqCDey9NlTGPEBkaEZFv83tVM2jyqVGXAWtpZAXs9BO ZKFB9cGSVWBo1Kxa9gJYJ3mAGEyY0Qy5t7P9rXcD8dOvdL8gQ8+O0gIdidIH2RgsmzVrbJV6QS7 vzkSrxN5i/7H9aTs9HkQblkQ47qKqPC0wn05k3u4mZ2XNL0a X-Developer-Key: i=u.kleine-koenig@pengutronix.de; a=openpgp; fpr=0D2511F322BFAB1C1580266BE2DCDD9132669BD6 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.ext.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-media@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@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 (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 Acked-by: Thierry Reding --- drivers/media/platform/nvidia/tegra-vde/vde.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/media/platform/nvidia/tegra-vde/vde.c b/drivers/media/platform/nvidia/tegra-vde/vde.c index f3e863a94c5a..7157734a1550 100644 --- a/drivers/media/platform/nvidia/tegra-vde/vde.c +++ b/drivers/media/platform/nvidia/tegra-vde/vde.c @@ -378,7 +378,7 @@ static int tegra_vde_probe(struct platform_device *pdev) return err; } -static int tegra_vde_remove(struct platform_device *pdev) +static void tegra_vde_remove(struct platform_device *pdev) { struct tegra_vde *vde = platform_get_drvdata(pdev); struct device *dev = &pdev->dev; @@ -407,8 +407,6 @@ static int tegra_vde_remove(struct platform_device *pdev) gen_pool_free(vde->iram_pool, (unsigned long)vde->iram, gen_pool_size(vde->iram_pool)); - - return 0; } static void tegra_vde_shutdown(struct platform_device *pdev) @@ -536,7 +534,7 @@ MODULE_DEVICE_TABLE(of, tegra_vde_of_match); static struct platform_driver tegra_vde_driver = { .probe = tegra_vde_probe, - .remove = tegra_vde_remove, + .remove_new = tegra_vde_remove, .shutdown = tegra_vde_shutdown, .driver = { .name = "tegra-vde", From patchwork Sun Mar 26 14:31:03 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= X-Patchwork-Id: 13188156 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 2FF5BC74A5B for ; Sun, 26 Mar 2023 14:33:08 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232552AbjCZOdG (ORCPT ); Sun, 26 Mar 2023 10:33:06 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60162 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232329AbjCZOcl (ORCPT ); Sun, 26 Mar 2023 10:32:41 -0400 Received: from metis.ext.pengutronix.de (metis.ext.pengutronix.de [IPv6:2001:67c:670:201:290:27ff:fe1d:cc33]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 67E5C72B2 for ; Sun, 26 Mar 2023 07:32:40 -0700 (PDT) Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.ext.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pgRQC-00084G-4N; Sun, 26 Mar 2023 16:32:36 +0200 Received: from [2a0a:edc0:0:900:1d::77] (helo=ptz.office.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtp (Exim 4.94.2) (envelope-from ) id 1pgRQA-006rbe-I0; Sun, 26 Mar 2023 16:32:34 +0200 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1pgRQ9-0088W5-Az; Sun, 26 Mar 2023 16:32:33 +0200 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Xavier Roumegue , Mauro Carvalho Chehab Cc: linux-media@vger.kernel.org, kernel@pengutronix.de Subject: [PATCH 036/117] media: dw100: Convert to platform remove callback returning void Date: Sun, 26 Mar 2023 16:31:03 +0200 Message-Id: <20230326143224.572654-39-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230326143224.572654-1-u.kleine-koenig@pengutronix.de> References: <20230326143224.572654-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1817; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=39saJ/iaSI8X/st7qDAkBHEdQgt7KfQVpxQAgTd9M5I=; b=owGbwMvMwMXY3/A7olbonx/jabUkhhSFsE0isRtOn7WYJhbScZfxm27X7JZJdSbTPOVa/D676 63tM9DvZDRmYWDkYpAVU2Sxb1yTaVUlF9m59t9lmEGsTCBTGLg4BWAi7Ubs/xPtmM0mhGSJ9Gdv VPS7/5W5QEOz61DD8wVJYVMnGpVsZdvfOPX9VE+VfXplHKuv3pi0vb570n6BCDWOzNpL2lO8TI4 +OLHs5uaEuyHnCxIK1mcwm8zc8LnV2tpzwZdHDAl+n8VlC9M/BOtN3ysac3afl2K7K7uQQXH69A vuV+U+p1gc0Kt4e6FYPF588jp/n5N8G/9+l5TVEnHKObzWvthWkYNfmrEp0z3U8DtXdG1/1Ylli ipe2ol3P8rYW1Us4iuK4fuboVOeeUM8do/Dpx+J8gmxwa5rFt2Z837JvayLf/4++8E9/7GqvTFb 0sf9EVe7P63L/NRaN2ej45kZbybcLz65fKVMy9Ulip/UAQ== X-Developer-Key: i=u.kleine-koenig@pengutronix.de; a=openpgp; fpr=0D2511F322BFAB1C1580266BE2DCDD9132669BD6 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.ext.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-media@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@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 (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 Reviewed-by: Xavier Roumegue --- drivers/media/platform/nxp/dw100/dw100.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/media/platform/nxp/dw100/dw100.c b/drivers/media/platform/nxp/dw100/dw100.c index 189d60cd5ed1..6eed4bde9611 100644 --- a/drivers/media/platform/nxp/dw100/dw100.c +++ b/drivers/media/platform/nxp/dw100/dw100.c @@ -1633,7 +1633,7 @@ static int dw100_probe(struct platform_device *pdev) return ret; } -static int dw100_remove(struct platform_device *pdev) +static void dw100_remove(struct platform_device *pdev) { struct dw100_device *dw_dev = platform_get_drvdata(pdev); @@ -1649,8 +1649,6 @@ static int dw100_remove(struct platform_device *pdev) mutex_destroy(dw_dev->vfd.lock); v4l2_m2m_release(dw_dev->m2m_dev); v4l2_device_unregister(&dw_dev->v4l2_dev); - - return 0; } static int __maybe_unused dw100_runtime_suspend(struct device *dev) @@ -1692,7 +1690,7 @@ MODULE_DEVICE_TABLE(of, dw100_dt_ids); static struct platform_driver dw100_driver = { .probe = dw100_probe, - .remove = dw100_remove, + .remove_new = dw100_remove, .driver = { .name = DRV_NAME, .pm = &dw100_pm, From patchwork Sun Mar 26 14:31:04 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= X-Patchwork-Id: 13188170 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 87EB1C6FD1C for ; Sun, 26 Mar 2023 14:33:24 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232570AbjCZOdX (ORCPT ); Sun, 26 Mar 2023 10:33:23 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60370 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232438AbjCZOcr (ORCPT ); Sun, 26 Mar 2023 10:32:47 -0400 Received: from metis.ext.pengutronix.de (metis.ext.pengutronix.de [IPv6:2001:67c:670:201:290:27ff:fe1d:cc33]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9F0017DA1 for ; Sun, 26 Mar 2023 07:32:45 -0700 (PDT) Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.ext.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pgRQC-00083z-Oz; Sun, 26 Mar 2023 16:32:36 +0200 Received: from [2a0a:edc0:0:900:1d::77] (helo=ptz.office.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtp (Exim 4.94.2) (envelope-from ) id 1pgRQA-006rbZ-EU; Sun, 26 Mar 2023 16:32:34 +0200 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1pgRQ9-0088W9-Hw; Sun, 26 Mar 2023 16:32:33 +0200 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Mirela Rabulea , Mauro Carvalho Chehab , Shawn Guo , Sascha Hauer Cc: NXP Linux Team , Fabio Estevam , linux-media@vger.kernel.org, linux-arm-kernel@lists.infradead.org, kernel@pengutronix.de Subject: [PATCH 037/117] media: mxc-jpeg: Convert to platform remove callback returning void Date: Sun, 26 Mar 2023 16:31:04 +0200 Message-Id: <20230326143224.572654-40-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230326143224.572654-1-u.kleine-koenig@pengutronix.de> References: <20230326143224.572654-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1857; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=he/DS5KxYHpU6tXKKwvBsO17OKmtbjtQ3f2TV/xs1jg=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBkIFazsqIWM1CxZL1FRbfxXtH+SlGMFWFNtycYA GLe3UUvhbGJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZCBWswAKCRCPgPtYfRL+ TpcMB/0XNfc6SXV0I+lvFu+DCee6vfUhHM4Kzzv7ABmQJKLaSK8poHKU9AiSJ1qUsV4G9cJL0Z1 ltJylCOGJ6K205hE47qXoM7btvLrkpZhsxAYdEtfUEUnFsMmynqPT2k+08zijk++7ynn12/1qxQ ovQI8egdLEVokRaafJdcdTISKu8mdwxG2Ai0AEfw/gBSH04J+1KPTyFPe+hXGtnHcNUwsMfGCfb FiQUdKe0ZVoR52pvqWvX3vuP0rsCd3PmVyQA+ZGFmu/txTA+DoOanIszyeOSV/BEfFT7WXoXGpK MGHmBehFyqgTKZZ/ko+O2Ie9poX0QeVD7usPVziMYhF/DuAg X-Developer-Key: i=u.kleine-koenig@pengutronix.de; a=openpgp; fpr=0D2511F322BFAB1C1580266BE2DCDD9132669BD6 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.ext.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-media@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@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 (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 --- drivers/media/platform/nxp/imx-jpeg/mxc-jpeg.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/media/platform/nxp/imx-jpeg/mxc-jpeg.c b/drivers/media/platform/nxp/imx-jpeg/mxc-jpeg.c index f085f14d676a..4dd404d69c4e 100644 --- a/drivers/media/platform/nxp/imx-jpeg/mxc-jpeg.c +++ b/drivers/media/platform/nxp/imx-jpeg/mxc-jpeg.c @@ -2622,7 +2622,7 @@ static const struct dev_pm_ops mxc_jpeg_pm_ops = { SET_SYSTEM_SLEEP_PM_OPS(mxc_jpeg_suspend, mxc_jpeg_resume) }; -static int mxc_jpeg_remove(struct platform_device *pdev) +static void mxc_jpeg_remove(struct platform_device *pdev) { unsigned int slot; struct mxc_jpeg_dev *jpeg = platform_get_drvdata(pdev); @@ -2635,15 +2635,13 @@ static int mxc_jpeg_remove(struct platform_device *pdev) v4l2_m2m_release(jpeg->m2m_dev); v4l2_device_unregister(&jpeg->v4l2_dev); mxc_jpeg_detach_pm_domains(jpeg); - - return 0; } MODULE_DEVICE_TABLE(of, mxc_jpeg_match); static struct platform_driver mxc_jpeg_driver = { .probe = mxc_jpeg_probe, - .remove = mxc_jpeg_remove, + .remove_new = mxc_jpeg_remove, .driver = { .name = "mxc-jpeg", .of_match_table = mxc_jpeg_match, From patchwork Sun Mar 26 14:31:05 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= X-Patchwork-Id: 13188173 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 69D1EC6FD1C for ; Sun, 26 Mar 2023 14:33:29 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232435AbjCZOd1 (ORCPT ); Sun, 26 Mar 2023 10:33:27 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60334 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232406AbjCZOcr (ORCPT ); Sun, 26 Mar 2023 10:32:47 -0400 Received: from metis.ext.pengutronix.de (metis.ext.pengutronix.de [IPv6:2001:67c:670:201:290:27ff:fe1d:cc33]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id EEC527ABF for ; Sun, 26 Mar 2023 07:32:45 -0700 (PDT) Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.ext.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pgRQD-000852-3S; Sun, 26 Mar 2023 16:32:37 +0200 Received: from [2a0a:edc0:0:900:1d::77] (helo=ptz.office.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtp (Exim 4.94.2) (envelope-from ) id 1pgRQA-006rbi-Ml; Sun, 26 Mar 2023 16:32:34 +0200 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1pgRQ9-0088WC-Oi; Sun, 26 Mar 2023 16:32:33 +0200 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Rui Miguel Silva , Laurent Pinchart , Mauro Carvalho Chehab , Shawn Guo , Sascha Hauer Cc: Fabio Estevam , NXP Linux Team , linux-media@vger.kernel.org, linux-arm-kernel@lists.infradead.org, kernel@pengutronix.de Subject: [PATCH 038/117] media: imx-mipi-csis: Convert to platform remove callback returning void Date: Sun, 26 Mar 2023 16:31:05 +0200 Message-Id: <20230326143224.572654-41-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230326143224.572654-1-u.kleine-koenig@pengutronix.de> References: <20230326143224.572654-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1943; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=g9vpE9AZ9skiilxNFIWrdmlq9kjJ2H01iBx38QX6sjM=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBkIFa0ZmH/OORjShWZ6729b1/os/FQJ7mcBVvHa TixsF4hCD+JATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZCBWtAAKCRCPgPtYfRL+ TqI/B/9sOhnR0PJ8q+h1kKuiOTesOhoJzFkzg2yMAVElAtctGh5I3d3Crgu9Hu3dAIcLhKtrT3H DRSBa5kXyKKLMkCKmPre23JpE4zHLvNS3GCaT2c4JXMsj1gPe0ku/y1iSo0ptobDmv8XRsEvlS7 IX+Po4xY56NPmGfyUSxh0x3Mwr7mq5C2DM/Ii/gqjNvxtihGAWjN/XXNOqSkK60Owp6Z1QNyc3A gD7S4VG2vuyJNYaCtAHj1s5G/4jLVrGfeQfhmXpQ50k3i2sPJYnvRfxInZjTgSk8LFqBogulQrs LUnz/74mHB5YbWXJTJ+ZblpQCyPCqQ3sHmfK+hIVn3IEs9ap X-Developer-Key: i=u.kleine-koenig@pengutronix.de; a=openpgp; fpr=0D2511F322BFAB1C1580266BE2DCDD9132669BD6 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.ext.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-media@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@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 (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 --- drivers/media/platform/nxp/imx-mipi-csis.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/media/platform/nxp/imx-mipi-csis.c b/drivers/media/platform/nxp/imx-mipi-csis.c index be2768a47995..05d52762e792 100644 --- a/drivers/media/platform/nxp/imx-mipi-csis.c +++ b/drivers/media/platform/nxp/imx-mipi-csis.c @@ -1503,7 +1503,7 @@ static int mipi_csis_probe(struct platform_device *pdev) return ret; } -static int mipi_csis_remove(struct platform_device *pdev) +static void mipi_csis_remove(struct platform_device *pdev) { struct v4l2_subdev *sd = platform_get_drvdata(pdev); struct mipi_csis_device *csis = sd_to_mipi_csis_device(sd); @@ -1520,8 +1520,6 @@ static int mipi_csis_remove(struct platform_device *pdev) media_entity_cleanup(&csis->sd.entity); fwnode_handle_put(csis->sd.fwnode); pm_runtime_set_suspended(&pdev->dev); - - return 0; } static const struct of_device_id mipi_csis_of_match[] = { @@ -1544,7 +1542,7 @@ MODULE_DEVICE_TABLE(of, mipi_csis_of_match); static struct platform_driver mipi_csis_driver = { .probe = mipi_csis_probe, - .remove = mipi_csis_remove, + .remove_new = mipi_csis_remove, .driver = { .of_match_table = mipi_csis_of_match, .name = CSIS_DRIVER_NAME, From patchwork Sun Mar 26 14:31:06 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= X-Patchwork-Id: 13188175 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 39EC4C74A5B for ; Sun, 26 Mar 2023 14:33:31 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231834AbjCZOda (ORCPT ); Sun, 26 Mar 2023 10:33:30 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60384 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232429AbjCZOcr (ORCPT ); Sun, 26 Mar 2023 10:32:47 -0400 Received: from metis.ext.pengutronix.de (metis.ext.pengutronix.de [IPv6:2001:67c:670:201:290:27ff:fe1d:cc33]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id EECF77DA9 for ; Sun, 26 Mar 2023 07:32:45 -0700 (PDT) Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.ext.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pgRQD-00087U-ID; Sun, 26 Mar 2023 16:32:37 +0200 Received: from [2a0a:edc0:0:900:1d::77] (helo=ptz.office.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtp (Exim 4.94.2) (envelope-from ) id 1pgRQB-006rbp-6w; Sun, 26 Mar 2023 16:32:35 +0200 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1pgRQ9-0088WH-Vn; Sun, 26 Mar 2023 16:32:33 +0200 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Philipp Zabel , Mauro Carvalho Chehab , Shawn Guo , Sascha Hauer Cc: Fabio Estevam , NXP Linux Team , linux-media@vger.kernel.org, linux-arm-kernel@lists.infradead.org, kernel@pengutronix.de Subject: [PATCH 039/117] media: imx-pxp: Convert to platform remove callback returning void Date: Sun, 26 Mar 2023 16:31:06 +0200 Message-Id: <20230326143224.572654-42-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230326143224.572654-1-u.kleine-koenig@pengutronix.de> References: <20230326143224.572654-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1769; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=mVUQPhy61vCRwq0BXxL+2o+PGJnktd/oNm3ktQgT7jo=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBkIFa1voPinyhetmZyrYhk5xNO3LTQw0NaMqqMc MvXsoUY2ziJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZCBWtQAKCRCPgPtYfRL+ TlABB/4za/6ou3sGTJIz2Ml7ZJC6i7yqbn2lFL3XaxUEuPBy96zgCfOFHc4SgR92m+XpcxCRpK3 RjTtGO5wCYUtyf2/1Gr/8q2xGKwiFEMknITYuOO0xyPskA4bOtSvXxNNyuKb5JgU5BWb6UDfQ0a v41wSUhJkmgFFHreg1+LZq3dq77L0ygdCCcrZiIh4AWmcvT5HhjJ45YYwnasMihmPOXuc5lGNyd zyGH2eE/Udb9UHoQwiMgqo1gkZfqH0jiIoPwiiOjIVUFGT8m+WbpXQbdgLpzGa7bZRViRehs37v Qe+Eyes9NLoFwN2Llzzp4eIqhspTU0p+DQRbAzYLaFLv3fsV X-Developer-Key: i=u.kleine-koenig@pengutronix.de; a=openpgp; fpr=0D2511F322BFAB1C1580266BE2DCDD9132669BD6 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.ext.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-media@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@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 (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 --- drivers/media/platform/nxp/imx-pxp.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/media/platform/nxp/imx-pxp.c b/drivers/media/platform/nxp/imx-pxp.c index fde3c36e5e1d..90f319857c23 100644 --- a/drivers/media/platform/nxp/imx-pxp.c +++ b/drivers/media/platform/nxp/imx-pxp.c @@ -1904,7 +1904,7 @@ static int pxp_probe(struct platform_device *pdev) return ret; } -static int pxp_remove(struct platform_device *pdev) +static void pxp_remove(struct platform_device *pdev) { struct pxp_dev *dev = platform_get_drvdata(pdev); @@ -1922,8 +1922,6 @@ static int pxp_remove(struct platform_device *pdev) video_unregister_device(&dev->vfd); v4l2_m2m_release(dev->m2m_dev); v4l2_device_unregister(&dev->v4l2_dev); - - return 0; } static const struct pxp_pdata pxp_imx6ull_pdata = { @@ -1943,7 +1941,7 @@ MODULE_DEVICE_TABLE(of, pxp_dt_ids); static struct platform_driver pxp_driver = { .probe = pxp_probe, - .remove = pxp_remove, + .remove_new = pxp_remove, .driver = { .name = MEM2MEM_NAME, .of_match_table = pxp_dt_ids, From patchwork Sun Mar 26 14:31:07 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= X-Patchwork-Id: 13188176 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 65CE2C77B61 for ; Sun, 26 Mar 2023 14:33:32 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232437AbjCZOdb (ORCPT ); Sun, 26 Mar 2023 10:33:31 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60622 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232439AbjCZOcr (ORCPT ); Sun, 26 Mar 2023 10:32:47 -0400 Received: from metis.ext.pengutronix.de (metis.ext.pengutronix.de [IPv6:2001:67c:670:201:290:27ff:fe1d:cc33]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4FB09658D for ; Sun, 26 Mar 2023 07:32:46 -0700 (PDT) Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.ext.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pgRQD-000881-7r; Sun, 26 Mar 2023 16:32:37 +0200 Received: from [2a0a:edc0:0:900:1d::77] (helo=ptz.office.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtp (Exim 4.94.2) (envelope-from ) id 1pgRQB-006rbr-8u; Sun, 26 Mar 2023 16:32:35 +0200 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1pgRQA-0088WL-6M; Sun, 26 Mar 2023 16:32:34 +0200 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Rui Miguel Silva , Laurent Pinchart , Mauro Carvalho Chehab , Shawn Guo , Sascha Hauer Cc: Fabio Estevam , NXP Linux Team , linux-media@vger.kernel.org, linux-arm-kernel@lists.infradead.org, kernel@pengutronix.de Subject: [PATCH 040/117] media: imx7-media-csi: Convert to platform remove callback returning void Date: Sun, 26 Mar 2023 16:31:07 +0200 Message-Id: <20230326143224.572654-43-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230326143224.572654-1-u.kleine-koenig@pengutronix.de> References: <20230326143224.572654-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1872; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=EHmAwc5CElaBSZ9+9vvkD8ZZISHGW5Ahfuivx7WO49o=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBkIFa3mYsOeikmiEQJFYElae3MsqEYG79iYj63C k/2Ws7tE5GJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZCBWtwAKCRCPgPtYfRL+ TjmWCACxbtRyWoIHYdRH3oYsHH0xdyTykhvFUJu1F2lgLMHQ5pr9RId81ZIiUEK0sExyUHDSTdz wat7oLBXD1h27mAF83033mbgBntCtd+1wcP06ArIjGQrZAg2avxkq3UJObHAvrPaqXp58pwwkNQ tek9veBau8pLnfvlbc/2GevfDv9HHeFQmleQ0rBSD1VpHcZsACbtOlpHAA5aoFzeiKxUfLER7a1 VTiY9EO0lzL1mR5JIaHZflnQgPu9Mrsl3a8RjcBFS3CaA2PqKGRdzlOhiVqQ/apPZnGfHAFi1sw Yuk2jKwl9flNaB11vIGLu111LMHNmbZH10LFr5FzYijJNoHk X-Developer-Key: i=u.kleine-koenig@pengutronix.de; a=openpgp; fpr=0D2511F322BFAB1C1580266BE2DCDD9132669BD6 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.ext.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-media@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@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 (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 --- drivers/media/platform/nxp/imx7-media-csi.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/media/platform/nxp/imx7-media-csi.c b/drivers/media/platform/nxp/imx7-media-csi.c index c22bf5c827e7..9ee46c17bd02 100644 --- a/drivers/media/platform/nxp/imx7-media-csi.c +++ b/drivers/media/platform/nxp/imx7-media-csi.c @@ -2278,7 +2278,7 @@ static int imx7_csi_probe(struct platform_device *pdev) return ret; } -static int imx7_csi_remove(struct platform_device *pdev) +static void imx7_csi_remove(struct platform_device *pdev) { struct imx7_csi *csi = platform_get_drvdata(pdev); @@ -2287,8 +2287,6 @@ static int imx7_csi_remove(struct platform_device *pdev) v4l2_async_nf_unregister(&csi->notifier); v4l2_async_nf_cleanup(&csi->notifier); v4l2_async_unregister_subdev(&csi->sd); - - return 0; } static const struct of_device_id imx7_csi_of_match[] = { @@ -2301,7 +2299,7 @@ MODULE_DEVICE_TABLE(of, imx7_csi_of_match); static struct platform_driver imx7_csi_driver = { .probe = imx7_csi_probe, - .remove = imx7_csi_remove, + .remove_new = imx7_csi_remove, .driver = { .of_match_table = imx7_csi_of_match, .name = "imx7-csi", From patchwork Sun Mar 26 14:31:08 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= X-Patchwork-Id: 13188172 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 9A1ADC761AF for ; Sun, 26 Mar 2023 14:33:27 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232002AbjCZOdZ (ORCPT ); Sun, 26 Mar 2023 10:33:25 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60336 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232437AbjCZOcr (ORCPT ); Sun, 26 Mar 2023 10:32:47 -0400 Received: from metis.ext.pengutronix.de (metis.ext.pengutronix.de [IPv6:2001:67c:670:201:290:27ff:fe1d:cc33]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9EDA07D84 for ; Sun, 26 Mar 2023 07:32:45 -0700 (PDT) Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.ext.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pgRQD-00089h-P3; Sun, 26 Mar 2023 16:32:37 +0200 Received: from [2a0a:edc0:0:900:1d::77] (helo=ptz.office.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtp (Exim 4.94.2) (envelope-from ) id 1pgRQB-006rc1-LJ; Sun, 26 Mar 2023 16:32:35 +0200 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1pgRQA-0088WP-CZ; Sun, 26 Mar 2023 16:32:34 +0200 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Mauro Carvalho Chehab , =?utf-8?q?Uwe_Kleine-K=C3=B6?= =?utf-8?q?nig?= Cc: linux-media@vger.kernel.org, kernel@pengutronix.de Subject: [PATCH 041/117] media: mx2_emmaprp: Convert to platform remove callback returning void Date: Sun, 26 Mar 2023 16:31:08 +0200 Message-Id: <20230326143224.572654-44-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230326143224.572654-1-u.kleine-koenig@pengutronix.de> References: <20230326143224.572654-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1680; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=TcgSvyXz30JD9Fu92pOx8XV/iV3Tk0/AitEz0iTvp8c=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBkIFa4So/HuY3eI/Ohv8pGTB1onYDGIBgslCQt0 HlmIHp1yCuJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZCBWuAAKCRCPgPtYfRL+ TldfCAC6S2LWDJNYqtcZKMPejYK7vvUv+9Dgnmovcor7j+0ufpThZuCHjGGOwAB7RyEbbkZmRL0 NtNG+RhtBc6bnxpCudQUV1aRMfL+JUtfiHimx69Tl6ess080hQsPVwK6bQkpoa1b5VifAzxGCRs HaEPYCXirnMLAjAy0ToBDlatqo2GDjYoaBQnpNlnqLr1sQhQ5pTZrRgHWnV8vkv/0GKinnQPdlf +Jy84DlKDBFYAFfBke0X6+xyJAcwYPfY/vkb9L9mGPiaPfK9M3prH0ZNMR66ux8PzSgLsV6IR1b BWV0Dwv06ve64M7nYjOhb3XuOThzMnK0l4BQphY98zMjHfpV X-Developer-Key: i=u.kleine-koenig@pengutronix.de; a=openpgp; fpr=0D2511F322BFAB1C1580266BE2DCDD9132669BD6 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.ext.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-media@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@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 (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 --- drivers/media/platform/nxp/mx2_emmaprp.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/media/platform/nxp/mx2_emmaprp.c b/drivers/media/platform/nxp/mx2_emmaprp.c index 3ce84d0f078c..023ed40c6b08 100644 --- a/drivers/media/platform/nxp/mx2_emmaprp.c +++ b/drivers/media/platform/nxp/mx2_emmaprp.c @@ -888,7 +888,7 @@ static int emmaprp_probe(struct platform_device *pdev) return ret; } -static int emmaprp_remove(struct platform_device *pdev) +static void emmaprp_remove(struct platform_device *pdev) { struct emmaprp_dev *pcdev = platform_get_drvdata(pdev); @@ -898,13 +898,11 @@ static int emmaprp_remove(struct platform_device *pdev) v4l2_m2m_release(pcdev->m2m_dev); v4l2_device_unregister(&pcdev->v4l2_dev); mutex_destroy(&pcdev->dev_mutex); - - return 0; } static struct platform_driver emmaprp_pdrv = { .probe = emmaprp_probe, - .remove = emmaprp_remove, + .remove_new = emmaprp_remove, .driver = { .name = MEM2MEM_NAME, }, From patchwork Sun Mar 26 14:31:09 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= X-Patchwork-Id: 13188182 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 231EAC6FD1C for ; Sun, 26 Mar 2023 14:33:38 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232574AbjCZOdh (ORCPT ); Sun, 26 Mar 2023 10:33:37 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60384 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231740AbjCZOcu (ORCPT ); Sun, 26 Mar 2023 10:32:50 -0400 Received: from metis.ext.pengutronix.de (metis.ext.pengutronix.de [IPv6:2001:67c:670:201:290:27ff:fe1d:cc33]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id EC2316A69 for ; Sun, 26 Mar 2023 07:32:48 -0700 (PDT) Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.ext.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pgRQD-000883-CG; Sun, 26 Mar 2023 16:32:37 +0200 Received: from [2a0a:edc0:0:900:1d::77] (helo=ptz.office.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtp (Exim 4.94.2) (envelope-from ) id 1pgRQB-006rbt-9w; Sun, 26 Mar 2023 16:32:35 +0200 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1pgRQA-0088WT-JO; Sun, 26 Mar 2023 16:32:34 +0200 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Robert Foss , Todor Tomov , Andy Gross , Bjorn Andersson , Mauro Carvalho Chehab Cc: Konrad Dybcio , linux-media@vger.kernel.org, linux-arm-msm@vger.kernel.org, kernel@pengutronix.de Subject: [PATCH 042/117] media: camss: Convert to platform remove callback returning void Date: Sun, 26 Mar 2023 16:31:09 +0200 Message-Id: <20230326143224.572654-45-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230326143224.572654-1-u.kleine-koenig@pengutronix.de> References: <20230326143224.572654-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1782; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=5+233wKbFI0nY/Rw2BqkK/JcpAndlkw8WmqScaqNEvo=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBkIFa56BHcFMWxG95LEaTIhTYmvbipS2cJOM4tq h+jmB4Rj8OJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZCBWuQAKCRCPgPtYfRL+ To2hB/4/HaXTqiAE/6bJk3JeUAywJ/RKf9KuKjMFtM/8Sq1SnaC3aWMOdvrXpbOXzF5vV+68C+7 +3a8dPSkwHIbD5CRuguN+B/zPVElF1R/6BUaJX5OdM09nKH/wPLnXxFHXDPdxWzSWAdf9Dv3MWZ 1M8jXEGgP8/tVFayO8n6THkb1Z8scZMMpdAkkAgaPE7CLb+WCkAIXunQ75W7A5oLrz14A03DUky 59beUId/6lXathw/yvh1z3gPQcCgt4Qc2TnyQttmfnDA6rsPDD3L+hy7zoMfIX9iE156EZfonum V0/qlf5bjYtfyJJ7RsbrIWsOpyfv5pUjh3beswHt7296btM8 X-Developer-Key: i=u.kleine-koenig@pengutronix.de; a=openpgp; fpr=0D2511F322BFAB1C1580266BE2DCDD9132669BD6 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.ext.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-media@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@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 (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 Reviewed-by: Konrad Dybcio --- drivers/media/platform/qcom/camss/camss.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/media/platform/qcom/camss/camss.c b/drivers/media/platform/qcom/camss/camss.c index 9cda284f1e71..df8a507ce8ac 100644 --- a/drivers/media/platform/qcom/camss/camss.c +++ b/drivers/media/platform/qcom/camss/camss.c @@ -1725,7 +1725,7 @@ void camss_delete(struct camss *camss) * * Always returns 0. */ -static int camss_remove(struct platform_device *pdev) +static void camss_remove(struct platform_device *pdev) { struct camss *camss = platform_get_drvdata(pdev); @@ -1735,8 +1735,6 @@ static int camss_remove(struct platform_device *pdev) if (atomic_read(&camss->ref_count) == 0) camss_delete(camss); - - return 0; } static const struct of_device_id camss_dt_match[] = { @@ -1798,7 +1796,7 @@ static const struct dev_pm_ops camss_pm_ops = { static struct platform_driver qcom_camss_driver = { .probe = camss_probe, - .remove = camss_remove, + .remove_new = camss_remove, .driver = { .name = "qcom-camss", .of_match_table = camss_dt_match, From patchwork Sun Mar 26 14:31:10 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= X-Patchwork-Id: 13188215 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 1E71CC77B62 for ; Sun, 26 Mar 2023 14:33:50 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232177AbjCZOdt (ORCPT ); Sun, 26 Mar 2023 10:33:49 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60348 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232323AbjCZOcy (ORCPT ); Sun, 26 Mar 2023 10:32:54 -0400 Received: from metis.ext.pengutronix.de (metis.ext.pengutronix.de [IPv6:2001:67c:670:201:290:27ff:fe1d:cc33]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C4B4A7DA4 for ; Sun, 26 Mar 2023 07:32:51 -0700 (PDT) Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.ext.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pgRQF-0008DU-0f; Sun, 26 Mar 2023 16:32:39 +0200 Received: from [2a0a:edc0:0:900:1d::77] (helo=ptz.office.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtp (Exim 4.94.2) (envelope-from ) id 1pgRQC-006rcB-FA; Sun, 26 Mar 2023 16:32:36 +0200 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1pgRQA-0088WY-RK; Sun, 26 Mar 2023 16:32:34 +0200 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Stanimir Varbanov , Vikash Garodia , Andy Gross , Bjorn Andersson , Mauro Carvalho Chehab Cc: Konrad Dybcio , linux-media@vger.kernel.org, linux-arm-msm@vger.kernel.org, kernel@pengutronix.de Subject: [PATCH 043/117] media: venus: Warn only once about problems in .remove() Date: Sun, 26 Mar 2023 16:31:10 +0200 Message-Id: <20230326143224.572654-46-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230326143224.572654-1-u.kleine-koenig@pengutronix.de> References: <20230326143224.572654-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=933; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=IHYTjjRoO1Dj9jBho/XeAemeh3UuJlqKxsJQQ74d7gg=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBkIFa60NwlkPOoWfthIuMks/fTpIeXdYABrvbzv 0ohELhRjkGJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZCBWugAKCRCPgPtYfRL+ TiuJB/425F906SreRIHRCM/qH2XlnDEOKiPIoNFmdWBORbu2QLMvd3WZPem2kI1brt+ufUGfInd Tit+xK3PZ6oblLDvYo+jIalJHmyfOliin+6YQ6jAXvd0vcxnEEdA8V53tUAa6eqt7wa3W42kRs5 K2p2NHxV/1Fy3ev7X94EQELQGUm4iDjn9gIneo2fcXuYVFAa/wQSTIDX41PE8UqjB8nna8l0sYM oBGBRXI+0OxtdyRHtj1iKez+YnsdluUM0vMQ72xV8kxvzPLct5SiQNx8Ccb3bTdtrJ7TKNaw3XO IKfh+SVHt3RQhtu1PGeScp65LcTF1uE0I1AmSJChdC20UK15 X-Developer-Key: i=u.kleine-koenig@pengutronix.de; a=openpgp; fpr=0D2511F322BFAB1C1580266BE2DCDD9132669BD6 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.ext.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-media@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org The only effect of returning an error code in a remove callback is that the driver core emits a warning. The device is unbound anyhow. As the remove callback already emits a (quite verbose) warning when ret is non-zero, return zero to suppress the additional warning. Signed-off-by: Uwe Kleine-König Reviewed-by: Konrad Dybcio --- drivers/media/platform/qcom/venus/core.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/media/platform/qcom/venus/core.c b/drivers/media/platform/qcom/venus/core.c index 990a1519f968..403ffb92af60 100644 --- a/drivers/media/platform/qcom/venus/core.c +++ b/drivers/media/platform/qcom/venus/core.c @@ -448,7 +448,7 @@ static int venus_remove(struct platform_device *pdev) mutex_destroy(&core->lock); venus_dbgfs_deinit(core); - return ret; + return 0; } static void venus_core_shutdown(struct platform_device *pdev) From patchwork Sun Mar 26 14:31:11 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= X-Patchwork-Id: 13188184 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id CAE59C77B61 for ; Sun, 26 Mar 2023 14:33:39 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232578AbjCZOdj (ORCPT ); Sun, 26 Mar 2023 10:33:39 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60670 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232465AbjCZOcv (ORCPT ); Sun, 26 Mar 2023 10:32:51 -0400 Received: from metis.ext.pengutronix.de (metis.ext.pengutronix.de [IPv6:2001:67c:670:201:290:27ff:fe1d:cc33]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B08B17D8C for ; Sun, 26 Mar 2023 07:32:49 -0700 (PDT) Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.ext.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pgRQF-0008Dd-2a; Sun, 26 Mar 2023 16:32:39 +0200 Received: from [2a0a:edc0:0:900:1d::77] (helo=ptz.office.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtp (Exim 4.94.2) (envelope-from ) id 1pgRQC-006rcC-Fn; Sun, 26 Mar 2023 16:32:36 +0200 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1pgRQB-0088Wb-1t; Sun, 26 Mar 2023 16:32:35 +0200 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Stanimir Varbanov , Vikash Garodia , Andy Gross , Bjorn Andersson , Mauro Carvalho Chehab Cc: Konrad Dybcio , linux-media@vger.kernel.org, linux-arm-msm@vger.kernel.org, kernel@pengutronix.de Subject: [PATCH 044/117] media: venus: Convert to platform remove callback returning void Date: Sun, 26 Mar 2023 16:31:11 +0200 Message-Id: <20230326143224.572654-47-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230326143224.572654-1-u.kleine-koenig@pengutronix.de> References: <20230326143224.572654-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1850; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=ph85ZOcYCUw+0oWI/YAseTqjEMO65pC6gI1xrpySm34=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBkIFa7N46eaarZ3UptCgyg1IH71NGjTddZ/Ym33 mQjZkAomuiJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZCBWuwAKCRCPgPtYfRL+ TrqdB/90HeO+NrGMq7e7pJASH/PaCtSF9yl01fhDhApdEbmpfvg9h7x2Zq1x1JI6l7MfedvnfAW 9niCmVe0MAs9c1IyA+yELIqyPimvZEft+LGfFA8va3v0LE4PIMhCOcDD2YcaRgiBvwovas6CbVf LrApHDY7Mf0JlnTRiPx4VYWdWbCqmodT3lPv/MFQ0JTwE0TdEyQXwyO+LU4TJZSmRS6V3G76Kd9 KfzyN4K7w2KuqaJG4WTY8sSimVMl8qXXBRwMCDVTc8qpUV7ifvS1wMRk+zT+xQJh5uVCNQPbx9U fcisV5sFjCm8Qv5drmREJ1ixRWNOdUIwz0wliuRdO9PIAyby X-Developer-Key: i=u.kleine-koenig@pengutronix.de; a=openpgp; fpr=0D2511F322BFAB1C1580266BE2DCDD9132669BD6 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.ext.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-media@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@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 (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 Reviewed-by: Konrad Dybcio --- drivers/media/platform/qcom/venus/core.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/media/platform/qcom/venus/core.c b/drivers/media/platform/qcom/venus/core.c index 403ffb92af60..2ae867cb4c48 100644 --- a/drivers/media/platform/qcom/venus/core.c +++ b/drivers/media/platform/qcom/venus/core.c @@ -416,7 +416,7 @@ static int venus_probe(struct platform_device *pdev) return ret; } -static int venus_remove(struct platform_device *pdev) +static void venus_remove(struct platform_device *pdev) { struct venus_core *core = platform_get_drvdata(pdev); const struct venus_pm_ops *pm_ops = core->pm_ops; @@ -447,8 +447,6 @@ static int venus_remove(struct platform_device *pdev) mutex_destroy(&core->pm_lock); mutex_destroy(&core->lock); venus_dbgfs_deinit(core); - - return 0; } static void venus_core_shutdown(struct platform_device *pdev) @@ -891,7 +889,7 @@ MODULE_DEVICE_TABLE(of, venus_dt_match); static struct platform_driver qcom_venus_driver = { .probe = venus_probe, - .remove = venus_remove, + .remove_new = venus_remove, .driver = { .name = "qcom-venus", .of_match_table = venus_dt_match, From patchwork Sun Mar 26 14:31:12 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= X-Patchwork-Id: 13188211 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id DE71DC74A5B for ; Sun, 26 Mar 2023 14:33:45 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232584AbjCZOdo (ORCPT ); Sun, 26 Mar 2023 10:33:44 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:32768 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232477AbjCZOcx (ORCPT ); Sun, 26 Mar 2023 10:32:53 -0400 Received: from metis.ext.pengutronix.de (metis.ext.pengutronix.de [IPv6:2001:67c:670:201:290:27ff:fe1d:cc33]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9ECDC7AB6 for ; Sun, 26 Mar 2023 07:32:51 -0700 (PDT) Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.ext.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pgRQE-0008Dj-MD; Sun, 26 Mar 2023 16:32:38 +0200 Received: from [2a0a:edc0:0:900:1d::77] (helo=ptz.office.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtp (Exim 4.94.2) (envelope-from ) id 1pgRQC-006rcF-HN; Sun, 26 Mar 2023 16:32:36 +0200 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1pgRQB-0088We-96; Sun, 26 Mar 2023 16:32:35 +0200 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Stanimir Varbanov , Vikash Garodia , Andy Gross , Bjorn Andersson , Mauro Carvalho Chehab Cc: Konrad Dybcio , linux-media@vger.kernel.org, linux-arm-msm@vger.kernel.org, kernel@pengutronix.de Subject: [PATCH 045/117] media: vdec: Convert to platform remove callback returning void Date: Sun, 26 Mar 2023 16:31:12 +0200 Message-Id: <20230326143224.572654-48-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230326143224.572654-1-u.kleine-koenig@pengutronix.de> References: <20230326143224.572654-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1804; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=pJNzgnJ30EHiUzc/rqyhfA+TC1iTYhBrR+DTa0bHg48=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBkIFa9C9koq5OLF/ESdALEl/zRMwoCX5ePT1HQs P4j36rGXJCJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZCBWvQAKCRCPgPtYfRL+ TtpNCACp/23FthUg0CFYOG+R1MILQ0ULtf3l8oU9zVXkA9P90j5pnQpgW8JNDRLKtUcgRgqbPw4 F+2onLhRvmVC41rnMZ0Wdf+XpT83zSEzYVNYstQ4HWa3KHBd9BY3X5/+vRtfw4JTBjjKr9XdbiX 1sabflqFczhSdtl//kozaICMzcyYa4Xg67+rllu3JZ+7qGwGzvpu662d52BYgaUbOdfc/Ee0ezg kbhPlVs8LbQHbC8y3lc/Me8NmcVZfiATRcUF8mVr8QrOr9eHBr+5q6QPzbT3QdhCWeo1nYsTVvL y4UcykqByy8zp8C/ESAjxK5b0FWvpvcVkMcSyYKZFD/T4MBX X-Developer-Key: i=u.kleine-koenig@pengutronix.de; a=openpgp; fpr=0D2511F322BFAB1C1580266BE2DCDD9132669BD6 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.ext.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-media@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@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 (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 Reviewed-by: Konrad Dybcio --- drivers/media/platform/qcom/venus/vdec.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/media/platform/qcom/venus/vdec.c b/drivers/media/platform/qcom/venus/vdec.c index 4ceaba37e2e5..d47c22015770 100644 --- a/drivers/media/platform/qcom/venus/vdec.c +++ b/drivers/media/platform/qcom/venus/vdec.c @@ -1774,7 +1774,7 @@ static int vdec_probe(struct platform_device *pdev) return ret; } -static int vdec_remove(struct platform_device *pdev) +static void vdec_remove(struct platform_device *pdev) { struct venus_core *core = dev_get_drvdata(pdev->dev.parent); @@ -1783,8 +1783,6 @@ static int vdec_remove(struct platform_device *pdev) if (core->pm_ops->vdec_put) core->pm_ops->vdec_put(core->dev_dec); - - return 0; } static __maybe_unused int vdec_runtime_suspend(struct device *dev) @@ -1825,7 +1823,7 @@ MODULE_DEVICE_TABLE(of, vdec_dt_match); static struct platform_driver qcom_venus_dec_driver = { .probe = vdec_probe, - .remove = vdec_remove, + .remove_new = vdec_remove, .driver = { .name = "qcom-venus-decoder", .of_match_table = vdec_dt_match, From patchwork Sun Mar 26 14:31:13 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= X-Patchwork-Id: 13188187 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 1EF4DC6FD1C for ; Sun, 26 Mar 2023 14:33:43 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232577AbjCZOdl (ORCPT ); Sun, 26 Mar 2023 10:33:41 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60602 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232475AbjCZOcw (ORCPT ); Sun, 26 Mar 2023 10:32:52 -0400 Received: from metis.ext.pengutronix.de (metis.ext.pengutronix.de [IPv6:2001:67c:670:201:290:27ff:fe1d:cc33]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5E8A47EC1 for ; Sun, 26 Mar 2023 07:32:50 -0700 (PDT) Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.ext.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pgRQF-0008Ds-2t; Sun, 26 Mar 2023 16:32:39 +0200 Received: from [2a0a:edc0:0:900:1d::77] (helo=ptz.office.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtp (Exim 4.94.2) (envelope-from ) id 1pgRQC-006rcG-I2; Sun, 26 Mar 2023 16:32:36 +0200 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1pgRQB-0088Wk-F3; Sun, 26 Mar 2023 16:32:35 +0200 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Stanimir Varbanov , Vikash Garodia , Andy Gross , Bjorn Andersson , Mauro Carvalho Chehab Cc: Konrad Dybcio , linux-media@vger.kernel.org, linux-arm-msm@vger.kernel.org, kernel@pengutronix.de Subject: [PATCH 046/117] media: venc: Convert to platform remove callback returning void Date: Sun, 26 Mar 2023 16:31:13 +0200 Message-Id: <20230326143224.572654-49-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230326143224.572654-1-u.kleine-koenig@pengutronix.de> References: <20230326143224.572654-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1804; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=hwSaE/8xK5uDZSiLTTtZlCVtdlhltZuM7HPsqGQ9Uf4=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBkIFa+uxorUIQpjqZN3S9rqhNDmr3xDFDC5H+f4 J9shvHrsPWJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZCBWvgAKCRCPgPtYfRL+ Tn+yCACq2oQqKASPlvz22ANabMKMAXSr7B65CS1U9LTwKXjTBq79XIZEXvC8VR4Djdon1bBVxax 4WCWGLplC9aLPujPNVeqMa1UdqBbmbNUzL9DzbmQE43Ij0SiFFlc5YH2ZnSH6QXyUFWfQlnvH7Z oQeUbi4r4MppzYy2XOjcpsHVIT9u3hgFQqAnzjpyWmR/pluqblYPu8DUw2yCpSFiasn5WWg310K i7R0naRJwQ6+n6Dtk39ah1nmc9NDyjrI75RskO9MQoy7aRPkSSYlxP/BSRFf+gsfG7j/VCBtGu8 9KN3yQscinsL3cAXqYeFk7MX2puW2VpCE7wg+kya1yP36dHP X-Developer-Key: i=u.kleine-koenig@pengutronix.de; a=openpgp; fpr=0D2511F322BFAB1C1580266BE2DCDD9132669BD6 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.ext.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-media@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@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 (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 Reviewed-by: Konrad Dybcio --- drivers/media/platform/qcom/venus/venc.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/media/platform/qcom/venus/venc.c b/drivers/media/platform/qcom/venus/venc.c index cdb12546c4fa..6d61614656a5 100644 --- a/drivers/media/platform/qcom/venus/venc.c +++ b/drivers/media/platform/qcom/venus/venc.c @@ -1492,7 +1492,7 @@ static int venc_probe(struct platform_device *pdev) return ret; } -static int venc_remove(struct platform_device *pdev) +static void venc_remove(struct platform_device *pdev) { struct venus_core *core = dev_get_drvdata(pdev->dev.parent); @@ -1501,8 +1501,6 @@ static int venc_remove(struct platform_device *pdev) if (core->pm_ops->venc_put) core->pm_ops->venc_put(core->dev_enc); - - return 0; } static __maybe_unused int venc_runtime_suspend(struct device *dev) @@ -1543,7 +1541,7 @@ MODULE_DEVICE_TABLE(of, venc_dt_match); static struct platform_driver qcom_venus_enc_driver = { .probe = venc_probe, - .remove = venc_remove, + .remove_new = venc_remove, .driver = { .name = "qcom-venus-encoder", .of_match_table = venc_dt_match, From patchwork Sun Mar 26 14:31:14 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= X-Patchwork-Id: 13188164 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id DF6BCC74A5B for ; Sun, 26 Mar 2023 14:33:18 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232569AbjCZOdR (ORCPT ); Sun, 26 Mar 2023 10:33:17 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60348 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232354AbjCZOcp (ORCPT ); Sun, 26 Mar 2023 10:32:45 -0400 Received: from metis.ext.pengutronix.de (metis.ext.pengutronix.de [IPv6:2001:67c:670:201:290:27ff:fe1d:cc33]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3EB4B7ABE for ; Sun, 26 Mar 2023 07:32:44 -0700 (PDT) Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.ext.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pgRQF-0008Hp-SW; Sun, 26 Mar 2023 16:32:39 +0200 Received: from [2a0a:edc0:0:900:1d::77] (helo=ptz.office.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtp (Exim 4.94.2) (envelope-from ) id 1pgRQD-006rcb-F0; Sun, 26 Mar 2023 16:32:37 +0200 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1pgRQB-0088Wn-PH; Sun, 26 Mar 2023 16:32:35 +0200 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Laurent Pinchart , Mauro Carvalho Chehab Cc: linux-media@vger.kernel.org, linux-renesas-soc@vger.kernel.org, kernel@pengutronix.de Subject: [PATCH 047/117] media: rcar-fcp: Convert to platform remove callback returning void Date: Sun, 26 Mar 2023 16:31:14 +0200 Message-Id: <20230326143224.572654-50-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230326143224.572654-1-u.kleine-koenig@pengutronix.de> References: <20230326143224.572654-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1809; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=HOnp3fnDdiAtu7mHXeRwe9TTiGOr9s+ukY2fTy4ZTHQ=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBkIFa/vEI9nBE95QuR5cH6f2HZre7YZAMERty65 1pd7vHi6LuJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZCBWvwAKCRCPgPtYfRL+ TiguB/4yBR0TtvQip2NJtIemL1cL+qLnjmfJqNI4o19veEIdOkNqVIWw1qlJ4KzZwUN5SQC3CBX 681lfq3cr2F1/dl1Q9/J5d1A/uGPEohkjSfGKIwkpNkCQeTjIGBhD5FwgDoqe6YbdR4pMJJyRnB WJD1hPakjGmgB00oIKYz8vnFBmdE77lak1/Nhmc1B3J8k+pz/WavsYZJXtImnNlKIzVs8xxdPbd 18Ita8YSdtxFU39yJlKnwn0a0hn+ZhlWvBNufy+RFW2tq+K40lF5J6o25GIengM/eu1fL6B4Axq FaN9iAodcVck+LrCNf64YIz1Xp1RrSFjWxYU2D9pcGJ1rYSk X-Developer-Key: i=u.kleine-koenig@pengutronix.de; a=openpgp; fpr=0D2511F322BFAB1C1580266BE2DCDD9132669BD6 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.ext.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-media@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@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 (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 Reviewed-by: Geert Uytterhoeven --- drivers/media/platform/renesas/rcar-fcp.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/media/platform/renesas/rcar-fcp.c b/drivers/media/platform/renesas/rcar-fcp.c index eb59a3ba6d0f..bcef7b87da7c 100644 --- a/drivers/media/platform/renesas/rcar-fcp.c +++ b/drivers/media/platform/renesas/rcar-fcp.c @@ -144,7 +144,7 @@ static int rcar_fcp_probe(struct platform_device *pdev) return 0; } -static int rcar_fcp_remove(struct platform_device *pdev) +static void rcar_fcp_remove(struct platform_device *pdev) { struct rcar_fcp_device *fcp = platform_get_drvdata(pdev); @@ -153,8 +153,6 @@ static int rcar_fcp_remove(struct platform_device *pdev) mutex_unlock(&fcp_lock); pm_runtime_disable(&pdev->dev); - - return 0; } static const struct of_device_id rcar_fcp_of_match[] = { @@ -166,7 +164,7 @@ MODULE_DEVICE_TABLE(of, rcar_fcp_of_match); static struct platform_driver rcar_fcp_platform_driver = { .probe = rcar_fcp_probe, - .remove = rcar_fcp_remove, + .remove_new = rcar_fcp_remove, .driver = { .name = "rcar-fcp", .of_match_table = rcar_fcp_of_match, From patchwork Sun Mar 26 14:31:15 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= X-Patchwork-Id: 13188167 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 9E2BCC74A5B for ; Sun, 26 Mar 2023 14:33:21 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232557AbjCZOdU (ORCPT ); Sun, 26 Mar 2023 10:33:20 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60334 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232432AbjCZOcq (ORCPT ); Sun, 26 Mar 2023 10:32:46 -0400 Received: from metis.ext.pengutronix.de (metis.ext.pengutronix.de [IPv6:2001:67c:670:201:290:27ff:fe1d:cc33]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id AC6BB7A80 for ; Sun, 26 Mar 2023 07:32:44 -0700 (PDT) Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.ext.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pgRQF-0008HU-Qh; Sun, 26 Mar 2023 16:32:39 +0200 Received: from [2a0a:edc0:0:900:1d::77] (helo=ptz.office.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtp (Exim 4.94.2) (envelope-from ) id 1pgRQD-006rcU-BR; Sun, 26 Mar 2023 16:32:37 +0200 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1pgRQB-0088Wr-VA; Sun, 26 Mar 2023 16:32:35 +0200 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: =?utf-8?q?Niklas_S=C3=B6derlund?= , Mauro Carvalho Chehab Cc: linux-media@vger.kernel.org, linux-renesas-soc@vger.kernel.org, kernel@pengutronix.de Subject: [PATCH 048/117] media: rcar-isp: Convert to platform remove callback returning void Date: Sun, 26 Mar 2023 16:31:15 +0200 Message-Id: <20230326143224.572654-51-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230326143224.572654-1-u.kleine-koenig@pengutronix.de> References: <20230326143224.572654-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1727; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=H9Xij91+DKvF0GTkIvcfnoR7RIAl5lpT4bjYw1+Gjos=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBkIFbAX2oI45PUtkLYtVUOoiHXyCd+iOyR7uw6+ ewMsqY0CamJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZCBWwAAKCRCPgPtYfRL+ TtWhB/4oYTKCPZNvN/lgdaue4UPzzDUOjxMt3d4N6SW967pr66irUwiKHHrSVd76YQjKl30CEJq KFaShNOMfUtNEX+GA6pi7V3KK3Gpek0IMStW5BZVnXGCT2Xx14frztX8GdGn0+f5AkezqWh37Hd TUcCRGCBeSS22UXkFuDfsWjFvt6n4GrcNSflBRhH36XP4qt7IdMS2k6UlGdzxMBRY2beEFj9aDy NsdhapSuMhUmEg1fUNrvZ8qskfIMd1sUVYCmWzaZzZT3/EQFBVUrAlRF9fD6QOMyO0FFlUUZLUA LoSZI2O2M+vGg9UzkFz5+X2Yqa7KgiHsv0lKa7Pi+/Z66IC3 X-Developer-Key: i=u.kleine-koenig@pengutronix.de; a=openpgp; fpr=0D2511F322BFAB1C1580266BE2DCDD9132669BD6 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.ext.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-media@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@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 (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 Reviewed-by: Geert Uytterhoeven Reviewed-by: Niklas Söderlund --- drivers/media/platform/renesas/rcar-isp.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/media/platform/renesas/rcar-isp.c b/drivers/media/platform/renesas/rcar-isp.c index 10b3474f93a4..27fe71931a04 100644 --- a/drivers/media/platform/renesas/rcar-isp.c +++ b/drivers/media/platform/renesas/rcar-isp.c @@ -503,7 +503,7 @@ static int risp_probe(struct platform_device *pdev) return ret; } -static int risp_remove(struct platform_device *pdev) +static void risp_remove(struct platform_device *pdev) { struct rcar_isp *isp = platform_get_drvdata(pdev); @@ -515,8 +515,6 @@ static int risp_remove(struct platform_device *pdev) pm_runtime_disable(&pdev->dev); mutex_destroy(&isp->lock); - - return 0; } static struct platform_driver rcar_isp_driver = { @@ -525,7 +523,7 @@ static struct platform_driver rcar_isp_driver = { .of_match_table = risp_of_id_table, }, .probe = risp_probe, - .remove = risp_remove, + .remove_new = risp_remove, }; module_platform_driver(rcar_isp_driver); From patchwork Sun Mar 26 14:31:16 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= X-Patchwork-Id: 13188166 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id C3975C77B61 for ; Sun, 26 Mar 2023 14:33:20 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232418AbjCZOdT (ORCPT ); Sun, 26 Mar 2023 10:33:19 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60368 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232405AbjCZOcp (ORCPT ); Sun, 26 Mar 2023 10:32:45 -0400 Received: from metis.ext.pengutronix.de (metis.ext.pengutronix.de [IPv6:2001:67c:670:201:290:27ff:fe1d:cc33]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3F3437D8C for ; Sun, 26 Mar 2023 07:32:44 -0700 (PDT) Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.ext.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pgRQF-0008HV-O5; Sun, 26 Mar 2023 16:32:39 +0200 Received: from [2a0a:edc0:0:900:1d::77] (helo=ptz.office.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtp (Exim 4.94.2) (envelope-from ) id 1pgRQD-006rcW-Cb; Sun, 26 Mar 2023 16:32:37 +0200 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1pgRQC-0088Wu-5A; Sun, 26 Mar 2023 16:32:36 +0200 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: =?utf-8?q?Niklas_S=C3=B6derlund?= , Mauro Carvalho Chehab Cc: linux-media@vger.kernel.org, linux-renesas-soc@vger.kernel.org, kernel@pengutronix.de Subject: [PATCH 049/117] media: rcar-core: Convert to platform remove callback returning void Date: Sun, 26 Mar 2023 16:31:16 +0200 Message-Id: <20230326143224.572654-52-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230326143224.572654-1-u.kleine-koenig@pengutronix.de> References: <20230326143224.572654-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1821; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=95eFlYcFS5rE4SExkOimIwf5tFvBzgFzhyqxLBhy9Is=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBkIFbBootwkPzYp0dHDwnmM9s0TK9ambTS6fbVT hrfQtVEAdqJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZCBWwQAKCRCPgPtYfRL+ TgkLCACYFPdUV7Ap/CvPFrD8z760nwgR3D2L+LvXZNMGzegLv32zNlO9WyFvfWhKBQG2afZ0JO9 Tz+J57MkWsmBTkE6wca4F7C0/QD42QOgxgas5x2kEmqHEJN3w7SXh36MqhpmjBPMLX7gMJBI0sw eat1X53sN3E/ij0SB1Tqc29QGFNXC8Dup9lxDxQxAM2BxlxjsxAVfOls2+GUZRxDjZBM1i1QptU w7/yZBARxmEHX/ElLEdlkOuJnsHVuyUHNeTr8g4g47Wlk7mxeG3sbCRNeAJ9o+0NKO+uLQqD2w9 JnnOSp1sqoKhF8Pqk8KW4fGPh4ae7QX/Y78K/9+JxZBppvGd X-Developer-Key: i=u.kleine-koenig@pengutronix.de; a=openpgp; fpr=0D2511F322BFAB1C1580266BE2DCDD9132669BD6 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.ext.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-media@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@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 (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 Reviewed-by: Geert Uytterhoeven Reviewed-by: Niklas Söderlund --- drivers/media/platform/renesas/rcar-vin/rcar-core.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/media/platform/renesas/rcar-vin/rcar-core.c b/drivers/media/platform/renesas/rcar-vin/rcar-core.c index 5e53d6b7036c..1398f147e5c2 100644 --- a/drivers/media/platform/renesas/rcar-vin/rcar-core.c +++ b/drivers/media/platform/renesas/rcar-vin/rcar-core.c @@ -1442,7 +1442,7 @@ static int rcar_vin_probe(struct platform_device *pdev) return 0; } -static int rcar_vin_remove(struct platform_device *pdev) +static void rcar_vin_remove(struct platform_device *pdev) { struct rvin_dev *vin = platform_get_drvdata(pdev); @@ -1458,8 +1458,6 @@ static int rcar_vin_remove(struct platform_device *pdev) rvin_parallel_cleanup(vin); rvin_dma_unregister(vin); - - return 0; } static SIMPLE_DEV_PM_OPS(rvin_pm_ops, rvin_suspend, rvin_resume); @@ -1472,7 +1470,7 @@ static struct platform_driver rcar_vin_driver = { .of_match_table = rvin_of_id_table, }, .probe = rcar_vin_probe, - .remove = rcar_vin_remove, + .remove_new = rcar_vin_remove, }; module_platform_driver(rcar_vin_driver); From patchwork Sun Mar 26 14:31:17 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= X-Patchwork-Id: 13188168 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 52B51C6FD1C for ; Sun, 26 Mar 2023 14:33:22 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232432AbjCZOdV (ORCPT ); Sun, 26 Mar 2023 10:33:21 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60400 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232425AbjCZOcq (ORCPT ); Sun, 26 Mar 2023 10:32:46 -0400 Received: from metis.ext.pengutronix.de (metis.ext.pengutronix.de [IPv6:2001:67c:670:201:290:27ff:fe1d:cc33]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2742F65AC for ; Sun, 26 Mar 2023 07:32:45 -0700 (PDT) Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.ext.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pgRQG-0008L7-Nu; Sun, 26 Mar 2023 16:32:40 +0200 Received: from [2a0a:edc0:0:900:1d::77] (helo=ptz.office.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtp (Exim 4.94.2) (envelope-from ) id 1pgRQE-006rcm-1N; Sun, 26 Mar 2023 16:32:38 +0200 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1pgRQC-0088Wx-BZ; Sun, 26 Mar 2023 16:32:36 +0200 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: =?utf-8?q?Niklas_S=C3=B6derlund?= , Mauro Carvalho Chehab Cc: linux-media@vger.kernel.org, linux-renesas-soc@vger.kernel.org, kernel@pengutronix.de Subject: [PATCH 050/117] media: rcar-csi2: Convert to platform remove callback returning void Date: Sun, 26 Mar 2023 16:31:17 +0200 Message-Id: <20230326143224.572654-53-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230326143224.572654-1-u.kleine-koenig@pengutronix.de> References: <20230326143224.572654-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1664; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=rzzlIfWXqPfQU48/T+BYrThE5NalpaIZnC0ld3lBsWA=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBkIFbCWdtnUZl+ZiAtPZ1QpSW5IVlI1DgRmbxAD VeqTmBvtQOJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZCBWwgAKCRCPgPtYfRL+ TiNeB/9Fxn4R0AAaRllcZFfQdvxhpCUHV8JuvXgYX5C7yjr6Qn59zpKIZeQcTApPBQ21WnGBiFh 47Z+uNGixCd4hVfmgB0ndDj8hDPTeGYfjQP76bFbBz52eAEgD9vEd7bSRAL00nOqjMCCxl4HvgH PbKoSzoHbQp4Catf6TpDSGfF0nneWq3r6dWKIbXI8bPdUwqbAkKzlRxXjMYQ4VClFr48iZBzcg6 giYRe+tQH9P3KfLevKDDRU1JKqax5F2QwmWnhti0ZPlW7sHxeR2vVa6tnE8YNSHZHUJt58WzFY4 /yWYOigmLVAjbDcsCrmcH3MfZMjGmF0wB078FUYEmDzUN+9+ X-Developer-Key: i=u.kleine-koenig@pengutronix.de; a=openpgp; fpr=0D2511F322BFAB1C1580266BE2DCDD9132669BD6 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.ext.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-media@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@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 (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 Reviewed-by: Geert Uytterhoeven Reviewed-by: Niklas Söderlund --- drivers/media/platform/renesas/rcar-vin/rcar-csi2.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/media/platform/renesas/rcar-vin/rcar-csi2.c b/drivers/media/platform/renesas/rcar-vin/rcar-csi2.c index 174aa6176f54..1632c9a53ac4 100644 --- a/drivers/media/platform/renesas/rcar-vin/rcar-csi2.c +++ b/drivers/media/platform/renesas/rcar-vin/rcar-csi2.c @@ -1574,7 +1574,7 @@ static int rcsi2_probe(struct platform_device *pdev) return ret; } -static int rcsi2_remove(struct platform_device *pdev) +static void rcsi2_remove(struct platform_device *pdev) { struct rcar_csi2 *priv = platform_get_drvdata(pdev); @@ -1585,12 +1585,10 @@ static int rcsi2_remove(struct platform_device *pdev) pm_runtime_disable(&pdev->dev); mutex_destroy(&priv->lock); - - return 0; } static struct platform_driver rcar_csi2_pdrv = { - .remove = rcsi2_remove, + .remove_new = rcsi2_remove, .probe = rcsi2_probe, .driver = { .name = "rcar-csi2", From patchwork Sun Mar 26 14:31:18 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= X-Patchwork-Id: 13188183 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 3103AC761AF for ; Sun, 26 Mar 2023 14:33:39 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232450AbjCZOdi (ORCPT ); Sun, 26 Mar 2023 10:33:38 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60602 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232457AbjCZOcu (ORCPT ); Sun, 26 Mar 2023 10:32:50 -0400 Received: from metis.ext.pengutronix.de (metis.ext.pengutronix.de [IPv6:2001:67c:670:201:290:27ff:fe1d:cc33]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2543859DB for ; Sun, 26 Mar 2023 07:32:49 -0700 (PDT) Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.ext.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pgRQI-0008Qd-5v; Sun, 26 Mar 2023 16:32:42 +0200 Received: from [2a0a:edc0:0:900:1d::77] (helo=ptz.office.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtp (Exim 4.94.2) (envelope-from ) id 1pgRQF-006rd9-9r; Sun, 26 Mar 2023 16:32:39 +0200 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1pgRQC-0088X0-HR; Sun, 26 Mar 2023 16:32:36 +0200 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Fabrizio Castro , Mauro Carvalho Chehab Cc: linux-media@vger.kernel.org, linux-renesas-soc@vger.kernel.org, kernel@pengutronix.de Subject: [PATCH 051/117] media: rcar_drif: Convert to platform remove callback returning void Date: Sun, 26 Mar 2023 16:31:18 +0200 Message-Id: <20230326143224.572654-54-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230326143224.572654-1-u.kleine-koenig@pengutronix.de> References: <20230326143224.572654-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1810; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=nwKCJTOdxQv7E7M26+wkLn98oSNhE7D9Vkt7wczeeVg=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBkIFbEK/1kkf6o5gM9he+H8/sE9QVvHxSzHMUWj 1F3uqRa1SCJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZCBWxAAKCRCPgPtYfRL+ TqggB/429FZpW1zigRZFsRKsuXBXU3GZQqCRMsaILtA23xmYgBYOBM5uyGOR8+/vY8F7lZaM0Qb tQYTzNl4suGeQmKTXMiLsULULaWxS+i0zp1DdWAz8PHdCiHfWQUhmBBVPOVYl7NA4k6LHAmHIhu lYyKoS15UKShVdEvuY1udzoKOyBZazbXJOCKArn1uLVSR5RlJyKvq7mVf9z4BgEdSpCXztFencO S3mDZ6JGlX9VODDlQJIgx1dpSFUrCtUvI8k5z0Mol5z+Gb4E9GOqq69LkIRBHWkBp5Dg5iGnlmQ Vf3B2taDEKtbzFk24hJsc3lSc5WasFgHUGTy9Lh6huWHojNQ X-Developer-Key: i=u.kleine-koenig@pengutronix.de; a=openpgp; fpr=0D2511F322BFAB1C1580266BE2DCDD9132669BD6 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.ext.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-media@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@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 (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 Reviewed-by: Geert Uytterhoeven Reviewed-by: Fabrizio Castro --- drivers/media/platform/renesas/rcar_drif.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/drivers/media/platform/renesas/rcar_drif.c b/drivers/media/platform/renesas/rcar_drif.c index 3fec41f6e964..3a92f4535c18 100644 --- a/drivers/media/platform/renesas/rcar_drif.c +++ b/drivers/media/platform/renesas/rcar_drif.c @@ -1433,19 +1433,17 @@ static int rcar_drif_probe(struct platform_device *pdev) } /* DRIF channel remove */ -static int rcar_drif_remove(struct platform_device *pdev) +static void rcar_drif_remove(struct platform_device *pdev) { struct rcar_drif *ch = platform_get_drvdata(pdev); struct rcar_drif_sdr *sdr = ch->sdr; /* Channel 0 will be the SDR instance */ if (ch->num) - return 0; + return; /* SDR instance */ rcar_drif_sdr_remove(sdr); - - return 0; } /* FIXME: Implement suspend/resume support */ @@ -1476,7 +1474,7 @@ static struct platform_driver rcar_drif_driver = { .pm = &rcar_drif_pm_ops, }, .probe = rcar_drif_probe, - .remove = rcar_drif_remove, + .remove_new = rcar_drif_remove, }; module_platform_driver(rcar_drif_driver); From patchwork Sun Mar 26 14:31:19 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= X-Patchwork-Id: 13188165 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id A06F0C761AF for ; Sun, 26 Mar 2023 14:33:19 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232525AbjCZOdS (ORCPT ); Sun, 26 Mar 2023 10:33:18 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60370 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232431AbjCZOcq (ORCPT ); Sun, 26 Mar 2023 10:32:46 -0400 Received: from metis.ext.pengutronix.de (metis.ext.pengutronix.de [IPv6:2001:67c:670:201:290:27ff:fe1d:cc33]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id AD6597ABB for ; Sun, 26 Mar 2023 07:32:44 -0700 (PDT) Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.ext.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pgRQG-0008Kg-5n; Sun, 26 Mar 2023 16:32:40 +0200 Received: from [2a0a:edc0:0:900:1d::77] (helo=ptz.office.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtp (Exim 4.94.2) (envelope-from ) id 1pgRQD-006rck-Uv; Sun, 26 Mar 2023 16:32:37 +0200 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1pgRQC-0088X7-Oi; Sun, 26 Mar 2023 16:32:36 +0200 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Kieran Bingham , Mauro Carvalho Chehab Cc: linux-media@vger.kernel.org, linux-renesas-soc@vger.kernel.org, kernel@pengutronix.de Subject: [PATCH 052/117] media: rcar_fdp1: Convert to platform remove callback returning void Date: Sun, 26 Mar 2023 16:31:19 +0200 Message-Id: <20230326143224.572654-55-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230326143224.572654-1-u.kleine-koenig@pengutronix.de> References: <20230326143224.572654-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1828; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=ep66JiQpFd5B636ftLdcfjXYfarPiHk1fH4HK7o52wk=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBkIFbFxHZo/YFxsqg6Y4hXlUqd6K7dWubV5/PkH sdNQo6+aEqJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZCBWxQAKCRCPgPtYfRL+ TqaWB/4hyb5B5K0WPDi9mQwEtmg0ckboPZCjuTO4Zyp5B+KEhDkv70k/wDuy0kv/7cNl8tQLjum USYJ1p+yQi6lqUyCjX/VwshMVy27bRh9fAF60oWUk/+pf/6uWVT3Y7VWCcn421E81U6OScOSMAc TQeHRZU3EZxrk4qUR8lypz63FD48hGQpJ0F96jHWzurnQB0bq5LaixG1S2i7FqLxhfXqKLWziOw QfZ5J5r8xCh7fdK0Tg2jafxocOE7riUN2unrhqNpfKLGWARYZMMyTCRguzCqgXfPnBOT0byepDK g78vo+6OdhoXSho91zU1q9G8byF9+kME9c86PS+ixQRhfm+v X-Developer-Key: i=u.kleine-koenig@pengutronix.de; a=openpgp; fpr=0D2511F322BFAB1C1580266BE2DCDD9132669BD6 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.ext.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-media@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@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 (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 Reviewed-by: Geert Uytterhoeven Reviewed-by: Kieran Bingham --- drivers/media/platform/renesas/rcar_fdp1.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/media/platform/renesas/rcar_fdp1.c b/drivers/media/platform/renesas/rcar_fdp1.c index 37ecf489d112..d80b3214dfae 100644 --- a/drivers/media/platform/renesas/rcar_fdp1.c +++ b/drivers/media/platform/renesas/rcar_fdp1.c @@ -2396,7 +2396,7 @@ static int fdp1_probe(struct platform_device *pdev) return ret; } -static int fdp1_remove(struct platform_device *pdev) +static void fdp1_remove(struct platform_device *pdev) { struct fdp1_dev *fdp1 = platform_get_drvdata(pdev); @@ -2404,8 +2404,6 @@ static int fdp1_remove(struct platform_device *pdev) video_unregister_device(&fdp1->vfd); v4l2_device_unregister(&fdp1->v4l2_dev); pm_runtime_disable(&pdev->dev); - - return 0; } static int __maybe_unused fdp1_pm_runtime_suspend(struct device *dev) @@ -2441,7 +2439,7 @@ MODULE_DEVICE_TABLE(of, fdp1_dt_ids); static struct platform_driver fdp1_pdrv = { .probe = fdp1_probe, - .remove = fdp1_remove, + .remove_new = fdp1_remove, .driver = { .name = DRIVER_NAME, .of_match_table = fdp1_dt_ids, From patchwork Sun Mar 26 14:31:20 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= X-Patchwork-Id: 13188174 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 4D051C761AF for ; Sun, 26 Mar 2023 14:33:30 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232406AbjCZOd3 (ORCPT ); Sun, 26 Mar 2023 10:33:29 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60602 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230198AbjCZOcr (ORCPT ); Sun, 26 Mar 2023 10:32:47 -0400 Received: from metis.ext.pengutronix.de (metis.ext.pengutronix.de [IPv6:2001:67c:670:201:290:27ff:fe1d:cc33]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4F79B59DB for ; Sun, 26 Mar 2023 07:32:46 -0700 (PDT) Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.ext.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pgRQH-0008Ot-Jw; Sun, 26 Mar 2023 16:32:41 +0200 Received: from [2a0a:edc0:0:900:1d::77] (helo=ptz.office.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtp (Exim 4.94.2) (envelope-from ) id 1pgRQE-006rcy-T6; Sun, 26 Mar 2023 16:32:38 +0200 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1pgRQC-0088XA-V1; Sun, 26 Mar 2023 16:32:36 +0200 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Mikhail Ulyanov , Mauro Carvalho Chehab Cc: linux-media@vger.kernel.org, linux-renesas-soc@vger.kernel.org, kernel@pengutronix.de Subject: [PATCH 053/117] media: rcar_jpu: Convert to platform remove callback returning void Date: Sun, 26 Mar 2023 16:31:20 +0200 Message-Id: <20230326143224.572654-56-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230326143224.572654-1-u.kleine-koenig@pengutronix.de> References: <20230326143224.572654-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1771; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=UC83YHmOk2BnQQT107sHqxKNVaZy0TsF7OXm3Ya2aec=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBkIFbGZpPNJXshYJpSZIZPl7ON0Mv3wqX3a9uDe 73Tu+VHWP2JATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZCBWxgAKCRCPgPtYfRL+ TtW8B/9hjmx3lhg/gDaDsBClWctoiJQOeg5+Iz+4DsJC6iqi0PXY63AU1esmV4yR2B/6IZFvdqN P1rEu2PWOz2ipOCoXqzW0MhBIM1IaVAYNqI8JehuUXskj0zFgg7svFLmD1mmayi6ObQqtI8/RwR RN1Skl0aW7v9U98MR3ZWhQQLQwQdOjb+5SNKwciXyDPgYmRyP9VPXBmxgtjtqfsfLRKWSiDFvzP ir6oGtgz5JTUwwmmeVk4TFc0AvX5LrJS3AOaFhRJbRfuxl97oeSQJUIrRsXTd7OL8u1xfiB0EYJ xtsFbiTm8ba48Te+3wpDoKJh6Uy4gaH5Elm0o7kISyEqxXVG X-Developer-Key: i=u.kleine-koenig@pengutronix.de; a=openpgp; fpr=0D2511F322BFAB1C1580266BE2DCDD9132669BD6 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.ext.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-media@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@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 (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 Reviewed-by: Geert Uytterhoeven --- drivers/media/platform/renesas/rcar_jpu.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/media/platform/renesas/rcar_jpu.c b/drivers/media/platform/renesas/rcar_jpu.c index 2f4377cfbb42..e7f604807825 100644 --- a/drivers/media/platform/renesas/rcar_jpu.c +++ b/drivers/media/platform/renesas/rcar_jpu.c @@ -1702,7 +1702,7 @@ static int jpu_probe(struct platform_device *pdev) return ret; } -static int jpu_remove(struct platform_device *pdev) +static void jpu_remove(struct platform_device *pdev) { struct jpu *jpu = platform_get_drvdata(pdev); @@ -1710,8 +1710,6 @@ static int jpu_remove(struct platform_device *pdev) video_unregister_device(&jpu->vfd_encoder); v4l2_m2m_release(jpu->m2m_dev); v4l2_device_unregister(&jpu->v4l2_dev); - - return 0; } #ifdef CONFIG_PM_SLEEP @@ -1746,7 +1744,7 @@ static const struct dev_pm_ops jpu_pm_ops = { static struct platform_driver jpu_driver = { .probe = jpu_probe, - .remove = jpu_remove, + .remove_new = jpu_remove, .driver = { .of_match_table = jpu_dt_ids, .name = DRV_NAME, From patchwork Sun Mar 26 14:31:21 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= X-Patchwork-Id: 13188178 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 44156C74A5B for ; Sun, 26 Mar 2023 14:33:34 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232060AbjCZOdd (ORCPT ); Sun, 26 Mar 2023 10:33:33 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60656 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232450AbjCZOcs (ORCPT ); Sun, 26 Mar 2023 10:32:48 -0400 Received: from metis.ext.pengutronix.de (metis.ext.pengutronix.de [IPv6:2001:67c:670:201:290:27ff:fe1d:cc33]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 24E147ABB for ; Sun, 26 Mar 2023 07:32:47 -0700 (PDT) Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.ext.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pgRQI-0008QU-68; Sun, 26 Mar 2023 16:32:42 +0200 Received: from [2a0a:edc0:0:900:1d::77] (helo=ptz.office.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtp (Exim 4.94.2) (envelope-from ) id 1pgRQF-006rd8-97; Sun, 26 Mar 2023 16:32:39 +0200 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1pgRQD-0088XD-5M; Sun, 26 Mar 2023 16:32:37 +0200 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Jacopo Mondi , Mauro Carvalho Chehab Cc: linux-media@vger.kernel.org, linux-renesas-soc@vger.kernel.org, kernel@pengutronix.de Subject: [PATCH 054/117] media: renesas-ceu: Convert to platform remove callback returning void Date: Sun, 26 Mar 2023 16:31:21 +0200 Message-Id: <20230326143224.572654-57-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230326143224.572654-1-u.kleine-koenig@pengutronix.de> References: <20230326143224.572654-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1768; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=u7QKai25ZD7du91fx2gh05IHciAlfyNOryov1W77jCE=; b=owGbwMvMwMXY3/A7olbonx/jabUkhhSFsOMVd/3zfu9OZj9q2cr1MlY4aKG99wNB9iM9N3gY1 1z4/lS7k9GYhYGRi0FWTJHFvnFNplWVXGTn2n+XYQaxMoFMYeDiFICJrFBm/8NZp1tyMaC9S1Jm 9sP1vHyNa3fW5F/n9OA1dndecSHK8kmOXNIUu+NO/js1LCpLXSfllx7tPmZ20v3fEjHT4If6Dqk Nti+ZLp9mcVWMURHY2X+pouIJ+w7F+DXla6Wu2lyu/nz9gGpYxydP1/gjnC+T/siF81YfZwx3cp fv2tpvueJwcqbQxhJN3XrjOWLNNm9XJ/dO/r20eKa37/xtjrkxs5jv/P65+1urVnvgJSXxW0V8c T2LXsQK3r2wdWJfXeuPsp6Np4XSJRLVJblPVncJbS8Izg0UVbAVStki77b+7kaNk6mTcxZwCS1+ fu3+lpS1Di/2SLbHsO2Ymmeolv2zbdm3aT7qpUF5u+wA X-Developer-Key: i=u.kleine-koenig@pengutronix.de; a=openpgp; fpr=0D2511F322BFAB1C1580266BE2DCDD9132669BD6 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.ext.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-media@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@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 (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 Reviewed-by: Geert Uytterhoeven --- drivers/media/platform/renesas/renesas-ceu.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/media/platform/renesas/renesas-ceu.c b/drivers/media/platform/renesas/renesas-ceu.c index f70f91b006b7..02d1ab23d76d 100644 --- a/drivers/media/platform/renesas/renesas-ceu.c +++ b/drivers/media/platform/renesas/renesas-ceu.c @@ -1709,7 +1709,7 @@ static int ceu_probe(struct platform_device *pdev) return ret; } -static int ceu_remove(struct platform_device *pdev) +static void ceu_remove(struct platform_device *pdev) { struct ceu_device *ceudev = platform_get_drvdata(pdev); @@ -1722,8 +1722,6 @@ static int ceu_remove(struct platform_device *pdev) v4l2_device_unregister(&ceudev->v4l2_dev); video_unregister_device(&ceudev->vdev); - - return 0; } static const struct dev_pm_ops ceu_pm_ops = { @@ -1739,7 +1737,7 @@ static struct platform_driver ceu_driver = { .of_match_table = of_match_ptr(ceu_of_match), }, .probe = ceu_probe, - .remove = ceu_remove, + .remove_new = ceu_remove, }; module_platform_driver(ceu_driver); From patchwork Sun Mar 26 14:31:22 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= X-Patchwork-Id: 13188237 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 65A78C77B6C for ; Sun, 26 Mar 2023 14:34:15 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232591AbjCZOeO (ORCPT ); Sun, 26 Mar 2023 10:34:14 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60384 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232480AbjCZOc6 (ORCPT ); Sun, 26 Mar 2023 10:32:58 -0400 Received: from metis.ext.pengutronix.de (metis.ext.pengutronix.de [IPv6:2001:67c:670:201:290:27ff:fe1d:cc33]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3EE6A198 for ; Sun, 26 Mar 2023 07:32:55 -0700 (PDT) Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.ext.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pgRQH-0008No-88; Sun, 26 Mar 2023 16:32:41 +0200 Received: from [2a0a:edc0:0:900:1d::77] (helo=ptz.office.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtp (Exim 4.94.2) (envelope-from ) id 1pgRQE-006rct-LL; Sun, 26 Mar 2023 16:32:38 +0200 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1pgRQD-0088XG-D6; Sun, 26 Mar 2023 16:32:37 +0200 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Mauro Carvalho Chehab , Sakari Ailus , Lad Prabhakar , =?utf-8?q?Uwe_Klei?= =?utf-8?q?ne-K=C3=B6nig?= Cc: linux-media@vger.kernel.org, kernel@pengutronix.de Subject: [PATCH 055/117] media: rzg2l-core: Convert to platform remove callback returning void Date: Sun, 26 Mar 2023 16:31:22 +0200 Message-Id: <20230326143224.572654-58-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230326143224.572654-1-u.kleine-koenig@pengutronix.de> References: <20230326143224.572654-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1849; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=b6L/l/VBIAmAssUNJg0IOOO3LNYWI2puHGSlGl2+BGU=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBkIFbIf1DXjA/46S8j3G/OGk0JjJ1nPKS8NR0ki gtaZgg9Wm2JATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZCBWyAAKCRCPgPtYfRL+ TitBB/4t7CUpdZ/t2QiFg/sKbzkW5XWq4tyQ6kEcc+zy5pWMqc1pPMRJVD2rseMo5R3pmxM6e38 yXClqtwFgVOiucdg+uqQkmAyhUE6mv75K3+5lFFK3cgiFmTnFXTdeFf3mC9xiry6dCE/fNmhyON xmCmKpDOcPmrtzDnPjvUM7Coi8g6HrmBYjgvrAsV6acCoF7Dyl543WYFSjmUEtPQ1+nt/BPylU1 gB0LhWcGjrT7kIlYBqWybDdOaLipQZ1WuZcnc7+qWIM8wOy/sX4kgC0UydWc6bImnWwVB42xfK3 6LFP//jRXoHB02txlYcYFoQVkZJVvAK1v2AygpWCZXW4OcHH X-Developer-Key: i=u.kleine-koenig@pengutronix.de; a=openpgp; fpr=0D2511F322BFAB1C1580266BE2DCDD9132669BD6 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.ext.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-media@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@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 (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 --- drivers/media/platform/renesas/rzg2l-cru/rzg2l-core.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/media/platform/renesas/rzg2l-cru/rzg2l-core.c b/drivers/media/platform/renesas/rzg2l-cru/rzg2l-core.c index 5939f5165a5e..7a71370fcc32 100644 --- a/drivers/media/platform/renesas/rzg2l-cru/rzg2l-core.c +++ b/drivers/media/platform/renesas/rzg2l-cru/rzg2l-core.c @@ -298,7 +298,7 @@ static int rzg2l_cru_probe(struct platform_device *pdev) return ret; } -static int rzg2l_cru_remove(struct platform_device *pdev) +static void rzg2l_cru_remove(struct platform_device *pdev) { struct rzg2l_cru_dev *cru = platform_get_drvdata(pdev); @@ -312,8 +312,6 @@ static int rzg2l_cru_remove(struct platform_device *pdev) mutex_destroy(&cru->mdev_lock); rzg2l_cru_dma_unregister(cru); - - return 0; } static const struct of_device_id rzg2l_cru_of_id_table[] = { @@ -328,7 +326,7 @@ static struct platform_driver rzg2l_cru_driver = { .of_match_table = rzg2l_cru_of_id_table, }, .probe = rzg2l_cru_probe, - .remove = rzg2l_cru_remove, + .remove_new = rzg2l_cru_remove, }; module_platform_driver(rzg2l_cru_driver); From patchwork Sun Mar 26 14:31:23 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= X-Patchwork-Id: 13188266 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 208D1C6FD1C for ; Sun, 26 Mar 2023 14:34:47 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232564AbjCZOen (ORCPT ); Sun, 26 Mar 2023 10:34:43 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60348 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232563AbjCZOdL (ORCPT ); Sun, 26 Mar 2023 10:33:11 -0400 Received: from metis.ext.pengutronix.de (metis.ext.pengutronix.de [IPv6:2001:67c:670:201:290:27ff:fe1d:cc33]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 04C807D94 for ; Sun, 26 Mar 2023 07:33:00 -0700 (PDT) Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.ext.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pgRQI-0008RT-HP; Sun, 26 Mar 2023 16:32:42 +0200 Received: from [2a0a:edc0:0:900:1d::77] (helo=ptz.office.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtp (Exim 4.94.2) (envelope-from ) id 1pgRQF-006rdF-IL; Sun, 26 Mar 2023 16:32:39 +0200 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1pgRQD-0088XO-Ig; Sun, 26 Mar 2023 16:32:37 +0200 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Mauro Carvalho Chehab , Hans Verkuil , Lad Prabhakar , Nathan Chancellor , Yang Li , =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= , Dan Carpenter Cc: linux-media@vger.kernel.org, kernel@pengutronix.de Subject: [PATCH 056/117] media: rzg2l-csi2: Convert to platform remove callback returning void Date: Sun, 26 Mar 2023 16:31:23 +0200 Message-Id: <20230326143224.572654-59-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230326143224.572654-1-u.kleine-koenig@pengutronix.de> References: <20230326143224.572654-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1924; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=zzC69ruW9ymPVD8svgpuKUjORivZYVq9oniixuEC948=; b=owGbwMvMwMXY3/A7olbonx/jabUkhhSFsFMnHX6255jxs96vY4vvdYvoLzo2jaXyleftL2W38 p6trlrayWjMwsDIxSArpshi37gm06pKLrJz7b/LMINYmUCmMHBxCsBEPvKz/6+c+un2sxLDT8kT K8ISPLQ2Fx69+qvscnFcYn86x5JN2kVTj4ruCnxZ8vz4E5F7U5l+HM0+Ocdo78nX0T8WW5Y7/bn V2nUnanvmgYBoLmeznAfJZziuTZ8oGCesLvy5Nev2gbs+AudOOi/czXab2/XZ/8royqN3nvAWxe b2/po+c1XO5vMdLc8rhDRNu9T8Tq1wesh+KmpK0/WY0M+WqT9tPYVfOH8r+nJFRlFZK0e7WawvK 5PHPVpPnclxY0bECWWV8rrPTLr15T5+EsJvmz6ptSst4w8TPHZ7SZ+KJlecTUDx+S9JoZd4tcXV DIylYqddWvyVaf6FM17nJscLfNuruuZLa2W3TA77+g1KAA== X-Developer-Key: i=u.kleine-koenig@pengutronix.de; a=openpgp; fpr=0D2511F322BFAB1C1580266BE2DCDD9132669BD6 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.ext.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-media@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@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 (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 --- drivers/media/platform/renesas/rzg2l-cru/rzg2l-csi2.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/media/platform/renesas/rzg2l-cru/rzg2l-csi2.c b/drivers/media/platform/renesas/rzg2l-cru/rzg2l-csi2.c index 384fb54e219a..30dad7383654 100644 --- a/drivers/media/platform/renesas/rzg2l-cru/rzg2l-csi2.c +++ b/drivers/media/platform/renesas/rzg2l-cru/rzg2l-csi2.c @@ -819,7 +819,7 @@ static int rzg2l_csi2_probe(struct platform_device *pdev) return ret; } -static int rzg2l_csi2_remove(struct platform_device *pdev) +static void rzg2l_csi2_remove(struct platform_device *pdev) { struct rzg2l_csi2 *csi2 = platform_get_drvdata(pdev); @@ -829,8 +829,6 @@ static int rzg2l_csi2_remove(struct platform_device *pdev) v4l2_subdev_cleanup(&csi2->subdev); media_entity_cleanup(&csi2->subdev.entity); pm_runtime_disable(&pdev->dev); - - return 0; } static int __maybe_unused rzg2l_csi2_pm_runtime_suspend(struct device *dev) @@ -859,7 +857,7 @@ static const struct of_device_id rzg2l_csi2_of_table[] = { }; static struct platform_driver rzg2l_csi2_pdrv = { - .remove = rzg2l_csi2_remove, + .remove_new = rzg2l_csi2_remove, .probe = rzg2l_csi2_probe, .driver = { .name = "rzg2l-csi2", From patchwork Sun Mar 26 14:31:24 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= X-Patchwork-Id: 13188180 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 6F141C77B61 for ; Sun, 26 Mar 2023 14:33:36 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232571AbjCZOdf (ORCPT ); Sun, 26 Mar 2023 10:33:35 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60336 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232440AbjCZOct (ORCPT ); Sun, 26 Mar 2023 10:32:49 -0400 Received: from metis.ext.pengutronix.de (metis.ext.pengutronix.de [IPv6:2001:67c:670:201:290:27ff:fe1d:cc33]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D4F4C7D94 for ; Sun, 26 Mar 2023 07:32:48 -0700 (PDT) Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.ext.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pgRQI-0008So-RH; Sun, 26 Mar 2023 16:32:42 +0200 Received: from [2a0a:edc0:0:900:1d::77] (helo=ptz.office.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtp (Exim 4.94.2) (envelope-from ) id 1pgRQG-006rdX-5A; Sun, 26 Mar 2023 16:32:40 +0200 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1pgRQD-0088XR-Pn; Sun, 26 Mar 2023 16:32:37 +0200 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Mauro Carvalho Chehab , =?utf-8?q?Uwe_Kleine-K=C3=B6?= =?utf-8?q?nig?= Cc: linux-media@vger.kernel.org, kernel@pengutronix.de Subject: [PATCH 057/117] media: sh_vou: Convert to platform remove callback returning void Date: Sun, 26 Mar 2023 16:31:24 +0200 Message-Id: <20230326143224.572654-60-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230326143224.572654-1-u.kleine-koenig@pengutronix.de> References: <20230326143224.572654-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1698; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=GnkVK7SIodm7ugn6xEylj23OqmAQ9deIMvUSGLhIs1E=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBkIFbLBdmiEleG0aVjONz4apqzeDrzl8U2Ru7rv rlCYdt/txeJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZCBWywAKCRCPgPtYfRL+ Tm/9B/9hSK3oEKGQxVuk5inkcKQAUYxgDE4lwLhPUGs6NyHsrMlCkoj8qQjbxIEHmAMFPeNB+WS iuf0knLsYSFNsw/UvvXAwSyH+ZI4wBmFJHgdqrPO+XUXyysWfybqqj5xFTH6HXot3J6siF4/W0m 5Y9U0Ru9VipKVv6VtXjQLe2T3uprsE4MzjgFSD1NVTt9cXNcGjAD0biOnF2ych7VKBdfYP90q/a OenzkBrmuXpHLKUf4vQLrwcITnKb23DcwckFQtRSoF13Agph5Lk7Q3vtS8zeoFT9ZWwDrDXSH55 K0yxEe9SeOayrzBdHtvsPp1b7XTuotYtkIOgf2Df3kjMyOT0 X-Developer-Key: i=u.kleine-koenig@pengutronix.de; a=openpgp; fpr=0D2511F322BFAB1C1580266BE2DCDD9132669BD6 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.ext.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-media@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@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 (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 --- drivers/media/platform/renesas/sh_vou.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/drivers/media/platform/renesas/sh_vou.c b/drivers/media/platform/renesas/sh_vou.c index ca4310e26c49..8fe3272a541f 100644 --- a/drivers/media/platform/renesas/sh_vou.c +++ b/drivers/media/platform/renesas/sh_vou.c @@ -1343,7 +1343,7 @@ static int sh_vou_probe(struct platform_device *pdev) return ret; } -static int sh_vou_remove(struct platform_device *pdev) +static void sh_vou_remove(struct platform_device *pdev) { struct v4l2_device *v4l2_dev = platform_get_drvdata(pdev); struct sh_vou_device *vou_dev = container_of(v4l2_dev, @@ -1356,11 +1356,10 @@ static int sh_vou_remove(struct platform_device *pdev) video_unregister_device(&vou_dev->vdev); i2c_put_adapter(client->adapter); v4l2_device_unregister(&vou_dev->v4l2_dev); - return 0; } static struct platform_driver sh_vou = { - .remove = sh_vou_remove, + .remove_new = sh_vou_remove, .driver = { .name = "sh-vou", }, From patchwork Sun Mar 26 14:31:25 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= X-Patchwork-Id: 13188177 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 4CDC8C761AF for ; Sun, 26 Mar 2023 14:33:33 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232573AbjCZOdc (ORCPT ); Sun, 26 Mar 2023 10:33:32 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60346 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232443AbjCZOcr (ORCPT ); Sun, 26 Mar 2023 10:32:47 -0400 Received: from metis.ext.pengutronix.de (metis.ext.pengutronix.de [IPv6:2001:67c:670:201:290:27ff:fe1d:cc33]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D6B0F7AAB for ; Sun, 26 Mar 2023 07:32:46 -0700 (PDT) Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.ext.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pgRQI-0008Rv-5H; Sun, 26 Mar 2023 16:32:42 +0200 Received: from [2a0a:edc0:0:900:1d::77] (helo=ptz.office.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtp (Exim 4.94.2) (envelope-from ) id 1pgRQF-006rdM-Og; Sun, 26 Mar 2023 16:32:39 +0200 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1pgRQE-0088XU-0M; Sun, 26 Mar 2023 16:32:38 +0200 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Laurent Pinchart , Kieran Bingham , Mauro Carvalho Chehab Cc: linux-media@vger.kernel.org, linux-renesas-soc@vger.kernel.org, kernel@pengutronix.de Subject: [PATCH 058/117] media: vsp1_drv: Convert to platform remove callback returning void Date: Sun, 26 Mar 2023 16:31:25 +0200 Message-Id: <20230326143224.572654-61-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230326143224.572654-1-u.kleine-koenig@pengutronix.de> References: <20230326143224.572654-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1772; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=EjRcTYlo35y82/L20Z81gnE14v2Xv5gdgq+8cV2/JKk=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBkIFbMOk/UOndLqfRzqpes0DNym0NOJWfrjM61O Dy7cqSuJ/WJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZCBWzAAKCRCPgPtYfRL+ Tr8sB/4gUbHY3UrlevoJV054i3j8+uqfuciL5D7OsMmV2uyEGiX8GxkUgXrz2XwHfQzyddkNhC5 YWSUnk+ThKJsdqa5JGQcBU2L27bow3btqgg88MfaJQe0tHiiYmX7MguUkdI4iKPbbyHajUOhqXu yyEFnm8nLMgx+5kkVSw7732Lyb6R7SIsb40GP2o7n3uYLQ9RB5TwA334Vj+xI/3uUDEGRsB3rQj lQnSzvR6W0qCsXcEkf5a9h9J7ouM15cy1nu2NJL1wyJWNb1mIzBWcs2D8BaBVEw0dTZ9SO5MGKD eERDqs+s1TG3wHdar4udoZSP9OYPlwEO5wgMhSMGRjq1jzde X-Developer-Key: i=u.kleine-koenig@pengutronix.de; a=openpgp; fpr=0D2511F322BFAB1C1580266BE2DCDD9132669BD6 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.ext.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-media@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@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 (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 Reviewed-by: Geert Uytterhoeven Reviewed-by: Kieran Bingham --- drivers/media/platform/renesas/vsp1/vsp1_drv.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/media/platform/renesas/vsp1/vsp1_drv.c b/drivers/media/platform/renesas/vsp1/vsp1_drv.c index 5710152d6511..c1c28f98bd10 100644 --- a/drivers/media/platform/renesas/vsp1/vsp1_drv.c +++ b/drivers/media/platform/renesas/vsp1/vsp1_drv.c @@ -977,7 +977,7 @@ static int vsp1_probe(struct platform_device *pdev) return ret; } -static int vsp1_remove(struct platform_device *pdev) +static void vsp1_remove(struct platform_device *pdev) { struct vsp1_device *vsp1 = platform_get_drvdata(pdev); @@ -985,8 +985,6 @@ static int vsp1_remove(struct platform_device *pdev) rcar_fcp_put(vsp1->fcp); pm_runtime_disable(&pdev->dev); - - return 0; } static const struct of_device_id vsp1_of_match[] = { @@ -999,7 +997,7 @@ MODULE_DEVICE_TABLE(of, vsp1_of_match); static struct platform_driver vsp1_platform_driver = { .probe = vsp1_probe, - .remove = vsp1_remove, + .remove_new = vsp1_remove, .driver = { .name = "vsp1", .pm = &vsp1_pm_ops, From patchwork Sun Mar 26 14:31:26 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= X-Patchwork-Id: 13188228 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id A0E5EC74A5B for ; Sun, 26 Mar 2023 14:34:05 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232491AbjCZOeE (ORCPT ); Sun, 26 Mar 2023 10:34:04 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:32776 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232503AbjCZOc4 (ORCPT ); Sun, 26 Mar 2023 10:32:56 -0400 Received: from metis.ext.pengutronix.de (metis.ext.pengutronix.de [IPv6:2001:67c:670:201:290:27ff:fe1d:cc33]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1E8497D8C for ; Sun, 26 Mar 2023 07:32:53 -0700 (PDT) Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.ext.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pgRQM-0008S2-Pp; Sun, 26 Mar 2023 16:32:46 +0200 Received: from [2a0a:edc0:0:900:1d::77] (helo=ptz.office.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtp (Exim 4.94.2) (envelope-from ) id 1pgRQF-006rdO-Qe; Sun, 26 Mar 2023 16:32:39 +0200 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1pgRQE-0088XZ-6K; Sun, 26 Mar 2023 16:32:38 +0200 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Jacob Chen , Ezequiel Garcia , Mauro Carvalho Chehab , Heiko Stuebner Cc: linux-media@vger.kernel.org, linux-rockchip@lists.infradead.org, linux-arm-kernel@lists.infradead.org, kernel@pengutronix.de Subject: [PATCH 059/117] media: rga: Convert to platform remove callback returning void Date: Sun, 26 Mar 2023 16:31:26 +0200 Message-Id: <20230326143224.572654-62-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230326143224.572654-1-u.kleine-koenig@pengutronix.de> References: <20230326143224.572654-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1753; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=rQQfsHrwV+c5wQvF4lxwVI1GbxtOlE3rn040X1cCNXs=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBkIFbNZWAoNfeZ9R1R0Vor7bhu8//Bx1HBz2Mvn 0ZZ6FSPkJeJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZCBWzQAKCRCPgPtYfRL+ TkKbCAC3ciBfPEnrewhCphhzSZ6Rle7/TOFS75TLT2UAgJBi2wBF9i1OqQtpBCR2MJ757dV0EHS 29H8a2jNlXTrt17GCzk+Nkf3uC1mbcrFPkQFS6JmnD5RCcLdX5/48563D2J7MDa/a70OiXpu9F2 pxG4750fz8oNQZMlYcyjm9/vZQcDmMi5+iIf8IwYNz9PAjBzEZSHuPcMrLGIIed/2zZIQbuPbEO ePSPCv71Y9BZB74NpmbPQ6GwLuGtBg/Q8+ifuz2+Ud5MvXjpfAkDtFf4BL018kCjKKLE0SNRvJ8 GJcU4IO56EVXd70rqdmIRvrzGE3cFHTpOIbzxc/RcYU8KV4d X-Developer-Key: i=u.kleine-koenig@pengutronix.de; a=openpgp; fpr=0D2511F322BFAB1C1580266BE2DCDD9132669BD6 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.ext.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-media@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@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 (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 --- drivers/media/platform/rockchip/rga/rga.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/media/platform/rockchip/rga/rga.c b/drivers/media/platform/rockchip/rga/rga.c index 61b25fcf826e..67dcf22e5ba3 100644 --- a/drivers/media/platform/rockchip/rga/rga.c +++ b/drivers/media/platform/rockchip/rga/rga.c @@ -930,7 +930,7 @@ static int rga_probe(struct platform_device *pdev) return ret; } -static int rga_remove(struct platform_device *pdev) +static void rga_remove(struct platform_device *pdev) { struct rockchip_rga *rga = platform_get_drvdata(pdev); @@ -947,8 +947,6 @@ static int rga_remove(struct platform_device *pdev) v4l2_device_unregister(&rga->v4l2_dev); pm_runtime_disable(rga->dev); - - return 0; } static int __maybe_unused rga_runtime_suspend(struct device *dev) @@ -986,7 +984,7 @@ MODULE_DEVICE_TABLE(of, rockchip_rga_match); static struct platform_driver rga_pdrv = { .probe = rga_probe, - .remove = rga_remove, + .remove_new = rga_remove, .driver = { .name = RGA_NAME, .pm = &rga_pm, From patchwork Sun Mar 26 14:31:27 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= X-Patchwork-Id: 13188212 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id CAE78C761AF for ; Sun, 26 Mar 2023 14:33:47 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232475AbjCZOdp (ORCPT ); Sun, 26 Mar 2023 10:33:45 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60632 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231989AbjCZOcx (ORCPT ); Sun, 26 Mar 2023 10:32:53 -0400 Received: from metis.ext.pengutronix.de (metis.ext.pengutronix.de [IPv6:2001:67c:670:201:290:27ff:fe1d:cc33]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 71FFA658D for ; Sun, 26 Mar 2023 07:32:51 -0700 (PDT) Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.ext.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pgRQI-0008RZ-RV; Sun, 26 Mar 2023 16:32:42 +0200 Received: from [2a0a:edc0:0:900:1d::77] (helo=ptz.office.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtp (Exim 4.94.2) (envelope-from ) id 1pgRQF-006rdH-KI; Sun, 26 Mar 2023 16:32:39 +0200 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1pgRQE-0088Xc-DI; Sun, 26 Mar 2023 16:32:38 +0200 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Dafna Hirschfeld , Mauro Carvalho Chehab , Heiko Stuebner Cc: linux-media@vger.kernel.org, linux-rockchip@lists.infradead.org, linux-arm-kernel@lists.infradead.org, kernel@pengutronix.de Subject: [PATCH 060/117] media: rkisp1-dev: Convert to platform remove callback returning void Date: Sun, 26 Mar 2023 16:31:27 +0200 Message-Id: <20230326143224.572654-63-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230326143224.572654-1-u.kleine-koenig@pengutronix.de> References: <20230326143224.572654-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1786; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=Las+mkTmyDmRr0fHmoy+1HXOXOBTIkYgBinmFYNv/w4=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBkIFbOhKe5iFEeZtaIE2yURCxYMuGQRmTh1Y9LN B+ToOKPFUSJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZCBWzgAKCRCPgPtYfRL+ TsngCACG7ACjJvUnzOuiMw/JoBsfe+H9JvMXYxc513dmVUlhNII4PUM+agoqvv2x87UqHjY8yZA k9X5H/WjbP839F1NxO3pT7eE3oDsbrpkBcN0uzvnarW+NM15qArGWUIe7jmx+zwEEUIAbDDodbu SAUaJscUYoxdPnU4D2w7w1FU7o47/V1jAvvQcBmz41tI5xa4YqBDvCVJWm2DfwKPkpulaEWaIfI ov521B2oGEwUPJcw5ehFyLz3SthvMmaCfyoduz7+4oUrRB+bPoh2r8MTcdKipJUlT7AnB1VcdRk Y8vuYZWcbEMStbNbNUWT7MaZF6a3ohYbwtIV/f8CHKe21Hy5 X-Developer-Key: i=u.kleine-koenig@pengutronix.de; a=openpgp; fpr=0D2511F322BFAB1C1580266BE2DCDD9132669BD6 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.ext.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-media@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@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 (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 --- drivers/media/platform/rockchip/rkisp1/rkisp1-dev.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/media/platform/rockchip/rkisp1/rkisp1-dev.c b/drivers/media/platform/rockchip/rkisp1/rkisp1-dev.c index f2475c6235ea..4762cb32353d 100644 --- a/drivers/media/platform/rockchip/rkisp1/rkisp1-dev.c +++ b/drivers/media/platform/rockchip/rkisp1/rkisp1-dev.c @@ -622,7 +622,7 @@ static int rkisp1_probe(struct platform_device *pdev) return ret; } -static int rkisp1_remove(struct platform_device *pdev) +static void rkisp1_remove(struct platform_device *pdev) { struct rkisp1_device *rkisp1 = platform_get_drvdata(pdev); @@ -638,8 +638,6 @@ static int rkisp1_remove(struct platform_device *pdev) v4l2_device_unregister(&rkisp1->v4l2_dev); pm_runtime_disable(&pdev->dev); - - return 0; } static struct platform_driver rkisp1_drv = { @@ -649,7 +647,7 @@ static struct platform_driver rkisp1_drv = { .pm = &rkisp1_pm_ops, }, .probe = rkisp1_probe, - .remove = rkisp1_remove, + .remove_new = rkisp1_remove, }; module_platform_driver(rkisp1_drv); From patchwork Sun Mar 26 14:31:28 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= X-Patchwork-Id: 13188235 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 46BF1C77B61 for ; Sun, 26 Mar 2023 14:34:13 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232468AbjCZOeM (ORCPT ); Sun, 26 Mar 2023 10:34:12 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60370 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232513AbjCZOc6 (ORCPT ); Sun, 26 Mar 2023 10:32:58 -0400 Received: from metis.ext.pengutronix.de (metis.ext.pengutronix.de [IPv6:2001:67c:670:201:290:27ff:fe1d:cc33]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C01147EC5 for ; Sun, 26 Mar 2023 07:32:54 -0700 (PDT) Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.ext.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pgRQJ-0008TG-FG; Sun, 26 Mar 2023 16:32:43 +0200 Received: from [2a0a:edc0:0:900:1d::77] (helo=ptz.office.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtp (Exim 4.94.2) (envelope-from ) id 1pgRQG-006rdi-EY; Sun, 26 Mar 2023 16:32:40 +0200 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1pgRQE-0088Xf-LM; Sun, 26 Mar 2023 16:32:38 +0200 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Mauro Carvalho Chehab , Krzysztof Kozlowski , =?utf-8?q?Uwe_Kleine-?= =?utf-8?q?K=C3=B6nig?= , Colin Ian King , Hans Verkuil Cc: Alim Akhtar , linux-media@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-samsung-soc@vger.kernel.org, kernel@pengutronix.de Subject: [PATCH 061/117] media: gsc-core: Convert to platform remove callback returning void Date: Sun, 26 Mar 2023 16:31:28 +0200 Message-Id: <20230326143224.572654-64-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230326143224.572654-1-u.kleine-koenig@pengutronix.de> References: <20230326143224.572654-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1804; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=eCSifVDAXW1X9cqwaaO+CIz3Ffo9A6DmGqCvAijEceE=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBkIFbPr3FL7OeCsFMG8fuH3lucwcXA/JAft3Z+O qnuaKUrJFKJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZCBWzwAKCRCPgPtYfRL+ To6mB/0b1uRTMan64x+JAXAbjBLCzuNlTD0aJ1JMcGvaw+HooBDUHxkZcBGqZjOXYNh9JX7fzl/ +2rowxWYNLnHCr8MUHenj1HqA1ZncCV5VbOp7yfbxP5ZZocsRrD/w8bkWFiFfpRq5PhwLmGes0P rSdZZwLEfSto6Hn9dC2D9gE3zfVEydSwcAstdD7aSp3Hcgcsn9Jfot61Qx3xWnKHXA29W5t2BuA UnhBg2/5zUbbgTUPFSGkDsEVcGOWzchrapyd77nC+/pXrOfbIeW9yTXtY0xWrZV8H/6pwmWRgj4 yWzbKvRkT6iE7TEPef8MsoFq7j0VyZKUqw5Zrg0mP5ej8ogf X-Developer-Key: i=u.kleine-koenig@pengutronix.de; a=openpgp; fpr=0D2511F322BFAB1C1580266BE2DCDD9132669BD6 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.ext.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-media@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@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 (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 --- drivers/media/platform/samsung/exynos-gsc/gsc-core.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/drivers/media/platform/samsung/exynos-gsc/gsc-core.c b/drivers/media/platform/samsung/exynos-gsc/gsc-core.c index b147c645ae0b..1fb34de70649 100644 --- a/drivers/media/platform/samsung/exynos-gsc/gsc-core.c +++ b/drivers/media/platform/samsung/exynos-gsc/gsc-core.c @@ -1201,7 +1201,7 @@ static int gsc_probe(struct platform_device *pdev) return ret; } -static int gsc_remove(struct platform_device *pdev) +static void gsc_remove(struct platform_device *pdev) { struct gsc_dev *gsc = platform_get_drvdata(pdev); int i; @@ -1220,7 +1220,6 @@ static int gsc_remove(struct platform_device *pdev) pm_runtime_set_suspended(&pdev->dev); dev_dbg(&pdev->dev, "%s driver unloaded\n", pdev->name); - return 0; } #ifdef CONFIG_PM @@ -1311,7 +1310,7 @@ static const struct dev_pm_ops gsc_pm_ops = { static struct platform_driver gsc_driver = { .probe = gsc_probe, - .remove = gsc_remove, + .remove_new = gsc_remove, .driver = { .name = GSC_MODULE_NAME, .pm = &gsc_pm_ops, From patchwork Sun Mar 26 14:31:29 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= X-Patchwork-Id: 13188222 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id C5BECC6FD1C for ; Sun, 26 Mar 2023 14:33:59 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232449AbjCZOd5 (ORCPT ); Sun, 26 Mar 2023 10:33:57 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60622 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232380AbjCZOcz (ORCPT ); Sun, 26 Mar 2023 10:32:55 -0400 Received: from metis.ext.pengutronix.de (metis.ext.pengutronix.de [IPv6:2001:67c:670:201:290:27ff:fe1d:cc33]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 757D4659D for ; Sun, 26 Mar 2023 07:32:53 -0700 (PDT) Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.ext.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pgRQJ-0008TS-2D; Sun, 26 Mar 2023 16:32:43 +0200 Received: from [2a0a:edc0:0:900:1d::77] (helo=ptz.office.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtp (Exim 4.94.2) (envelope-from ) id 1pgRQG-006rdm-H0; Sun, 26 Mar 2023 16:32:40 +0200 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1pgRQE-0088Xj-TH; Sun, 26 Mar 2023 16:32:38 +0200 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Sylwester Nawrocki , Mauro Carvalho Chehab , Krzysztof Kozlowski Cc: Alim Akhtar , linux-media@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-samsung-soc@vger.kernel.org, kernel@pengutronix.de Subject: [PATCH 062/117] media: fimc-core: Convert to platform remove callback returning void Date: Sun, 26 Mar 2023 16:31:29 +0200 Message-Id: <20230326143224.572654-65-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230326143224.572654-1-u.kleine-koenig@pengutronix.de> References: <20230326143224.572654-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1811; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=/gDAR1WFxT/u1905dx4UD+u34Zk0RMlD2WklQfEDbLo=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBkIFbQBClHyYs1RkuSAjmGh5nHyF+BlFnLftIh5 Bfb9lq1o9WJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZCBW0AAKCRCPgPtYfRL+ ToYzB/9PhprinAEP2a6NE/p3ZLk9AKr1ROKjrPbWJ5s84Fyn8wsyV06m5YRYexA+pfPDdpIiyKU ayWr1KTlQcJrjoVp0SL2Edu4Jm7mPWjPImNWH7diNSt4OJxsCyj8YWUbjFfGU143vAOR5qoGqY0 dWCUU1LfW03fhfJW3ZCoGucwhNc1St54axxmgB4llWoigbe3YqkTpl/nuXeAMD6IMoskYWd4oJh C79rA6cyXWx9+98FRvwllEHi9oHZdmRnpfWdQIOt3NTyfU9UuQuz6kh7lGrUP2Z8JQDXwkwVL4j 13nQfHiQehjA2NOyDa6AD3llDlW1OcoYfKzdYciQyPRi+SCr X-Developer-Key: i=u.kleine-koenig@pengutronix.de; a=openpgp; fpr=0D2511F322BFAB1C1580266BE2DCDD9132669BD6 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.ext.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-media@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@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 (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 --- drivers/media/platform/samsung/exynos4-is/fimc-core.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/drivers/media/platform/samsung/exynos4-is/fimc-core.c b/drivers/media/platform/samsung/exynos4-is/fimc-core.c index 1791100b6935..a2034ade8b9e 100644 --- a/drivers/media/platform/samsung/exynos4-is/fimc-core.c +++ b/drivers/media/platform/samsung/exynos4-is/fimc-core.c @@ -1092,7 +1092,7 @@ static int fimc_suspend(struct device *dev) } #endif /* CONFIG_PM_SLEEP */ -static int fimc_remove(struct platform_device *pdev) +static void fimc_remove(struct platform_device *pdev) { struct fimc_dev *fimc = platform_get_drvdata(pdev); @@ -1108,7 +1108,6 @@ static int fimc_remove(struct platform_device *pdev) fimc_clk_put(fimc); dev_info(&pdev->dev, "driver unloaded\n"); - return 0; } /* S5PV210, S5PC110 */ @@ -1160,7 +1159,7 @@ static const struct dev_pm_ops fimc_pm_ops = { static struct platform_driver fimc_driver = { .probe = fimc_probe, - .remove = fimc_remove, + .remove_new = fimc_remove, .driver = { .of_match_table = fimc_of_match, .name = FIMC_DRIVER_NAME, From patchwork Sun Mar 26 14:31:30 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= X-Patchwork-Id: 13188231 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 5D46FC761AF for ; Sun, 26 Mar 2023 14:34:10 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232520AbjCZOeJ (ORCPT ); Sun, 26 Mar 2023 10:34:09 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:32816 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232462AbjCZOc4 (ORCPT ); Sun, 26 Mar 2023 10:32:56 -0400 Received: from metis.ext.pengutronix.de (metis.ext.pengutronix.de [IPv6:2001:67c:670:201:290:27ff:fe1d:cc33]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5AF0E7ABE for ; Sun, 26 Mar 2023 07:32:53 -0700 (PDT) Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.ext.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pgRQJ-0008Sy-63; Sun, 26 Mar 2023 16:32:43 +0200 Received: from [2a0a:edc0:0:900:1d::77] (helo=ptz.office.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtp (Exim 4.94.2) (envelope-from ) id 1pgRQG-006rdb-89; Sun, 26 Mar 2023 16:32:40 +0200 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1pgRQF-0088Xn-44; Sun, 26 Mar 2023 16:32:39 +0200 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Sylwester Nawrocki , Mauro Carvalho Chehab , Krzysztof Kozlowski Cc: Alim Akhtar , linux-media@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-samsung-soc@vger.kernel.org, kernel@pengutronix.de Subject: [PATCH 063/117] media: fimc-is-i2c: Convert to platform remove callback returning void Date: Sun, 26 Mar 2023 16:31:30 +0200 Message-Id: <20230326143224.572654-66-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230326143224.572654-1-u.kleine-koenig@pengutronix.de> References: <20230326143224.572654-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1806; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=i+uDo4jAoLfrwRj3SSb0wmrkT9SbZrsAL2MdBaehurE=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBkIFbSwhAIKDaQG3wDPivDtC81w4My9SJOmHk4k MWcw2JmNV6JATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZCBW0gAKCRCPgPtYfRL+ ToRHB/47kZKeCTKZgtMr/NS5F5UgfOlxSXsPdOUXaEt0vei8n98JGv2xGLtjCK1JFhfLiLECG9q tyqU+QjDIRvl1E5o4CeTb/GLu2/P1/E1pJNWjzQJFVeEk6e+8z2V38ZsJEoaSJvX/PlpdIggv4c GoACo8J1sVq82UttDNeguwTs5KVtg56cY+KaPNyv1X4IigXYjFGMGGA5YunkgXtVRMPi5QPLQzZ /X4vKDpiPP4j2zrAKeOKqyTxrovcVuzIxECoo0B23rM4QJUxelaPCNKJzfqSGGOz3u0w/I+puzG 7aHgWM3xCaoLINVcrh3z+bWCToumQVOiizbL8B5vxliUNgDK X-Developer-Key: i=u.kleine-koenig@pengutronix.de; a=openpgp; fpr=0D2511F322BFAB1C1580266BE2DCDD9132669BD6 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.ext.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-media@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@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 (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 --- drivers/media/platform/samsung/exynos4-is/fimc-is-i2c.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/media/platform/samsung/exynos4-is/fimc-is-i2c.c b/drivers/media/platform/samsung/exynos4-is/fimc-is-i2c.c index 83a28ef8e099..bef6e9b4a25e 100644 --- a/drivers/media/platform/samsung/exynos4-is/fimc-is-i2c.c +++ b/drivers/media/platform/samsung/exynos4-is/fimc-is-i2c.c @@ -82,14 +82,12 @@ static int fimc_is_i2c_probe(struct platform_device *pdev) return ret; } -static int fimc_is_i2c_remove(struct platform_device *pdev) +static void fimc_is_i2c_remove(struct platform_device *pdev) { struct fimc_is_i2c *isp_i2c = platform_get_drvdata(pdev); pm_runtime_disable(&pdev->dev); i2c_del_adapter(&isp_i2c->adapter); - - return 0; } #ifdef CONFIG_PM @@ -140,7 +138,7 @@ static const struct of_device_id fimc_is_i2c_of_match[] = { static struct platform_driver fimc_is_i2c_driver = { .probe = fimc_is_i2c_probe, - .remove = fimc_is_i2c_remove, + .remove_new = fimc_is_i2c_remove, .driver = { .of_match_table = fimc_is_i2c_of_match, .name = "fimc-isp-i2c", From patchwork Sun Mar 26 14:31:31 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= X-Patchwork-Id: 13188225 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 33FA6C761AF for ; Sun, 26 Mar 2023 14:34:03 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232489AbjCZOeC (ORCPT ); Sun, 26 Mar 2023 10:34:02 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60346 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232459AbjCZOcz (ORCPT ); Sun, 26 Mar 2023 10:32:55 -0400 Received: from metis.ext.pengutronix.de (metis.ext.pengutronix.de [IPv6:2001:67c:670:201:290:27ff:fe1d:cc33]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7E8317EDB for ; Sun, 26 Mar 2023 07:32:53 -0700 (PDT) Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.ext.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pgRQJ-0008TA-7P; Sun, 26 Mar 2023 16:32:43 +0200 Received: from [2a0a:edc0:0:900:1d::77] (helo=ptz.office.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtp (Exim 4.94.2) (envelope-from ) id 1pgRQG-006rdf-Bt; Sun, 26 Mar 2023 16:32:40 +0200 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1pgRQF-0088Xq-C4; Sun, 26 Mar 2023 16:32:39 +0200 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Sylwester Nawrocki , Mauro Carvalho Chehab , Krzysztof Kozlowski Cc: Alim Akhtar , linux-media@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-samsung-soc@vger.kernel.org, kernel@pengutronix.de Subject: [PATCH 064/117] media: fimc-is: Convert to platform remove callback returning void Date: Sun, 26 Mar 2023 16:31:31 +0200 Message-Id: <20230326143224.572654-67-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230326143224.572654-1-u.kleine-koenig@pengutronix.de> References: <20230326143224.572654-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1910; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=YoQhZHlKBWG3AsLKqLOSSczqOknOqCR/k6LMBg0SGGA=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBkIFbT3jVoeYt9UEn3O4P1tY69DK+FCDa5okK2Y KCo1VaGbd6JATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZCBW0wAKCRCPgPtYfRL+ TlfEB/0RmiaPfSi7/Id07Mc3czBQtlK/Ppgyf/m2bHrpHFeCvm6YnFfiCH807E42bCxgYJAaqBE zMAIn+Olsji48KVxXrPLUAZik93EOLufRPEesy7zhf60FT44zKoT0OhFqXaNX+ZDBIYV/ou5CRu OrWCW9DJPYBx50iEGp9u3u+e1LYVT//iGJdARFaxLuF7nD+8WqRmH6LuGgg0CvyNhOyAGZdIntZ Rd4rxs4uDopXdAVbEbWLoGF1KkzQ1pzpuHsMwTe21gL9V+06ueWMtprTHzUMiHxFocHCtnXaqJR eucJHGeDhYKlEImTTlyUkKXoaSOZPOQs2SPOVSuijEeCrRF5 X-Developer-Key: i=u.kleine-koenig@pengutronix.de; a=openpgp; fpr=0D2511F322BFAB1C1580266BE2DCDD9132669BD6 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.ext.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-media@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@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 (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 --- drivers/media/platform/samsung/exynos4-is/fimc-is.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/media/platform/samsung/exynos4-is/fimc-is.c b/drivers/media/platform/samsung/exynos4-is/fimc-is.c index a7704ff069d6..530a148fe4d3 100644 --- a/drivers/media/platform/samsung/exynos4-is/fimc-is.c +++ b/drivers/media/platform/samsung/exynos4-is/fimc-is.c @@ -915,7 +915,7 @@ static int fimc_is_suspend(struct device *dev) } #endif /* CONFIG_PM_SLEEP */ -static int fimc_is_remove(struct platform_device *pdev) +static void fimc_is_remove(struct platform_device *pdev) { struct device *dev = &pdev->dev; struct fimc_is *is = dev_get_drvdata(dev); @@ -932,8 +932,6 @@ static int fimc_is_remove(struct platform_device *pdev) fimc_is_debugfs_remove(is); release_firmware(is->fw.f_w); fimc_is_free_cpu_memory(is); - - return 0; } static const struct of_device_id fimc_is_of_match[] = { @@ -950,7 +948,7 @@ static const struct dev_pm_ops fimc_is_pm_ops = { static struct platform_driver fimc_is_driver = { .probe = fimc_is_probe, - .remove = fimc_is_remove, + .remove_new = fimc_is_remove, .driver = { .of_match_table = fimc_is_of_match, .name = FIMC_IS_DRV_NAME, From patchwork Sun Mar 26 14:31:32 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= X-Patchwork-Id: 13188230 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 48A91C74A5B for ; Sun, 26 Mar 2023 14:34:10 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232499AbjCZOeH (ORCPT ); Sun, 26 Mar 2023 10:34:07 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60630 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232259AbjCZOc4 (ORCPT ); Sun, 26 Mar 2023 10:32:56 -0400 Received: from metis.ext.pengutronix.de (metis.ext.pengutronix.de [IPv6:2001:67c:670:201:290:27ff:fe1d:cc33]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 047437D84 for ; Sun, 26 Mar 2023 07:32:53 -0700 (PDT) Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.ext.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pgRQJ-0008Te-Ho; Sun, 26 Mar 2023 16:32:43 +0200 Received: from [2a0a:edc0:0:900:1d::77] (helo=ptz.office.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtp (Exim 4.94.2) (envelope-from ) id 1pgRQG-006rds-Kc; Sun, 26 Mar 2023 16:32:40 +0200 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1pgRQF-0088Xv-I5; Sun, 26 Mar 2023 16:32:39 +0200 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Sylwester Nawrocki , Mauro Carvalho Chehab , Krzysztof Kozlowski Cc: Alim Akhtar , linux-media@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-samsung-soc@vger.kernel.org, kernel@pengutronix.de Subject: [PATCH 065/117] media: fimc-lite: Convert to platform remove callback returning void Date: Sun, 26 Mar 2023 16:31:32 +0200 Message-Id: <20230326143224.572654-68-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230326143224.572654-1-u.kleine-koenig@pengutronix.de> References: <20230326143224.572654-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1909; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=0uTItUIXkJCcUJYvgXMkvGjLYPdx5nocsdSdg4jWtgM=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBkIFbU1UKsF/Rg/nCtZNSPCovev4z3jgC0qdYgp gq16TJd04yJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZCBW1AAKCRCPgPtYfRL+ TrngB/9ZNdWqKHaggV70vY7by3ZFUjstBhusa4RkF/7A014pqcK4cJR9k49TFrGqenACY2HjKF2 MjSuMPLhaWbk2I9nJhA6MbvAfNmpubvB/g9IPxVqTDVMbdOSc3Zj1rfTbfE5v0xqNCABFhSoV+U Qnr56j8xs9IWKOKfgw21GK0Q8VXOZbut4USgUfN/WtyNsBp55TiuBKwy8i4vuoZmnMsCQKkUwaO BqCsOveuoxMfzwjolnFeM3BiFMRkCJ2aE5ij60PtguqGDX2LLvxlJ4gVlvpt9lhHx1RlC29qUoA 6O4aXV2q4Dp/xuXVL66LYoGTppaUA70r5iGYiRV1PkP8akZv X-Developer-Key: i=u.kleine-koenig@pengutronix.de; a=openpgp; fpr=0D2511F322BFAB1C1580266BE2DCDD9132669BD6 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.ext.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-media@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@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 (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 --- drivers/media/platform/samsung/exynos4-is/fimc-lite.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/drivers/media/platform/samsung/exynos4-is/fimc-lite.c b/drivers/media/platform/samsung/exynos4-is/fimc-lite.c index e185a40305a8..2fadb18560d7 100644 --- a/drivers/media/platform/samsung/exynos4-is/fimc-lite.c +++ b/drivers/media/platform/samsung/exynos4-is/fimc-lite.c @@ -1595,7 +1595,7 @@ static int fimc_lite_suspend(struct device *dev) } #endif /* CONFIG_PM_SLEEP */ -static int fimc_lite_remove(struct platform_device *pdev) +static void fimc_lite_remove(struct platform_device *pdev) { struct fimc_lite *fimc = platform_get_drvdata(pdev); struct device *dev = &pdev->dev; @@ -1610,7 +1610,6 @@ static int fimc_lite_remove(struct platform_device *pdev) fimc_lite_clk_put(fimc); dev_info(dev, "Driver unloaded\n"); - return 0; } static const struct dev_pm_ops fimc_lite_pm_ops = { @@ -1656,7 +1655,7 @@ MODULE_DEVICE_TABLE(of, flite_of_match); static struct platform_driver fimc_lite_driver = { .probe = fimc_lite_probe, - .remove = fimc_lite_remove, + .remove_new = fimc_lite_remove, .driver = { .of_match_table = flite_of_match, .name = FIMC_LITE_DRV_NAME, From patchwork Sun Mar 26 14:31:33 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= X-Patchwork-Id: 13188227 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id AF68FC77B62 for ; Sun, 26 Mar 2023 14:34:04 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232479AbjCZOeD (ORCPT ); Sun, 26 Mar 2023 10:34:03 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:32768 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232500AbjCZOcz (ORCPT ); Sun, 26 Mar 2023 10:32:55 -0400 Received: from metis.ext.pengutronix.de (metis.ext.pengutronix.de [IPv6:2001:67c:670:201:290:27ff:fe1d:cc33]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D464E7AB0 for ; Sun, 26 Mar 2023 07:32:53 -0700 (PDT) Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.ext.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pgRQJ-0008TT-Dp; Sun, 26 Mar 2023 16:32:43 +0200 Received: from [2a0a:edc0:0:900:1d::77] (helo=ptz.office.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtp (Exim 4.94.2) (envelope-from ) id 1pgRQG-006rdn-HA; Sun, 26 Mar 2023 16:32:40 +0200 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1pgRQF-0088Y0-Or; Sun, 26 Mar 2023 16:32:39 +0200 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Sylwester Nawrocki , Mauro Carvalho Chehab , Krzysztof Kozlowski Cc: Alim Akhtar , linux-media@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-samsung-soc@vger.kernel.org, kernel@pengutronix.de Subject: [PATCH 066/117] media: media-dev: Convert to platform remove callback returning void Date: Sun, 26 Mar 2023 16:31:33 +0200 Message-Id: <20230326143224.572654-69-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230326143224.572654-1-u.kleine-koenig@pengutronix.de> References: <20230326143224.572654-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=2075; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=fR+7i0Q7VbhWWGpxbF+Or52vl4QTHp55EWAHRayMtsU=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBkIFbV3gGUC0NrekqDM5AUKULJFCGOs7suvsmPj cDwQMcppZyJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZCBW1QAKCRCPgPtYfRL+ TtYNB/9moN33etmJ1WhTaL/TZZlnRdoZBEgv3KSIC2tje1scrWqkirUOHf43V5AWsQqMAYf2Qan oqhtsIQeb5IiiKS1gGvPyv6bAwqIrGzKQkOvXZljiWmy1m/L+9aSanjU1wBoFmLE+UaMuLly2wh PZiXt1cLED/yKhbp0YBNN9VtnMOrf5j1APjV6uGIXpnIlieXaHBHW7aBMW3yGnOo02xZy5TdCps hT4TuNZDrQmMZvmzx9STXyzDljeZLB8kmd2rEpfzRRCEGVa4MQgKnlhzX1SQ5e+eXPYNpQaUq4H QTOzMkGAqMi6u8A6dz4P1XM/Lw8DSapqhjVkJOWae907+R2R X-Developer-Key: i=u.kleine-koenig@pengutronix.de; a=openpgp; fpr=0D2511F322BFAB1C1580266BE2DCDD9132669BD6 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.ext.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-media@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@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 (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 --- drivers/media/platform/samsung/exynos4-is/media-dev.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/drivers/media/platform/samsung/exynos4-is/media-dev.c b/drivers/media/platform/samsung/exynos4-is/media-dev.c index 98a60f01129d..5ca78fee7804 100644 --- a/drivers/media/platform/samsung/exynos4-is/media-dev.c +++ b/drivers/media/platform/samsung/exynos4-is/media-dev.c @@ -1530,12 +1530,12 @@ static int fimc_md_probe(struct platform_device *pdev) return ret; } -static int fimc_md_remove(struct platform_device *pdev) +static void fimc_md_remove(struct platform_device *pdev) { struct fimc_md *fmd = platform_get_drvdata(pdev); if (!fmd) - return 0; + return; fimc_md_unregister_clk_provider(fmd); v4l2_async_nf_unregister(&fmd->subdev_notifier); @@ -1548,8 +1548,6 @@ static int fimc_md_remove(struct platform_device *pdev) media_device_unregister(&fmd->media_dev); media_device_cleanup(&fmd->media_dev); fimc_md_put_clocks(fmd); - - return 0; } static const struct platform_device_id fimc_driver_ids[] __always_unused = { @@ -1566,7 +1564,7 @@ MODULE_DEVICE_TABLE(of, fimc_md_of_match); static struct platform_driver fimc_md_driver = { .probe = fimc_md_probe, - .remove = fimc_md_remove, + .remove_new = fimc_md_remove, .driver = { .of_match_table = of_match_ptr(fimc_md_of_match), .name = "s5p-fimc-md", From patchwork Sun Mar 26 14:31:34 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= X-Patchwork-Id: 13188229 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 55E55C761AF for ; Sun, 26 Mar 2023 14:34:07 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232493AbjCZOeF (ORCPT ); Sun, 26 Mar 2023 10:34:05 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60368 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232387AbjCZOc4 (ORCPT ); Sun, 26 Mar 2023 10:32:56 -0400 Received: from metis.ext.pengutronix.de (metis.ext.pengutronix.de [IPv6:2001:67c:670:201:290:27ff:fe1d:cc33]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4E67D7ABB for ; Sun, 26 Mar 2023 07:32:54 -0700 (PDT) Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.ext.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pgRQJ-0008Ti-Im; Sun, 26 Mar 2023 16:32:43 +0200 Received: from [2a0a:edc0:0:900:1d::77] (helo=ptz.office.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtp (Exim 4.94.2) (envelope-from ) id 1pgRQG-006rdu-MN; Sun, 26 Mar 2023 16:32:40 +0200 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1pgRQF-0088Y5-V8; Sun, 26 Mar 2023 16:32:39 +0200 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Sylwester Nawrocki , Mauro Carvalho Chehab , Krzysztof Kozlowski Cc: Alim Akhtar , linux-media@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-samsung-soc@vger.kernel.org, kernel@pengutronix.de Subject: [PATCH 067/117] media: mipi-csis: Convert to platform remove callback returning void Date: Sun, 26 Mar 2023 16:31:34 +0200 Message-Id: <20230326143224.572654-70-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230326143224.572654-1-u.kleine-koenig@pengutronix.de> References: <20230326143224.572654-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1899; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=mY73QFpgRxNcKjqUvYcR4GWNYI+mT0BWY3J0eONn9xc=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBkIFbWO5mJP7fcRhNOKip7n58IkQutGAFFw0tCn 3XtNW0/HoKJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZCBW1gAKCRCPgPtYfRL+ TlytB/wJRDahhP6YpwzaZN3S3D+YHv6A77HB2H+9jXKah5qqwWRdG1N6FsSlR7Ehaz5ZWaWmXuD eUdrfnrNjvCU86XRu80cQoaIey949jP+/F67rNG6N4KjBEVm+ghLU5pzeJUK6PgibR/fj47HCNA fxAlnVJypSCRI668qPINBlkx2awlUK86Bj5KO97zw/KMIawkBKAoPCg6dxbvJPsOJCuF3SGzJPQ pFy9uV5YY+hlXl7fxlCnXRZlciRpgWgD8wLz6bC1Jdr9HnvTqx5jEEENgx5gaDjrUDuZQBqhT0o q5wEZnKfIlqg0zNls+ei6J+dPoiXALNVsyfBZaorJloYYSUw X-Developer-Key: i=u.kleine-koenig@pengutronix.de; a=openpgp; fpr=0D2511F322BFAB1C1580266BE2DCDD9132669BD6 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.ext.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-media@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@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 (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 --- drivers/media/platform/samsung/exynos4-is/mipi-csis.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/media/platform/samsung/exynos4-is/mipi-csis.c b/drivers/media/platform/samsung/exynos4-is/mipi-csis.c index 6a0d35f33e8c..686ca8753ba2 100644 --- a/drivers/media/platform/samsung/exynos4-is/mipi-csis.c +++ b/drivers/media/platform/samsung/exynos4-is/mipi-csis.c @@ -975,7 +975,7 @@ static int s5pcsis_runtime_resume(struct device *dev) } #endif -static int s5pcsis_remove(struct platform_device *pdev) +static void s5pcsis_remove(struct platform_device *pdev) { struct v4l2_subdev *sd = platform_get_drvdata(pdev); struct csis_state *state = sd_to_csis_state(sd); @@ -987,8 +987,6 @@ static int s5pcsis_remove(struct platform_device *pdev) s5pcsis_clk_put(state); media_entity_cleanup(&state->sd.entity); - - return 0; } static const struct dev_pm_ops s5pcsis_pm_ops = { @@ -1022,7 +1020,7 @@ MODULE_DEVICE_TABLE(of, s5pcsis_of_match); static struct platform_driver s5pcsis_driver = { .probe = s5pcsis_probe, - .remove = s5pcsis_remove, + .remove_new = s5pcsis_remove, .driver = { .of_match_table = s5pcsis_of_match, .name = CSIS_DRIVER_NAME, From patchwork Sun Mar 26 14:31:35 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= X-Patchwork-Id: 13188179 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id BBE77C761AF for ; Sun, 26 Mar 2023 14:33:35 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232443AbjCZOde (ORCPT ); Sun, 26 Mar 2023 10:33:34 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60370 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232455AbjCZOcs (ORCPT ); Sun, 26 Mar 2023 10:32:48 -0400 Received: from metis.ext.pengutronix.de (metis.ext.pengutronix.de [IPv6:2001:67c:670:201:290:27ff:fe1d:cc33]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2DC2D7DA7 for ; Sun, 26 Mar 2023 07:32:48 -0700 (PDT) Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.ext.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pgRQJ-0008UF-Iv; Sun, 26 Mar 2023 16:32:43 +0200 Received: from [2a0a:edc0:0:900:1d::77] (helo=ptz.office.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtp (Exim 4.94.2) (envelope-from ) id 1pgRQH-006re1-0O; Sun, 26 Mar 2023 16:32:41 +0200 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1pgRQG-0088Y8-6n; Sun, 26 Mar 2023 16:32:40 +0200 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Sylwester Nawrocki , Mauro Carvalho Chehab Cc: linux-media@vger.kernel.org, linux-samsung-soc@vger.kernel.org, kernel@pengutronix.de Subject: [PATCH 068/117] media: camif-core: Convert to platform remove callback returning void Date: Sun, 26 Mar 2023 16:31:35 +0200 Message-Id: <20230326143224.572654-71-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230326143224.572654-1-u.kleine-koenig@pengutronix.de> References: <20230326143224.572654-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1950; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=Cv5AoPt1iE8Vv29bdDGa7hcCGTrahdWceom2lSpe14o=; b=owGbwMvMwMXY3/A7olbonx/jabUkhhSFsOvetjV81Q58Fbt+rNTmzeWvryg6HCmmy155oZhvp kXXvB+djMYsDIxcDLJiiiz2jWsyrarkIjvX/rsMM4iVCWQKAxenAEzkwhkOhllX1jeY7Huz/WXT LZ3bbfcvOiV9Yn8uvDfXmGemWEbLc77vrQms3P+d9NnM11SHaGV7zldsOtVyiPXvjMfWBive+K4 rij4X4uWa8LChStZhYmiCaYp8ScmEwrxnTfGrNe9tv73i24UV9k32hzhLDQ33R+s328YI/Wh43m xWuLvm+0oJ476jVeU/ndYmsmeK+k4QNBHUu+oSHtiyY36Ml8LeE2JbNRI9FRuiym+YZ3EFX0h+y jm3rEPhtMJaxV5b40k1+gcm7PkQ+3rG7duGn52yXy4qei607aD84zcPJ8xyWtButscyP8yx3/HV q9MvJpzf4DOxSjBpXubX193Gr/5qbW3cLrbmgPEtpThPAA== X-Developer-Key: i=u.kleine-koenig@pengutronix.de; a=openpgp; fpr=0D2511F322BFAB1C1580266BE2DCDD9132669BD6 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.ext.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-media@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@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 (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 --- drivers/media/platform/samsung/s3c-camif/camif-core.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/media/platform/samsung/s3c-camif/camif-core.c b/drivers/media/platform/samsung/s3c-camif/camif-core.c index 6e8ef86566b7..0b50183d9230 100644 --- a/drivers/media/platform/samsung/s3c-camif/camif-core.c +++ b/drivers/media/platform/samsung/s3c-camif/camif-core.c @@ -507,7 +507,7 @@ static int s3c_camif_probe(struct platform_device *pdev) return ret; } -static int s3c_camif_remove(struct platform_device *pdev) +static void s3c_camif_remove(struct platform_device *pdev) { struct camif_dev *camif = platform_get_drvdata(pdev); struct s3c_camif_plat_data *pdata = &camif->pdata; @@ -521,8 +521,6 @@ static int s3c_camif_remove(struct platform_device *pdev) camif_clk_put(camif); s3c_camif_unregister_subdev(camif); pdata->gpio_put(); - - return 0; } static int s3c_camif_runtime_resume(struct device *dev) @@ -623,7 +621,7 @@ static const struct dev_pm_ops s3c_camif_pm_ops = { static struct platform_driver s3c_camif_driver = { .probe = s3c_camif_probe, - .remove = s3c_camif_remove, + .remove_new = s3c_camif_remove, .id_table = s3c_camif_driver_ids, .driver = { .name = S3C_CAMIF_DRIVER_NAME, From patchwork Sun Mar 26 14:31:36 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= X-Patchwork-Id: 13188223 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 8AB67C77B62 for ; Sun, 26 Mar 2023 14:34:01 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232460AbjCZOd7 (ORCPT ); Sun, 26 Mar 2023 10:33:59 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60370 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232489AbjCZOcy (ORCPT ); Sun, 26 Mar 2023 10:32:54 -0400 Received: from metis.ext.pengutronix.de (metis.ext.pengutronix.de [IPv6:2001:67c:670:201:290:27ff:fe1d:cc33]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B63757AAB for ; Sun, 26 Mar 2023 07:32:52 -0700 (PDT) Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.ext.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pgRQJ-0008UY-Vx; Sun, 26 Mar 2023 16:32:44 +0200 Received: from [2a0a:edc0:0:900:1d::77] (helo=ptz.office.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtp (Exim 4.94.2) (envelope-from ) id 1pgRQH-006re6-7G; Sun, 26 Mar 2023 16:32:41 +0200 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1pgRQG-0088YD-EA; Sun, 26 Mar 2023 16:32:40 +0200 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: =?utf-8?q?=C5=81ukasz_Stelmach?= , Mauro Carvalho Chehab Cc: linux-arm-kernel@lists.infradead.org, linux-media@vger.kernel.org, kernel@pengutronix.de Subject: [PATCH 069/117] media: g2d: Convert to platform remove callback returning void Date: Sun, 26 Mar 2023 16:31:36 +0200 Message-Id: <20230326143224.572654-72-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230326143224.572654-1-u.kleine-koenig@pengutronix.de> References: <20230326143224.572654-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1755; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=Pjp63zOLNnq1816vUxN+0dBZPM6OKh7jFCklpMDKqZ8=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBkIFbYdqkJMOcgGfQZHo+nlYPWSslTdvXzowB/t nJw1uCHufWJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZCBW2AAKCRCPgPtYfRL+ TksrB/9Xte0wAuJ3tjgEtEX3iOLqW8H8HjxhncIH8pbg5HQSFRHWIleTjvJemiKOYkBY5AQAq7e NnAYM9zzsJmbuJjiRuoERyTN2QATMRgCSc0N7oLJGQD8MlXXx/Pei4+/aALhvR1vKs+3DGQ0Gni Z/kMESK3jS0jNnZ4xc6lfE8FH8c5sVLb4T3MZIMlFa/D5xStPWIwkOeV2jpzWY/h50GWgUk6/rn PJaOqeOX9PWK1CgeT0kLF8jTxG5lbmqGFaWbVCBRHz+75MBWQPpWaAA9bfztTAd1xljExhIe+B2 3lG36JHISKCFuawLXmxj74gZfOPc23h49iaS+QrO/DTQzduZ X-Developer-Key: i=u.kleine-koenig@pengutronix.de; a=openpgp; fpr=0D2511F322BFAB1C1580266BE2DCDD9132669BD6 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.ext.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-media@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@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 (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 Reviewed-by: Łukasz Stelmach --- drivers/media/platform/samsung/s5p-g2d/g2d.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/drivers/media/platform/samsung/s5p-g2d/g2d.c b/drivers/media/platform/samsung/s5p-g2d/g2d.c index dd8864779a7c..89aeba47ed07 100644 --- a/drivers/media/platform/samsung/s5p-g2d/g2d.c +++ b/drivers/media/platform/samsung/s5p-g2d/g2d.c @@ -740,7 +740,7 @@ static int g2d_probe(struct platform_device *pdev) return ret; } -static int g2d_remove(struct platform_device *pdev) +static void g2d_remove(struct platform_device *pdev) { struct g2d_dev *dev = platform_get_drvdata(pdev); @@ -753,7 +753,6 @@ static int g2d_remove(struct platform_device *pdev) clk_put(dev->gate); clk_unprepare(dev->clk); clk_put(dev->clk); - return 0; } static struct g2d_variant g2d_drvdata_v3x = { @@ -778,7 +777,7 @@ MODULE_DEVICE_TABLE(of, exynos_g2d_match); static struct platform_driver g2d_pdrv = { .probe = g2d_probe, - .remove = g2d_remove, + .remove_new = g2d_remove, .driver = { .name = G2D_NAME, .of_match_table = exynos_g2d_match, From patchwork Sun Mar 26 14:31:37 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= X-Patchwork-Id: 13188224 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 74B98C74A5B for ; Sun, 26 Mar 2023 14:34:02 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232433AbjCZOeB (ORCPT ); Sun, 26 Mar 2023 10:34:01 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60336 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232491AbjCZOcy (ORCPT ); Sun, 26 Mar 2023 10:32:54 -0400 Received: from metis.ext.pengutronix.de (metis.ext.pengutronix.de [IPv6:2001:67c:670:201:290:27ff:fe1d:cc33]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B691F7EC8 for ; Sun, 26 Mar 2023 07:32:52 -0700 (PDT) Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.ext.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pgRQJ-0008UZ-Ty; Sun, 26 Mar 2023 16:32:43 +0200 Received: from [2a0a:edc0:0:900:1d::77] (helo=ptz.office.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtp (Exim 4.94.2) (envelope-from ) id 1pgRQH-006re5-7Z; Sun, 26 Mar 2023 16:32:41 +0200 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1pgRQG-0088YK-KM; Sun, 26 Mar 2023 16:32:40 +0200 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Andrzej Pietrasiewicz , Jacek Anaszewski , Sylwester Nawrocki , Mauro Carvalho Chehab Cc: linux-arm-kernel@lists.infradead.org, linux-media@vger.kernel.org, kernel@pengutronix.de Subject: [PATCH 070/117] media: jpeg-core: Convert to platform remove callback returning void Date: Sun, 26 Mar 2023 16:31:37 +0200 Message-Id: <20230326143224.572654-73-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230326143224.572654-1-u.kleine-koenig@pengutronix.de> References: <20230326143224.572654-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1887; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=K8YXHA6An9VeSpuL+P9agQFsMTbpUA1rmCBKufhs3os=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBkIFbZwa0OM/K6Y6TcUKe458TpAeLUaR5YJ3rY+ ZtgIJ3sA4yJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZCBW2QAKCRCPgPtYfRL+ TqpfB/9rz1jd28FVNI1BdLMJ0DvqA2ksfzFrqunRzHssPt4Drrc94dtHxZDRaP9kTelWcHwISxu l3FHXpxRLeCVjEih7FL+YdVIDOr222YzAlJ2IOCN/gKLPP13wxBihB2VEJCMeRQI+016CjEDxLn HrbP7Wx0k5ih3jW7qDr7xHu6tF7dcn0yQ8/Mt5zzFzSYCgad9cBciAGH/yzgpIcs8zB1bbFO1Qe tB5xm/iBXHKpZ2IvdEMSQDhNAGKpnYAFX1/ZLwxzGO9j/FWke77e9pEqawo4Bej2khaKwcUNa2k iZj8kXHNdjeztVvM8n3Bx9AIBSBGIPuTiiqY2O7DoKYCWNn8 X-Developer-Key: i=u.kleine-koenig@pengutronix.de; a=openpgp; fpr=0D2511F322BFAB1C1580266BE2DCDD9132669BD6 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.ext.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-media@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@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 (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 Acked-by: Andrzej Pietrasiewicz --- drivers/media/platform/samsung/s5p-jpeg/jpeg-core.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/media/platform/samsung/s5p-jpeg/jpeg-core.c b/drivers/media/platform/samsung/s5p-jpeg/jpeg-core.c index 55814041b8d8..c3c7e48f1b6e 100644 --- a/drivers/media/platform/samsung/s5p-jpeg/jpeg-core.c +++ b/drivers/media/platform/samsung/s5p-jpeg/jpeg-core.c @@ -2991,7 +2991,7 @@ static int s5p_jpeg_probe(struct platform_device *pdev) return ret; } -static int s5p_jpeg_remove(struct platform_device *pdev) +static void s5p_jpeg_remove(struct platform_device *pdev) { struct s5p_jpeg *jpeg = platform_get_drvdata(pdev); int i; @@ -3008,8 +3008,6 @@ static int s5p_jpeg_remove(struct platform_device *pdev) for (i = jpeg->variant->num_clocks - 1; i >= 0; i--) clk_disable_unprepare(jpeg->clocks[i]); } - - return 0; } #ifdef CONFIG_PM @@ -3164,7 +3162,7 @@ static void *jpeg_get_drv_data(struct device *dev) static struct platform_driver s5p_jpeg_driver = { .probe = s5p_jpeg_probe, - .remove = s5p_jpeg_remove, + .remove_new = s5p_jpeg_remove, .driver = { .of_match_table = of_match_ptr(samsung_jpeg_match), .name = S5P_JPEG_M2M_NAME, From patchwork Sun Mar 26 14:31:38 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= X-Patchwork-Id: 13188241 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 5E98BC74A5B for ; Sun, 26 Mar 2023 14:34:19 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232527AbjCZOeS (ORCPT ); Sun, 26 Mar 2023 10:34:18 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:32776 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232528AbjCZOdA (ORCPT ); Sun, 26 Mar 2023 10:33:00 -0400 Received: from metis.ext.pengutronix.de (metis.ext.pengutronix.de [IPv6:2001:67c:670:201:290:27ff:fe1d:cc33]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D6D1410F5 for ; Sun, 26 Mar 2023 07:32:55 -0700 (PDT) Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.ext.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pgRQM-0008Vn-2h; Sun, 26 Mar 2023 16:32:46 +0200 Received: from [2a0a:edc0:0:900:1d::77] (helo=ptz.office.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtp (Exim 4.94.2) (envelope-from ) id 1pgRQI-006reH-0h; Sun, 26 Mar 2023 16:32:42 +0200 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1pgRQG-0088YP-Tu; Sun, 26 Mar 2023 16:32:40 +0200 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Marek Szyprowski , Andrzej Hajda , Mauro Carvalho Chehab Cc: linux-arm-kernel@lists.infradead.org, linux-media@vger.kernel.org, kernel@pengutronix.de Subject: [PATCH 071/117] media: s5p_mfc: Convert to platform remove callback returning void Date: Sun, 26 Mar 2023 16:31:38 +0200 Message-Id: <20230326143224.572654-74-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230326143224.572654-1-u.kleine-koenig@pengutronix.de> References: <20230326143224.572654-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1818; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=POKZFpij1G0A5FGdAey8RIk/pX8gSv8910ObNKDVQZI=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBkIFbbRUsksmB82lUWVdPtKzggqQbQ8MLkyWDW9 htTyQx9q3CJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZCBW2wAKCRCPgPtYfRL+ Tre8B/939ec9m4A8vt1/3afsJDBbytHUmyex/kph9TTBE38+OGfiQqS5sX1Y5BCsdbUU/SqWFDb /APHGPPENxRt/4gG1Y3jF8b2P9OxQ5+5N1JQW+l4L6jnNJGHCsUDdc4j6puVD0YUKitTQnB/XdB KNAoFbawf8O5cXLpuFULS3vab9ft8Dd4l/Tb+K0MGzcjIErKSVQWwk4RBsHDVk7DD8VOTuugV1C fFLbk0xlw8xRkbEZsM3377FjCocdzvfSztGfRReA6u1qek44WWjIcD/10uHr7Kck9jWgO0Xy7kK Epgo1j+wDi8jCtQPVHubvNRzpic9qeVNCedUrAt1wEo55x9N X-Developer-Key: i=u.kleine-koenig@pengutronix.de; a=openpgp; fpr=0D2511F322BFAB1C1580266BE2DCDD9132669BD6 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.ext.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-media@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@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 (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 Reviewed-by: Andrzej Hajda --- drivers/media/platform/samsung/s5p-mfc/s5p_mfc.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/drivers/media/platform/samsung/s5p-mfc/s5p_mfc.c b/drivers/media/platform/samsung/s5p-mfc/s5p_mfc.c index 9d2cce124a34..e30e54935d79 100644 --- a/drivers/media/platform/samsung/s5p-mfc/s5p_mfc.c +++ b/drivers/media/platform/samsung/s5p-mfc/s5p_mfc.c @@ -1431,7 +1431,7 @@ static int s5p_mfc_probe(struct platform_device *pdev) } /* Remove the driver */ -static int s5p_mfc_remove(struct platform_device *pdev) +static void s5p_mfc_remove(struct platform_device *pdev) { struct s5p_mfc_dev *dev = platform_get_drvdata(pdev); struct s5p_mfc_ctx *ctx; @@ -1463,7 +1463,6 @@ static int s5p_mfc_remove(struct platform_device *pdev) s5p_mfc_unconfigure_dma_memory(dev); s5p_mfc_final_pm(dev); - return 0; } #ifdef CONFIG_PM_SLEEP @@ -1690,7 +1689,7 @@ MODULE_DEVICE_TABLE(of, exynos_mfc_match); static struct platform_driver s5p_mfc_driver = { .probe = s5p_mfc_probe, - .remove = s5p_mfc_remove, + .remove_new = s5p_mfc_remove, .driver = { .name = S5P_MFC_NAME, .pm = &s5p_mfc_pm_ops, From patchwork Sun Mar 26 14:31:39 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= X-Patchwork-Id: 13188185 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 2A2C7C74A5B for ; Sun, 26 Mar 2023 14:33:41 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232576AbjCZOdj (ORCPT ); Sun, 26 Mar 2023 10:33:39 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60672 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232463AbjCZOcv (ORCPT ); Sun, 26 Mar 2023 10:32:51 -0400 Received: from metis.ext.pengutronix.de (metis.ext.pengutronix.de [IPv6:2001:67c:670:201:290:27ff:fe1d:cc33]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E33247DA8 for ; Sun, 26 Mar 2023 07:32:49 -0700 (PDT) Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.ext.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pgRQL-00006I-EB; Sun, 26 Mar 2023 16:32:45 +0200 Received: from [2a0a:edc0:0:900:1d::77] (helo=ptz.office.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtp (Exim 4.94.2) (envelope-from ) id 1pgRQI-006reU-Ok; Sun, 26 Mar 2023 16:32:42 +0200 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1pgRQH-0088YT-4h; Sun, 26 Mar 2023 16:32:41 +0200 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Fabien Dessenne , Mauro Carvalho Chehab Cc: linux-media@vger.kernel.org, kernel@pengutronix.de Subject: [PATCH 072/117] media: bdisp-v4l2: Convert to platform remove callback returning void Date: Sun, 26 Mar 2023 16:31:39 +0200 Message-Id: <20230326143224.572654-75-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230326143224.572654-1-u.kleine-koenig@pengutronix.de> References: <20230326143224.572654-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1917; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=6oNpflcOfl1SzEjPbuYEUR09Hb2dlSPtdmiOhtCulig=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBkIFbc+I+q3kfUf8JJojWW18kLNbE1jeCcJcdsc wl+ohfs+ZKJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZCBW3AAKCRCPgPtYfRL+ Tl4HB/9ib9yNl+1dZIMR38U9WiJyCh6cNX6bd3eYEYJkW1skVMaurJQi6ph6s1KW2TLjkwlmJ/k XgRau5UdrltUMCtlKTh+of357GkB12cgVDY3awoHjiUyzAr4ond8bNzta4ZIVDTuOB0gtcrmI/A IgooRUgWNyOeC4IDEp755EO+CAPbQXs8tPY79gUOYfe2gTkYBzrndN9Hr0BeBl/ZDSNkmRGN67r zEUzZWK+uYrLCeO+1o9bT/Mt43PndRrnNKnHU2HEqAC9VED27mLXVw+RIc3K+BdGpa0viXGxePn 2FAfi7gpCAJpEV8c+aodrGwMnZdqT3vEedRgJ83etjcUfNCf X-Developer-Key: i=u.kleine-koenig@pengutronix.de; a=openpgp; fpr=0D2511F322BFAB1C1580266BE2DCDD9132669BD6 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.ext.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-media@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@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 (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 --- drivers/media/platform/st/sti/bdisp/bdisp-v4l2.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/media/platform/st/sti/bdisp/bdisp-v4l2.c b/drivers/media/platform/st/sti/bdisp/bdisp-v4l2.c index dd74cc43920d..4471b5c944ca 100644 --- a/drivers/media/platform/st/sti/bdisp/bdisp-v4l2.c +++ b/drivers/media/platform/st/sti/bdisp/bdisp-v4l2.c @@ -1257,7 +1257,7 @@ static const struct dev_pm_ops bdisp_pm_ops = { .runtime_resume = bdisp_runtime_resume, }; -static int bdisp_remove(struct platform_device *pdev) +static void bdisp_remove(struct platform_device *pdev) { struct bdisp_dev *bdisp = platform_get_drvdata(pdev); @@ -1277,8 +1277,6 @@ static int bdisp_remove(struct platform_device *pdev) destroy_workqueue(bdisp->work_queue); dev_dbg(&pdev->dev, "%s driver unloaded\n", pdev->name); - - return 0; } static int bdisp_probe(struct platform_device *pdev) @@ -1411,7 +1409,7 @@ MODULE_DEVICE_TABLE(of, bdisp_match_types); static struct platform_driver bdisp_driver = { .probe = bdisp_probe, - .remove = bdisp_remove, + .remove_new = bdisp_remove, .driver = { .name = BDISP_NAME, .of_match_table = bdisp_match_types, From patchwork Sun Mar 26 14:31:40 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= X-Patchwork-Id: 13188216 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 8B187C6FD1C for ; Sun, 26 Mar 2023 14:33:51 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229959AbjCZOdu (ORCPT ); Sun, 26 Mar 2023 10:33:50 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60656 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232449AbjCZOcy (ORCPT ); Sun, 26 Mar 2023 10:32:54 -0400 Received: from metis.ext.pengutronix.de (metis.ext.pengutronix.de [IPv6:2001:67c:670:201:290:27ff:fe1d:cc33]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6EF857DB0 for ; Sun, 26 Mar 2023 07:32:52 -0700 (PDT) Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.ext.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pgRQK-0008Vl-Pu; Sun, 26 Mar 2023 16:32:44 +0200 Received: from [2a0a:edc0:0:900:1d::77] (helo=ptz.office.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtp (Exim 4.94.2) (envelope-from ) id 1pgRQH-006reG-Va; Sun, 26 Mar 2023 16:32:41 +0200 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1pgRQH-0088YX-BA; Sun, 26 Mar 2023 16:32:41 +0200 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Patrice Chotard , Mauro Carvalho Chehab Cc: linux-arm-kernel@lists.infradead.org, linux-media@vger.kernel.org, kernel@pengutronix.de Subject: [PATCH 073/117] media: c8sectpfe-core: Convert to platform remove callback returning void Date: Sun, 26 Mar 2023 16:31:40 +0200 Message-Id: <20230326143224.572654-76-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230326143224.572654-1-u.kleine-koenig@pengutronix.de> References: <20230326143224.572654-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1859; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=H7nHpQzjHc2P2nAVdyZEagsXwm5a4h2lLK7N8YxEAqc=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBkIFbdZqhYr563DtnBDGjjmqMp9STd11DCyou+A wu8xS6K0diJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZCBW3QAKCRCPgPtYfRL+ TtW/B/9fn10iHM3G+gmvdye0gnp0ukGjhLibCuxvyfyb2mXfQF1SbaTSlavvXW3aHbarTg10tmC U7zxHPVbTly+FCsXSqnZJTe7Pe2lau/u09Ui+F4KexHCRgcE+gyB7kjaECESPowYvotfBVXkbCT cd6WR6b2Kepz94SSmDV0YaqDGM8uVu3QqaoRjftaYEtaSGRdlOL0GoPJGK5ORrx6Im6GVesSL5r LpBQ+eNXODjXo3JK4EJXfF/m0xtxIUNkmFZcr5jGyR5cjNYBcJn8vzu7W0/EnTw52yJQGhy+b0P e0hENoar1l6XV2D7KDtWyx9qz/xjw4Q8JLzG07JYExK5ja5J X-Developer-Key: i=u.kleine-koenig@pengutronix.de; a=openpgp; fpr=0D2511F322BFAB1C1580266BE2DCDD9132669BD6 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.ext.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-media@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@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 (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 --- drivers/media/platform/st/sti/c8sectpfe/c8sectpfe-core.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/media/platform/st/sti/c8sectpfe/c8sectpfe-core.c b/drivers/media/platform/st/sti/c8sectpfe/c8sectpfe-core.c index c38b62d4f1ae..45ade7210d26 100644 --- a/drivers/media/platform/st/sti/c8sectpfe/c8sectpfe-core.c +++ b/drivers/media/platform/st/sti/c8sectpfe/c8sectpfe-core.c @@ -878,7 +878,7 @@ static int c8sectpfe_probe(struct platform_device *pdev) return ret; } -static int c8sectpfe_remove(struct platform_device *pdev) +static void c8sectpfe_remove(struct platform_device *pdev) { struct c8sectpfei *fei = platform_get_drvdata(pdev); struct channel_info *channel; @@ -910,8 +910,6 @@ static int c8sectpfe_remove(struct platform_device *pdev) writel(0, fei->io + SYS_OTHER_CLKEN); clk_disable_unprepare(fei->c8sectpfeclk); - - return 0; } @@ -1178,7 +1176,7 @@ static struct platform_driver c8sectpfe_driver = { .of_match_table = of_match_ptr(c8sectpfe_match), }, .probe = c8sectpfe_probe, - .remove = c8sectpfe_remove, + .remove_new = c8sectpfe_remove, }; module_platform_driver(c8sectpfe_driver); From patchwork Sun Mar 26 14:31:41 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= X-Patchwork-Id: 13188210 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 39BEDC761AF for ; Sun, 26 Mar 2023 14:33:45 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232590AbjCZOdn (ORCPT ); Sun, 26 Mar 2023 10:33:43 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60346 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231873AbjCZOcx (ORCPT ); Sun, 26 Mar 2023 10:32:53 -0400 Received: from metis.ext.pengutronix.de (metis.ext.pengutronix.de [IPv6:2001:67c:670:201:290:27ff:fe1d:cc33]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3B81B6EA9 for ; Sun, 26 Mar 2023 07:32:51 -0700 (PDT) Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.ext.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pgRQM-00009n-E1; Sun, 26 Mar 2023 16:32:46 +0200 Received: from [2a0a:edc0:0:900:1d::77] (helo=ptz.office.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtp (Exim 4.94.2) (envelope-from ) id 1pgRQJ-006rew-Qm; Sun, 26 Mar 2023 16:32:43 +0200 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1pgRQH-0088Yb-It; Sun, 26 Mar 2023 16:32:41 +0200 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Hugues Fruchet , Mauro Carvalho Chehab Cc: linux-media@vger.kernel.org, kernel@pengutronix.de Subject: [PATCH 074/117] media: delta-v4l2: Convert to platform remove callback returning void Date: Sun, 26 Mar 2023 16:31:41 +0200 Message-Id: <20230326143224.572654-77-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230326143224.572654-1-u.kleine-koenig@pengutronix.de> References: <20230326143224.572654-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1831; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=8rJPa2DN2WuRRbtRSD/4TJy3aLcy8SIIQ4v3bRJY0to=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBkIFbeBP2WP6mPd6BxVzz6lGlqTOCJLGLZ+tCnz MuZmPivZwGJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZCBW3gAKCRCPgPtYfRL+ TmNZCACo5HJ6wxo6oReSUVkBqHwNeCIHKN4DeqepntoI5Ov8h2RKCvnRYD9o/3CbaDvdsL7szB9 RVLc+kFWwvqFa94cqPJAFiYlhGUHedNZnJKhgLelJ2tokJ9ayKVC4dR4QZzwFqDncHFA6+k1pMa LT3N6KjM9mQe7p/w+vPS9HzZIdx0VgL0YwAPYPnoW3kBFBi9bPnPiL8bLzYSyggE5sqSv3sGQh+ jkvgmuu/KjsM/uc/GDPXDgDSvhbxYAahaOsgbsmompFxPQnkvhWOYVCM17ZcE8eIAgkiAt0BLR/ 6YMPQM3JVUbtVv22lpvGalhi32JXV5Y+6vg/XnOdA1Fwd7HI X-Developer-Key: i=u.kleine-koenig@pengutronix.de; a=openpgp; fpr=0D2511F322BFAB1C1580266BE2DCDD9132669BD6 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.ext.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-media@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@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 (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 --- drivers/media/platform/st/sti/delta/delta-v4l2.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/media/platform/st/sti/delta/delta-v4l2.c b/drivers/media/platform/st/sti/delta/delta-v4l2.c index 03eaee6d15da..da402d1e9171 100644 --- a/drivers/media/platform/st/sti/delta/delta-v4l2.c +++ b/drivers/media/platform/st/sti/delta/delta-v4l2.c @@ -1900,7 +1900,7 @@ static int delta_probe(struct platform_device *pdev) return ret; } -static int delta_remove(struct platform_device *pdev) +static void delta_remove(struct platform_device *pdev) { struct delta_dev *delta = platform_get_drvdata(pdev); @@ -1914,8 +1914,6 @@ static int delta_remove(struct platform_device *pdev) pm_runtime_disable(delta->dev); v4l2_device_unregister(&delta->v4l2_dev); - - return 0; } static int delta_runtime_suspend(struct device *dev) @@ -1956,7 +1954,7 @@ MODULE_DEVICE_TABLE(of, delta_match_types); static struct platform_driver delta_driver = { .probe = delta_probe, - .remove = delta_remove, + .remove_new = delta_remove, .driver = { .name = DELTA_NAME, .of_match_table = delta_match_types, From patchwork Sun Mar 26 14:31:42 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= X-Patchwork-Id: 13188209 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 2049DC77B62 for ; Sun, 26 Mar 2023 14:33:44 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232587AbjCZOdn (ORCPT ); Sun, 26 Mar 2023 10:33:43 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60622 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232476AbjCZOcw (ORCPT ); Sun, 26 Mar 2023 10:32:52 -0400 Received: from metis.ext.pengutronix.de (metis.ext.pengutronix.de [IPv6:2001:67c:670:201:290:27ff:fe1d:cc33]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id AC6DB7A8F for ; Sun, 26 Mar 2023 07:32:50 -0700 (PDT) Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.ext.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pgRQL-00008q-St; Sun, 26 Mar 2023 16:32:45 +0200 Received: from [2a0a:edc0:0:900:1d::77] (helo=ptz.office.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtp (Exim 4.94.2) (envelope-from ) id 1pgRQJ-006rej-IW; Sun, 26 Mar 2023 16:32:43 +0200 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1pgRQH-0088Ye-Pm; Sun, 26 Mar 2023 16:32:41 +0200 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Jean-Christophe Trotin , Mauro Carvalho Chehab Cc: linux-media@vger.kernel.org, kernel@pengutronix.de Subject: [PATCH 075/117] media: hva-v4l2: Convert to platform remove callback returning void Date: Sun, 26 Mar 2023 16:31:42 +0200 Message-Id: <20230326143224.572654-78-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230326143224.572654-1-u.kleine-koenig@pengutronix.de> References: <20230326143224.572654-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1803; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=VH1GFq87cVh/dqGErqwrfNw1QtS26SgE3khLKsXZ7O0=; b=owGbwMvMwMXY3/A7olbonx/jabUkhhSFsPvzHDfst82JN/1+7ukslmX3r9r8udolIGuRduf6n rMsdv5cnYzGLAyMXAyyYoos9o1rMq2q5CI71/67DDOIlQlkCgMXpwBMRJOf/a/AiQvFnhsXdk3P WRAhFlcZ9znpVlfz1/uLJ7ly2KlrLNPjEdXnPVnktSPXV8FD2uo/cx7f+U/8J3hkRSwXGnG13RB V95zBoiOVsH5W0UOJrD6BK3wBTM67RK5u12Xb32fq9T2I+aS3kuUfYblrq/+Gvygy/y0actFi09 5T598EdLtfYjFqnuEbV8XTaNeTopMn3aD/3HU+d3WbS3cGb6ZXuFyL4rrzZ/8UVusdbqqsuGjT0 pmh02+u05ax6dxp02hRAXF9mwUvZu+fleGjnPK6u2pipE0ARy+fvdKMW3aCUWFPBJs+73SV/CH6 gIfVYXHZkRlcDkxxlzdXnzBddnbtXx/Xw+8O7RJ/FgsA X-Developer-Key: i=u.kleine-koenig@pengutronix.de; a=openpgp; fpr=0D2511F322BFAB1C1580266BE2DCDD9132669BD6 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.ext.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-media@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@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 (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 --- drivers/media/platform/st/sti/hva/hva-v4l2.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/media/platform/st/sti/hva/hva-v4l2.c b/drivers/media/platform/st/sti/hva/hva-v4l2.c index bb34d6997d99..3a848ca32a0e 100644 --- a/drivers/media/platform/st/sti/hva/hva-v4l2.c +++ b/drivers/media/platform/st/sti/hva/hva-v4l2.c @@ -1422,7 +1422,7 @@ static int hva_probe(struct platform_device *pdev) return ret; } -static int hva_remove(struct platform_device *pdev) +static void hva_remove(struct platform_device *pdev) { struct hva_dev *hva = platform_get_drvdata(pdev); struct device *dev = hva_to_dev(hva); @@ -1440,8 +1440,6 @@ static int hva_remove(struct platform_device *pdev) v4l2_device_unregister(&hva->v4l2_dev); dev_info(dev, "%s %s removed\n", HVA_PREFIX, pdev->name); - - return 0; } /* PM ops */ @@ -1461,7 +1459,7 @@ MODULE_DEVICE_TABLE(of, hva_match_types); static struct platform_driver hva_driver = { .probe = hva_probe, - .remove = hva_remove, + .remove_new = hva_remove, .driver = { .name = HVA_NAME, .of_match_table = hva_match_types, From patchwork Sun Mar 26 14:31:43 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= X-Patchwork-Id: 13188256 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 684CDC761AF for ; Sun, 26 Mar 2023 14:34:34 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232597AbjCZOed (ORCPT ); Sun, 26 Mar 2023 10:34:33 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60602 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232544AbjCZOdI (ORCPT ); Sun, 26 Mar 2023 10:33:08 -0400 Received: from metis.ext.pengutronix.de (metis.ext.pengutronix.de [IPv6:2001:67c:670:201:290:27ff:fe1d:cc33]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E0C2776AF for ; Sun, 26 Mar 2023 07:32:58 -0700 (PDT) Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.ext.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pgRQL-00006X-KL; Sun, 26 Mar 2023 16:32:45 +0200 Received: from [2a0a:edc0:0:900:1d::77] (helo=ptz.office.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtp (Exim 4.94.2) (envelope-from ) id 1pgRQI-006reW-RP; Sun, 26 Mar 2023 16:32:42 +0200 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1pgRQI-0088Yh-0m; Sun, 26 Mar 2023 16:32:42 +0200 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Mauro Carvalho Chehab , Maxime Coquelin , Alexandre Torgue , =?utf-8?q?Uwe_Kleine-K?= =?utf-8?q?=C3=B6nig?= Cc: linux-media@vger.kernel.org, linux-stm32@st-md-mailman.stormreply.com, linux-arm-kernel@lists.infradead.org, kernel@pengutronix.de Subject: [PATCH 076/117] media: dma2d: Convert to platform remove callback returning void Date: Sun, 26 Mar 2023 16:31:43 +0200 Message-Id: <20230326143224.572654-79-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230326143224.572654-1-u.kleine-koenig@pengutronix.de> References: <20230326143224.572654-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1826; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=Hf03W6FCnuJBdvXuTFOZXNHudlzADbBrZKtBOEpjYlM=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBkIFbhWjaNCRTr78svok4/G/qcUfXFkbJZeABAx T+Yc7umm8eJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZCBW4QAKCRCPgPtYfRL+ TnPRB/9CMzAkMtzX9t2MUc+yuKmxmHlomkr7f1IZZ919Gdvmp3sWBbFKhor+nE/SbadRaj46216 mFmKZG0eYEnHfvWK/Pvqbj/E5urzyoFTywinaXnKS9jDLFlyz6zSvYosKqQEQNZNzkENDc/MWgp IlT3G5+SvbtX0gNJJ1/fqpZ3lbJWdTHbJ6sk0LIo5o08FNPoQtM8A4UL/aAm81R5Jkl15iyxDeR C0KQE1Dox+swebOdqRUvBar9uRN1Ir4smQEDZhz3fK3xjom0HLGFOF3MWyhGtn2gAKtpKmuc7Za mVzNVmXqG5ZifvWHKntrUJivwDcj7NUQfGk7fF/gVClnMl94 X-Developer-Key: i=u.kleine-koenig@pengutronix.de; a=openpgp; fpr=0D2511F322BFAB1C1580266BE2DCDD9132669BD6 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.ext.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-media@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@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 (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 --- drivers/media/platform/st/stm32/dma2d/dma2d.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/media/platform/st/stm32/dma2d/dma2d.c b/drivers/media/platform/st/stm32/dma2d/dma2d.c index 9706aa41b5d2..be56d2b5fae9 100644 --- a/drivers/media/platform/st/stm32/dma2d/dma2d.c +++ b/drivers/media/platform/st/stm32/dma2d/dma2d.c @@ -696,7 +696,7 @@ static int dma2d_probe(struct platform_device *pdev) return ret; } -static int dma2d_remove(struct platform_device *pdev) +static void dma2d_remove(struct platform_device *pdev) { struct dma2d_dev *dev = platform_get_drvdata(pdev); @@ -707,8 +707,6 @@ static int dma2d_remove(struct platform_device *pdev) vb2_dma_contig_clear_max_seg_size(&pdev->dev); clk_unprepare(dev->gate); clk_put(dev->gate); - - return 0; } static const struct of_device_id stm32_dma2d_match[] = { @@ -722,7 +720,7 @@ MODULE_DEVICE_TABLE(of, stm32_dma2d_match); static struct platform_driver dma2d_pdrv = { .probe = dma2d_probe, - .remove = dma2d_remove, + .remove_new = dma2d_remove, .driver = { .name = DMA2D_NAME, .of_match_table = stm32_dma2d_match, From patchwork Sun Mar 26 14:31:44 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= X-Patchwork-Id: 13188219 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 435A1C6FD1C for ; Sun, 26 Mar 2023 14:33:55 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232453AbjCZOdx (ORCPT ); Sun, 26 Mar 2023 10:33:53 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60672 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232493AbjCZOcy (ORCPT ); Sun, 26 Mar 2023 10:32:54 -0400 Received: from metis.ext.pengutronix.de (metis.ext.pengutronix.de [IPv6:2001:67c:670:201:290:27ff:fe1d:cc33]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B6C037EC9 for ; Sun, 26 Mar 2023 07:32:52 -0700 (PDT) Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.ext.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pgRQM-00009Z-E1; Sun, 26 Mar 2023 16:32:46 +0200 Received: from [2a0a:edc0:0:900:1d::77] (helo=ptz.office.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtp (Exim 4.94.2) (envelope-from ) id 1pgRQJ-006reu-PA; Sun, 26 Mar 2023 16:32:43 +0200 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1pgRQI-0088Ym-6c; Sun, 26 Mar 2023 16:32:42 +0200 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Hugues Fruchet , Mauro Carvalho Chehab , Maxime Coquelin , Alexandre Torgue Cc: linux-media@vger.kernel.org, linux-stm32@st-md-mailman.stormreply.com, linux-arm-kernel@lists.infradead.org, kernel@pengutronix.de Subject: [PATCH 077/117] media: stm32-dcmi: Convert to platform remove callback returning void Date: Sun, 26 Mar 2023 16:31:44 +0200 Message-Id: <20230326143224.572654-80-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230326143224.572654-1-u.kleine-koenig@pengutronix.de> References: <20230326143224.572654-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1835; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=B2SRle1FWU+fvxidEF4AfCr7grTjB5IhYpAYWME58PA=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBkIFbiFY6P9Bvm19sbb/DGuYDfSjfu1+Ed9eyPQ WPUc31/iY6JATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZCBW4gAKCRCPgPtYfRL+ TjkxCACrV8VIV049iFgO6pMn+hRVUFDMXLM3LetM9Pj/dkFcpbkVxQEAQL9OoaOmsPGvmn10CDC wGZZQztBifG9viCCYtWK1XTxW/QyJtQjpLRvgDKp01FavBHb/UDr87lg0B6Zv3A3zPaL11u6qM3 9/bT/c24KsFnReeA1pjZoM0T5qKgz4bj7OpcdwGSh9ufyJMFAfSdI2EENirkPmBFygkkKArLosK L//ssYDIOZ8/VwseyOOHDWqz/06vxq1b4g36psxoPws0NVYGq3YEsZV0hT3pS6NtlL+5rv7Ue3c Nha+Ayh7kEVquPYhJvwVz5wRGSz+2b1AdNti45x2nQMoL+vh X-Developer-Key: i=u.kleine-koenig@pengutronix.de; a=openpgp; fpr=0D2511F322BFAB1C1580266BE2DCDD9132669BD6 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.ext.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-media@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@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 (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 --- drivers/media/platform/st/stm32/stm32-dcmi.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/media/platform/st/stm32/stm32-dcmi.c b/drivers/media/platform/st/stm32/stm32-dcmi.c index ad8e9742e1ae..dc3ce08259d5 100644 --- a/drivers/media/platform/st/stm32/stm32-dcmi.c +++ b/drivers/media/platform/st/stm32/stm32-dcmi.c @@ -2134,7 +2134,7 @@ static int dcmi_probe(struct platform_device *pdev) return ret; } -static int dcmi_remove(struct platform_device *pdev) +static void dcmi_remove(struct platform_device *pdev) { struct stm32_dcmi *dcmi = platform_get_drvdata(pdev); @@ -2147,8 +2147,6 @@ static int dcmi_remove(struct platform_device *pdev) media_device_cleanup(&dcmi->mdev); dma_release_channel(dcmi->dma_chan); - - return 0; } static __maybe_unused int dcmi_runtime_suspend(struct device *dev) @@ -2202,7 +2200,7 @@ static const struct dev_pm_ops dcmi_pm_ops = { static struct platform_driver stm32_dcmi_driver = { .probe = dcmi_probe, - .remove = dcmi_remove, + .remove_new = dcmi_remove, .driver = { .name = DRV_NAME, .of_match_table = of_match_ptr(stm32_dcmi_of_match), From patchwork Sun Mar 26 14:31:45 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= X-Patchwork-Id: 13188261 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 4253FC6FD1C for ; Sun, 26 Mar 2023 14:34:40 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232605AbjCZOej (ORCPT ); Sun, 26 Mar 2023 10:34:39 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60432 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232564AbjCZOdL (ORCPT ); Sun, 26 Mar 2023 10:33:11 -0400 Received: from metis.ext.pengutronix.de (metis.ext.pengutronix.de [IPv6:2001:67c:670:201:290:27ff:fe1d:cc33]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5AD977AB1 for ; Sun, 26 Mar 2023 07:33:00 -0700 (PDT) Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.ext.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pgRQN-00009B-9o; Sun, 26 Mar 2023 16:32:47 +0200 Received: from [2a0a:edc0:0:900:1d::77] (helo=ptz.office.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtp (Exim 4.94.2) (envelope-from ) id 1pgRQJ-006ren-Ki; Sun, 26 Mar 2023 16:32:43 +0200 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1pgRQI-0088Yp-Dz; Sun, 26 Mar 2023 16:32:42 +0200 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Maxime Ripard , Mauro Carvalho Chehab , Chen-Yu Tsai , Jernej Skrabec , Samuel Holland Cc: linux-media@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-sunxi@lists.linux.dev, kernel@pengutronix.de Subject: [PATCH 078/117] media: sun4i_csi: Convert to platform remove callback returning void Date: Sun, 26 Mar 2023 16:31:45 +0200 Message-Id: <20230326143224.572654-81-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230326143224.572654-1-u.kleine-koenig@pengutronix.de> References: <20230326143224.572654-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1908; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=92f+/LQb/H6f1ORxRx6eRZYglN/JIjU1cdoQA/Fu7uU=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBkIFbjj4OPXL2XVpzi/Nj0dmAgJvKqDyZkMFnTr hw1BsChwWiJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZCBW4wAKCRCPgPtYfRL+ Tk/uB/95Csm+2fLfFB/qcZ7rs82AZiz/VIPmV4wv7JtBRl7913WpkszO6OjoTe12jmTt9DuUl9M Me9tqYJqwqLprsXxZstU4wdf8765sPnMUQMNugx5QXcmh0rJTAKqzWhlJANpr8vRQjwYMnNlMwA dFJoSN+v7RwJxkinGUDtXKUpc6u+fVY4wIv430fKQJH7Z7lctNC/hirIN13EEO3jfViZwHDqKpL UOr0Wd1TaGqY0TcWSqLK9+lRwAAyGBcFXkKaCnAPgdlq3KIqB6Tg9OI5Mp3+rnQk3nJ32Yn5G2P ykbYtKeAdZrkAGrnm/rT/AOC/i/Z4o3rAw5Hi4iuTu+4vNAQ X-Developer-Key: i=u.kleine-koenig@pengutronix.de; a=openpgp; fpr=0D2511F322BFAB1C1580266BE2DCDD9132669BD6 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.ext.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-media@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@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 (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 Acked-by: Jernej Skrabec --- drivers/media/platform/sunxi/sun4i-csi/sun4i_csi.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/media/platform/sunxi/sun4i-csi/sun4i_csi.c b/drivers/media/platform/sunxi/sun4i-csi/sun4i_csi.c index 86c5235a0c7a..d6e7d1b36083 100644 --- a/drivers/media/platform/sunxi/sun4i-csi/sun4i_csi.c +++ b/drivers/media/platform/sunxi/sun4i-csi/sun4i_csi.c @@ -260,7 +260,7 @@ static int sun4i_csi_probe(struct platform_device *pdev) return ret; } -static int sun4i_csi_remove(struct platform_device *pdev) +static void sun4i_csi_remove(struct platform_device *pdev) { struct sun4i_csi *csi = platform_get_drvdata(pdev); @@ -271,8 +271,6 @@ static int sun4i_csi_remove(struct platform_device *pdev) media_device_unregister(&csi->mdev); sun4i_csi_dma_unregister(csi); media_device_cleanup(&csi->mdev); - - return 0; } static const struct sun4i_csi_traits sun4i_a10_csi1_traits = { @@ -330,7 +328,7 @@ static const struct dev_pm_ops sun4i_csi_pm_ops = { static struct platform_driver sun4i_csi_driver = { .probe = sun4i_csi_probe, - .remove = sun4i_csi_remove, + .remove_new = sun4i_csi_remove, .driver = { .name = "sun4i-csi", .of_match_table = sun4i_csi_of_match, From patchwork Sun Mar 26 14:31:46 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= X-Patchwork-Id: 13188264 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id E07DEC74A5B for ; Sun, 26 Mar 2023 14:34:42 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232609AbjCZOel (ORCPT ); Sun, 26 Mar 2023 10:34:41 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60384 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232556AbjCZOdN (ORCPT ); Sun, 26 Mar 2023 10:33:13 -0400 Received: from metis.ext.pengutronix.de (metis.ext.pengutronix.de [IPv6:2001:67c:670:201:290:27ff:fe1d:cc33]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7D9002736 for ; Sun, 26 Mar 2023 07:33:02 -0700 (PDT) Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.ext.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pgRQP-0000BQ-Le; Sun, 26 Mar 2023 16:32:49 +0200 Received: from [2a0a:edc0:0:900:1d::77] (helo=ptz.office.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtp (Exim 4.94.2) (envelope-from ) id 1pgRQK-006rfF-EA; Sun, 26 Mar 2023 16:32:44 +0200 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1pgRQI-0088Ys-LW; Sun, 26 Mar 2023 16:32:42 +0200 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Yong Deng , Paul Kocialkowski , Mauro Carvalho Chehab , Chen-Yu Tsai , Jernej Skrabec , Samuel Holland Cc: linux-media@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-sunxi@lists.linux.dev, kernel@pengutronix.de Subject: [PATCH 079/117] media: sun6i_csi: Convert to platform remove callback returning void Date: Sun, 26 Mar 2023 16:31:46 +0200 Message-Id: <20230326143224.572654-82-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230326143224.572654-1-u.kleine-koenig@pengutronix.de> References: <20230326143224.572654-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1917; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=m26ezAxR2j/uofLPwLu9oTyNCHcyZJXVezn3mhl4bTE=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBkIFbkbHga1UdZY6Plazsm9trXoSYX5XbkTjkjc VlFytw3HraJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZCBW5AAKCRCPgPtYfRL+ TvU4B/49HiWoVfnNhS8IavAhrMM2H/LRanOpQ5U8vux671LG1pdZU5We5MHRDCXcB7C41yorhSh U8hw4/3mGMcvFj5WDfqkhlNB4Jo3Y/Fr7Jq7jN02myyyJUGbvmknkN9Kki+o0lnod5WJDR+cDl3 Rl4d6SGJEOnYK+Z7gTBIu7vABpVN1Kvkp0T6fXvhC8AvDf1fK8eYYq8MZkXmX9McbMAGOS//6I4 FPWhZ84GmXR5nTFYHK5kOpIDtN1Unaz/hh72zWXhMZInkTjWEXMjQAjCrcuXb670ZS3euMluJrL hw4lpcAfj4Uih0w8E45MQ+InvpOyWRVJ5EUQXBN3GJnmyS0E X-Developer-Key: i=u.kleine-koenig@pengutronix.de; a=openpgp; fpr=0D2511F322BFAB1C1580266BE2DCDD9132669BD6 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.ext.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-media@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@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 (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 Acked-by: Jernej Skrabec --- drivers/media/platform/sunxi/sun6i-csi/sun6i_csi.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/media/platform/sunxi/sun6i-csi/sun6i_csi.c b/drivers/media/platform/sunxi/sun6i-csi/sun6i_csi.c index e3e6650181c8..e2723cfa4515 100644 --- a/drivers/media/platform/sunxi/sun6i-csi/sun6i_csi.c +++ b/drivers/media/platform/sunxi/sun6i-csi/sun6i_csi.c @@ -375,7 +375,7 @@ static int sun6i_csi_probe(struct platform_device *platform_dev) return ret; } -static int sun6i_csi_remove(struct platform_device *pdev) +static void sun6i_csi_remove(struct platform_device *pdev) { struct sun6i_csi_device *csi_dev = platform_get_drvdata(pdev); @@ -386,8 +386,6 @@ static int sun6i_csi_remove(struct platform_device *pdev) sun6i_csi_v4l2_cleanup(csi_dev); sun6i_csi_resources_cleanup(csi_dev); - - return 0; } static const struct sun6i_csi_variant sun6i_a31_csi_variant = { @@ -426,7 +424,7 @@ MODULE_DEVICE_TABLE(of, sun6i_csi_of_match); static struct platform_driver sun6i_csi_platform_driver = { .probe = sun6i_csi_probe, - .remove = sun6i_csi_remove, + .remove_new = sun6i_csi_remove, .driver = { .name = SUN6I_CSI_NAME, .of_match_table = of_match_ptr(sun6i_csi_of_match), From patchwork Sun Mar 26 14:31:47 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= X-Patchwork-Id: 13188257 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id F2A1BC74A5B for ; Sun, 26 Mar 2023 14:34:35 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232603AbjCZOef (ORCPT ); Sun, 26 Mar 2023 10:34:35 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60348 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232329AbjCZOdH (ORCPT ); Sun, 26 Mar 2023 10:33:07 -0400 Received: from metis.ext.pengutronix.de (metis.ext.pengutronix.de [IPv6:2001:67c:670:201:290:27ff:fe1d:cc33]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A4F4E6EA9 for ; Sun, 26 Mar 2023 07:32:58 -0700 (PDT) Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.ext.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pgRQN-0000AI-9o; Sun, 26 Mar 2023 16:32:47 +0200 Received: from [2a0a:edc0:0:900:1d::77] (helo=ptz.office.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtp (Exim 4.94.2) (envelope-from ) id 1pgRQK-006rf1-02; Sun, 26 Mar 2023 16:32:44 +0200 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1pgRQI-0088Yw-Tt; Sun, 26 Mar 2023 16:32:42 +0200 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Paul Kocialkowski , Mauro Carvalho Chehab , Chen-Yu Tsai , Jernej Skrabec , Samuel Holland Cc: linux-media@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-sunxi@lists.linux.dev, kernel@pengutronix.de Subject: [PATCH 080/117] media: sun6i_mipi_csi2: Convert to platform remove callback returning void Date: Sun, 26 Mar 2023 16:31:47 +0200 Message-Id: <20230326143224.572654-83-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230326143224.572654-1-u.kleine-koenig@pengutronix.de> References: <20230326143224.572654-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=2004; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=jQPDsQVruAOUtxy6LPdqmQOfAEZivBfr3gDXNDkVj/k=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBkIFblvrLuiuS45ZAzXk6hDA5q01ywy1BMMtsGy f8VyU5LzueJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZCBW5QAKCRCPgPtYfRL+ TuxtCACtTiMScCpHJoEnxcJ7bs2eib8WhF39+8QWG7QK02o8P9nG96sJYwrrUAG5eAokqmnKEHQ 5uLfu4JvzADkO2IoIEqYkLKnfzuNP2sDsLWv0RkzhI3ShyGStQzITC9tjhXS3It91CQGcOVWMCS PamUrYmkvrcg3hhGQ1V41QhPIcW6tjSKfLZv0Auna/kF8IOQuxXzwHr+xuGWSLirBgKu1gIgbCH AFk/B5q/Tf0rR5EWCiG1f/5l6hkdbPxD0H3j0+zxafi5DWoBKfbjoG6K8neind5Msq9G5saumz3 efKoHKp1A8VvuM2RzfTHLEz9uWELE7qb7/Qfa6CvBEjsjDfx X-Developer-Key: i=u.kleine-koenig@pengutronix.de; a=openpgp; fpr=0D2511F322BFAB1C1580266BE2DCDD9132669BD6 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.ext.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-media@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@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 (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 Acked-by: Jernej Skrabec --- .../media/platform/sunxi/sun6i-mipi-csi2/sun6i_mipi_csi2.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/media/platform/sunxi/sun6i-mipi-csi2/sun6i_mipi_csi2.c b/drivers/media/platform/sunxi/sun6i-mipi-csi2/sun6i_mipi_csi2.c index a220ce849b41..dce130b4c9f6 100644 --- a/drivers/media/platform/sunxi/sun6i-mipi-csi2/sun6i_mipi_csi2.c +++ b/drivers/media/platform/sunxi/sun6i-mipi-csi2/sun6i_mipi_csi2.c @@ -737,15 +737,13 @@ static int sun6i_mipi_csi2_probe(struct platform_device *platform_dev) return ret; } -static int sun6i_mipi_csi2_remove(struct platform_device *platform_dev) +static void sun6i_mipi_csi2_remove(struct platform_device *platform_dev) { struct sun6i_mipi_csi2_device *csi2_dev = platform_get_drvdata(platform_dev); sun6i_mipi_csi2_bridge_cleanup(csi2_dev); sun6i_mipi_csi2_resources_cleanup(csi2_dev); - - return 0; } static const struct of_device_id sun6i_mipi_csi2_of_match[] = { @@ -756,7 +754,7 @@ MODULE_DEVICE_TABLE(of, sun6i_mipi_csi2_of_match); static struct platform_driver sun6i_mipi_csi2_platform_driver = { .probe = sun6i_mipi_csi2_probe, - .remove = sun6i_mipi_csi2_remove, + .remove_new = sun6i_mipi_csi2_remove, .driver = { .name = SUN6I_MIPI_CSI2_NAME, .of_match_table = of_match_ptr(sun6i_mipi_csi2_of_match), From patchwork Sun Mar 26 14:31:48 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= X-Patchwork-Id: 13188268 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 414ABC74A5B for ; Sun, 26 Mar 2023 14:34:47 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232623AbjCZOep (ORCPT ); Sun, 26 Mar 2023 10:34:45 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:32812 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232535AbjCZOdO (ORCPT ); Sun, 26 Mar 2023 10:33:14 -0400 Received: from metis.ext.pengutronix.de (metis.ext.pengutronix.de [IPv6:2001:67c:670:201:290:27ff:fe1d:cc33]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2BBE34EE1 for ; Sun, 26 Mar 2023 07:33:03 -0700 (PDT) Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.ext.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pgRQN-0000Ao-H7; Sun, 26 Mar 2023 16:32:47 +0200 Received: from [2a0a:edc0:0:900:1d::77] (helo=ptz.office.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtp (Exim 4.94.2) (envelope-from ) id 1pgRQK-006rf7-6S; Sun, 26 Mar 2023 16:32:44 +0200 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1pgRQJ-0088Z0-52; Sun, 26 Mar 2023 16:32:43 +0200 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Mauro Carvalho Chehab , Chen-Yu Tsai , Jernej Skrabec , Samuel Holland , Hans Verkuil , Paul Kocialkowski , Sakari Ailus , Maxime Ripard , =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= , Christophe JAILLET Cc: linux-media@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-sunxi@lists.linux.dev, kernel@pengutronix.de Subject: [PATCH 081/117] media: sun8i_a83t_mipi_csi2: Convert to platform remove callback returning void Date: Sun, 26 Mar 2023 16:31:48 +0200 Message-Id: <20230326143224.572654-84-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230326143224.572654-1-u.kleine-koenig@pengutronix.de> References: <20230326143224.572654-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=2114; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=k9x8HzVlyO7nqBiHyTmH/ywca9Pw/7RppQDC+gh421I=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBkIFbmAbo3t/O7sXR98QYLqTmcRer9F9ZO1B245 G0ILVvnNlWJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZCBW5gAKCRCPgPtYfRL+ Tl2jB/9BovhRmpZKHAU3NPpips1+iUG8LVAqyxsVRkanp+lGCOsrmCb9HFCEWuNFNzK+np/o+Tj rTxNTSg3yOLwjohHDTgTq8qhNVOX+j+QP8rB4tAu13wldgnfy5e/rZcZSrzzvj38qLi/low4452 gPfFPO9NIMAOBFHvyBbT+g40ib6zlqwenGkEGSmTQN49i+lqRUPRINUEetLC0+fLbIFuhljIs3t vn7HwQc3uCMRCioSaD4Ee8HPZ47PEkULKjFaBqVRSdvtJwK3Xiya/0LbqSTa0+OTGrNLfL1t+Ic CorzysVmLole6sZsFuAqD3S6I4K4g38P4Bss8SpHB16mmh3N X-Developer-Key: i=u.kleine-koenig@pengutronix.de; a=openpgp; fpr=0D2511F322BFAB1C1580266BE2DCDD9132669BD6 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.ext.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-media@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@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 (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 Acked-by: Jernej Skrabec --- .../sunxi/sun8i-a83t-mipi-csi2/sun8i_a83t_mipi_csi2.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/media/platform/sunxi/sun8i-a83t-mipi-csi2/sun8i_a83t_mipi_csi2.c b/drivers/media/platform/sunxi/sun8i-a83t-mipi-csi2/sun8i_a83t_mipi_csi2.c index cd2e92ae2293..23d32e198aaa 100644 --- a/drivers/media/platform/sunxi/sun8i-a83t-mipi-csi2/sun8i_a83t_mipi_csi2.c +++ b/drivers/media/platform/sunxi/sun8i-a83t-mipi-csi2/sun8i_a83t_mipi_csi2.c @@ -804,15 +804,13 @@ static int sun8i_a83t_mipi_csi2_probe(struct platform_device *platform_dev) return ret; } -static int sun8i_a83t_mipi_csi2_remove(struct platform_device *platform_dev) +static void sun8i_a83t_mipi_csi2_remove(struct platform_device *platform_dev) { struct sun8i_a83t_mipi_csi2_device *csi2_dev = platform_get_drvdata(platform_dev); sun8i_a83t_mipi_csi2_bridge_cleanup(csi2_dev); sun8i_a83t_mipi_csi2_resources_cleanup(csi2_dev); - - return 0; } static const struct of_device_id sun8i_a83t_mipi_csi2_of_match[] = { @@ -823,7 +821,7 @@ MODULE_DEVICE_TABLE(of, sun8i_a83t_mipi_csi2_of_match); static struct platform_driver sun8i_a83t_mipi_csi2_platform_driver = { .probe = sun8i_a83t_mipi_csi2_probe, - .remove = sun8i_a83t_mipi_csi2_remove, + .remove_new = sun8i_a83t_mipi_csi2_remove, .driver = { .name = SUN8I_A83T_MIPI_CSI2_NAME, .of_match_table = of_match_ptr(sun8i_a83t_mipi_csi2_of_match), From patchwork Sun Mar 26 14:31:49 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= X-Patchwork-Id: 13188249 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 5C393C74A5B for ; Sun, 26 Mar 2023 14:34:27 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232537AbjCZOe0 (ORCPT ); Sun, 26 Mar 2023 10:34:26 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60602 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232159AbjCZOdC (ORCPT ); Sun, 26 Mar 2023 10:33:02 -0400 Received: from metis.ext.pengutronix.de (metis.ext.pengutronix.de [IPv6:2001:67c:670:201:290:27ff:fe1d:cc33]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D9C1F49EA for ; Sun, 26 Mar 2023 07:32:56 -0700 (PDT) Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.ext.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pgRQN-0000BK-9q; Sun, 26 Mar 2023 16:32:47 +0200 Received: from [2a0a:edc0:0:900:1d::77] (helo=ptz.office.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtp (Exim 4.94.2) (envelope-from ) id 1pgRQK-006rfB-Bf; Sun, 26 Mar 2023 16:32:44 +0200 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1pgRQJ-0088Z3-Bc; Sun, 26 Mar 2023 16:32:43 +0200 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Jernej Skrabec , Mauro Carvalho Chehab , Chen-Yu Tsai , Samuel Holland Cc: linux-media@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-sunxi@lists.linux.dev, kernel@pengutronix.de Subject: [PATCH 082/117] media: sun8i-di: Convert to platform remove callback returning void Date: Sun, 26 Mar 2023 16:31:49 +0200 Message-Id: <20230326143224.572654-85-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230326143224.572654-1-u.kleine-koenig@pengutronix.de> References: <20230326143224.572654-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1908; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=yLXUqUylUuobWYFHwj53KPR92uDluuNNDDMLeKSv0Y8=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBkIFborjt211qSXlAPZaLGhpiA3qT74FVsKGNxP vMQ62HSn8CJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZCBW6AAKCRCPgPtYfRL+ TqQvCACgKXheyLOpoz/d94swUM3JoIL3HCywHIu572DbA1fXGj/dQWFUV8z15sL35Ds47ZGupMs /gixu48XtktWQTzaGsX0K8xCyhA+8HnJAPXEhBu9GoJVufEgFtmyHS2AIhPVg175ikfyRZoSy/M E2X086PHpAyX6cT74H0V7qyUuWV5xDR226IiZHVAXSDW/Fa8VVCZxiWBeod7VyIz55unrN7BGA3 Es5TGMT5e39o/GyqmXCBb8mBWy2unpMjtb7+pIsJ6OoOIU3AECq7WqFY8hcOgPz6VSN6WGU3gY6 Bs7J91ie4TetABVQkd0PmhfXMKblxVp5A2wDfyilxDDV0pYk X-Developer-Key: i=u.kleine-koenig@pengutronix.de; a=openpgp; fpr=0D2511F322BFAB1C1580266BE2DCDD9132669BD6 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.ext.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-media@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@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 (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 Acked-by: Jernej Skrabec --- drivers/media/platform/sunxi/sun8i-di/sun8i-di.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/media/platform/sunxi/sun8i-di/sun8i-di.c b/drivers/media/platform/sunxi/sun8i-di/sun8i-di.c index aa65d70b6270..e4b0fd793f55 100644 --- a/drivers/media/platform/sunxi/sun8i-di/sun8i-di.c +++ b/drivers/media/platform/sunxi/sun8i-di/sun8i-di.c @@ -906,7 +906,7 @@ static int deinterlace_probe(struct platform_device *pdev) return ret; } -static int deinterlace_remove(struct platform_device *pdev) +static void deinterlace_remove(struct platform_device *pdev) { struct deinterlace_dev *dev = platform_get_drvdata(pdev); @@ -915,8 +915,6 @@ static int deinterlace_remove(struct platform_device *pdev) v4l2_device_unregister(&dev->v4l2_dev); pm_runtime_force_suspend(&pdev->dev); - - return 0; } static int deinterlace_runtime_resume(struct device *device) @@ -1002,7 +1000,7 @@ static const struct dev_pm_ops deinterlace_pm_ops = { static struct platform_driver deinterlace_driver = { .probe = deinterlace_probe, - .remove = deinterlace_remove, + .remove_new = deinterlace_remove, .driver = { .name = DEINTERLACE_NAME, .of_match_table = deinterlace_dt_match, From patchwork Sun Mar 26 14:31:50 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= X-Patchwork-Id: 13188246 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 962A6C74A5B for ; Sun, 26 Mar 2023 14:34:24 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232410AbjCZOeX (ORCPT ); Sun, 26 Mar 2023 10:34:23 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33616 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232538AbjCZOdB (ORCPT ); Sun, 26 Mar 2023 10:33:01 -0400 Received: from metis.ext.pengutronix.de (metis.ext.pengutronix.de [IPv6:2001:67c:670:201:290:27ff:fe1d:cc33]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1BE341BEC for ; Sun, 26 Mar 2023 07:32:55 -0700 (PDT) Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.ext.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pgRQN-0000Bh-9o; Sun, 26 Mar 2023 16:32:47 +0200 Received: from [2a0a:edc0:0:900:1d::77] (helo=ptz.office.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtp (Exim 4.94.2) (envelope-from ) id 1pgRQK-006rfK-IW; Sun, 26 Mar 2023 16:32:44 +0200 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1pgRQJ-0088Z6-IJ; Sun, 26 Mar 2023 16:32:43 +0200 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Jernej Skrabec , Mauro Carvalho Chehab , Chen-Yu Tsai , Samuel Holland Cc: linux-media@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-sunxi@lists.linux.dev, kernel@pengutronix.de Subject: [PATCH 083/117] media: sun8i_rotate: Convert to platform remove callback returning void Date: Sun, 26 Mar 2023 16:31:50 +0200 Message-Id: <20230326143224.572654-86-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230326143224.572654-1-u.kleine-koenig@pengutronix.de> References: <20230326143224.572654-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1881; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=cFM9ryR39dC1zqXzbh3VAz+Gt7Z0sPw+2x4RcLkZw4A=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBkIFbpIEMfPBt276qBqk05jpVddS6BlGOY/30xh p1HPwpPUl6JATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZCBW6QAKCRCPgPtYfRL+ Tp+2CACiYaJ6BxRtct1ArxiFzOL90Z9VGsHEYsESMYnrw0FFTf+2xaeLeSrYRYyDRwGQspYX0Bb sy3cMaF2oDaoWgTIRLh9zqmIAviwI1OJxTWGUhKDkm2X0gi0ZmfDWRKSHvOKEgYfq3cpkKdEc3B B3l679YgpcBR9H0n47laYezHYFX7KYg6G2jyPxBfwEnsOttdZxTODoQfBtlvKbTdJkzK7JdswzZ KwL0yUD2qmBOIYlC7QbvhY1qHSzfsbd9fSytfvrgjKmN74lZ5xdwsdaLkOVlmaLW0wwqgIUquXu bJytQOZerdUI031rupAzzyJ/AKA/NAkhPmdoDA11cIxMrBrH X-Developer-Key: i=u.kleine-koenig@pengutronix.de; a=openpgp; fpr=0D2511F322BFAB1C1580266BE2DCDD9132669BD6 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.ext.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-media@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@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 (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 Acked-by: Jernej Skrabec --- drivers/media/platform/sunxi/sun8i-rotate/sun8i_rotate.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/media/platform/sunxi/sun8i-rotate/sun8i_rotate.c b/drivers/media/platform/sunxi/sun8i-rotate/sun8i_rotate.c index fbcca59a0517..bd0c4257bbff 100644 --- a/drivers/media/platform/sunxi/sun8i-rotate/sun8i_rotate.c +++ b/drivers/media/platform/sunxi/sun8i-rotate/sun8i_rotate.c @@ -833,7 +833,7 @@ static int rotate_probe(struct platform_device *pdev) return ret; } -static int rotate_remove(struct platform_device *pdev) +static void rotate_remove(struct platform_device *pdev) { struct rotate_dev *dev = platform_get_drvdata(pdev); @@ -842,8 +842,6 @@ static int rotate_remove(struct platform_device *pdev) v4l2_device_unregister(&dev->v4l2_dev); pm_runtime_force_suspend(&pdev->dev); - - return 0; } static int rotate_runtime_resume(struct device *device) @@ -907,7 +905,7 @@ static const struct dev_pm_ops rotate_pm_ops = { static struct platform_driver rotate_driver = { .probe = rotate_probe, - .remove = rotate_remove, + .remove_new = rotate_remove, .driver = { .name = ROTATE_NAME, .of_match_table = rotate_dt_match, From patchwork Sun Mar 26 14:31:51 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= X-Patchwork-Id: 13188186 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 3B14CC761AF for ; Sun, 26 Mar 2023 14:33:42 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232580AbjCZOdl (ORCPT ); Sun, 26 Mar 2023 10:33:41 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60334 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232473AbjCZOcw (ORCPT ); Sun, 26 Mar 2023 10:32:52 -0400 Received: from metis.ext.pengutronix.de (metis.ext.pengutronix.de [IPv6:2001:67c:670:201:290:27ff:fe1d:cc33]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CCA247D92 for ; Sun, 26 Mar 2023 07:32:50 -0700 (PDT) Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.ext.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pgRQM-0000BX-TA; Sun, 26 Mar 2023 16:32:46 +0200 Received: from [2a0a:edc0:0:900:1d::77] (helo=ptz.office.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtp (Exim 4.94.2) (envelope-from ) id 1pgRQK-006rfI-GQ; Sun, 26 Mar 2023 16:32:44 +0200 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1pgRQJ-0088ZB-Oj; Sun, 26 Mar 2023 16:32:43 +0200 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: "Lad, Prabhakar" , Mauro Carvalho Chehab Cc: linux-media@vger.kernel.org, kernel@pengutronix.de Subject: [PATCH 084/117] media: am437x-vpfe: Convert to platform remove callback returning void Date: Sun, 26 Mar 2023 16:31:51 +0200 Message-Id: <20230326143224.572654-87-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230326143224.572654-1-u.kleine-koenig@pengutronix.de> References: <20230326143224.572654-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1862; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=lTaE3SKdNq66F1jzyqhg1rfYfg3OY2uFDbXBo2/LMsw=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBkIFbqWfYcJFKFZd8oS5F20KVPr15wIMRpHsGm8 FG++sg4mVaJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZCBW6gAKCRCPgPtYfRL+ TjV+B/0YJZiw1tGCmYj0kXcu3tYzxXV3fszJMUaHUnC9ZvL3BlJgbHB8lMD1OFDMWmQXZ0auLnJ vOHSvZb3bQ8nhL+HrpmBImcR5nMTbMZr41tWUg/rZVsg0wCb0Apq+DGVGZYlDnpFkTBxQNffQEw N1Ko3niP7hD77qeZcXwB+yCcSM20mEyA2RHzeJpFfXLRStjU89TdGTGJHEtcdJwSGQOnW/MDffs X4LrxEtKWt+nPVAC5772shmOi78/Q/5pE75GEINaff47IDsTkdQ346DdntBZSfZtrH+m0UGpIb4 63vXyJtP4PTL/URipcSjAaVDetYHIhDYdKmQExPEvQiw2Q5h X-Developer-Key: i=u.kleine-koenig@pengutronix.de; a=openpgp; fpr=0D2511F322BFAB1C1580266BE2DCDD9132669BD6 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.ext.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-media@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@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 (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 --- drivers/media/platform/ti/am437x/am437x-vpfe.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/media/platform/ti/am437x/am437x-vpfe.c b/drivers/media/platform/ti/am437x/am437x-vpfe.c index 2dfae9bc0bba..aac377fcaf35 100644 --- a/drivers/media/platform/ti/am437x/am437x-vpfe.c +++ b/drivers/media/platform/ti/am437x/am437x-vpfe.c @@ -2483,7 +2483,7 @@ static int vpfe_probe(struct platform_device *pdev) /* * vpfe_remove : It un-register device from V4L2 driver */ -static int vpfe_remove(struct platform_device *pdev) +static void vpfe_remove(struct platform_device *pdev) { struct vpfe_device *vpfe = platform_get_drvdata(pdev); @@ -2493,8 +2493,6 @@ static int vpfe_remove(struct platform_device *pdev) v4l2_async_nf_cleanup(&vpfe->notifier); v4l2_device_unregister(&vpfe->v4l2_dev); video_unregister_device(&vpfe->video_dev); - - return 0; } #ifdef CONFIG_PM_SLEEP @@ -2625,7 +2623,7 @@ MODULE_DEVICE_TABLE(of, vpfe_of_match); static struct platform_driver vpfe_driver = { .probe = vpfe_probe, - .remove = vpfe_remove, + .remove_new = vpfe_remove, .driver = { .name = VPFE_MODULE_NAME, .pm = &vpfe_pm_ops, From patchwork Sun Mar 26 14:31:52 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= X-Patchwork-Id: 13188236 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 9EB4CC77B62 for ; Sun, 26 Mar 2023 14:34:14 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232503AbjCZOeN (ORCPT ); Sun, 26 Mar 2023 10:34:13 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60672 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232515AbjCZOc6 (ORCPT ); Sun, 26 Mar 2023 10:32:58 -0400 Received: from metis.ext.pengutronix.de (metis.ext.pengutronix.de [IPv6:2001:67c:670:201:290:27ff:fe1d:cc33]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BFF187A8F for ; Sun, 26 Mar 2023 07:32:54 -0700 (PDT) Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.ext.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pgRQO-0000DX-Cd; Sun, 26 Mar 2023 16:32:48 +0200 Received: from [2a0a:edc0:0:900:1d::77] (helo=ptz.office.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtp (Exim 4.94.2) (envelope-from ) id 1pgRQL-006rfZ-Nv; Sun, 26 Mar 2023 16:32:45 +0200 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1pgRQJ-0088ZG-Vg; Sun, 26 Mar 2023 16:32:43 +0200 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Benoit Parrot , Mauro Carvalho Chehab Cc: linux-media@vger.kernel.org, kernel@pengutronix.de Subject: [PATCH 085/117] media: cal: Convert to platform remove callback returning void Date: Sun, 26 Mar 2023 16:31:52 +0200 Message-Id: <20230326143224.572654-88-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230326143224.572654-1-u.kleine-koenig@pengutronix.de> References: <20230326143224.572654-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1749; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=dsE/y8UiNMwNKo0iLAt+eCV1RoNcHHbald1EhTMkBiI=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBkIFbr7yUSmw1kaY5bkc1laIGJ/wRaehBBlHJYy SXiAVakIieJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZCBW6wAKCRCPgPtYfRL+ TsQqCAC5mLV1njvzMB3DYN5FTc8U2JpmmggpLEOhWPRF+C6+e0fklUZvKtb9uSpQiGeaASntE3N UVehKxivPq+4GvZxAAOJHZ/kYNNfEEGnQQ0LTu1roNMQv13/mvaY+y5iJzIb0WlzFbEhejkDHpg JNLMNgnJqvLHfL9+gPspUpu1rTbPYwjajaWJ5/PJaCnSoelxaZJ0JsZfznzJJIoW/TDeO61zF7U 3O2SlwyZEkIe8u52akKnL0iCEog7NHzba7ZmcRH+dTWKvlvT5jg/VqL6nx4K0U+GwLRfvHTwsWB l89NG3YLzhQpFR2LduPTydgajvonn2fMX06hAQU8MPZWUoz+ X-Developer-Key: i=u.kleine-koenig@pengutronix.de; a=openpgp; fpr=0D2511F322BFAB1C1580266BE2DCDD9132669BD6 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.ext.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-media@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@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 (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 --- drivers/media/platform/ti/cal/cal.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/media/platform/ti/cal/cal.c b/drivers/media/platform/ti/cal/cal.c index 1236215ec70e..9c5105223d6b 100644 --- a/drivers/media/platform/ti/cal/cal.c +++ b/drivers/media/platform/ti/cal/cal.c @@ -1293,7 +1293,7 @@ static int cal_probe(struct platform_device *pdev) return ret; } -static int cal_remove(struct platform_device *pdev) +static void cal_remove(struct platform_device *pdev) { struct cal_dev *cal = platform_get_drvdata(pdev); unsigned int i; @@ -1319,8 +1319,6 @@ static int cal_remove(struct platform_device *pdev) if (ret >= 0) pm_runtime_put_sync(&pdev->dev); pm_runtime_disable(&pdev->dev); - - return 0; } static int cal_runtime_resume(struct device *dev) @@ -1364,7 +1362,7 @@ static const struct dev_pm_ops cal_pm_ops = { static struct platform_driver cal_pdrv = { .probe = cal_probe, - .remove = cal_remove, + .remove_new = cal_remove, .driver = { .name = CAL_MODULE_NAME, .pm = &cal_pm_ops, From patchwork Sun Mar 26 14:31:53 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= X-Patchwork-Id: 13188214 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 5CF2CC6FD1C for ; Sun, 26 Mar 2023 14:33:49 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232588AbjCZOds (ORCPT ); Sun, 26 Mar 2023 10:33:48 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:32812 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232372AbjCZOcx (ORCPT ); Sun, 26 Mar 2023 10:32:53 -0400 Received: from metis.ext.pengutronix.de (metis.ext.pengutronix.de [IPv6:2001:67c:670:201:290:27ff:fe1d:cc33]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C47687D94 for ; Sun, 26 Mar 2023 07:32:51 -0700 (PDT) Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.ext.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pgRQN-0000Cx-PQ; Sun, 26 Mar 2023 16:32:47 +0200 Received: from [2a0a:edc0:0:900:1d::77] (helo=ptz.office.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtp (Exim 4.94.2) (envelope-from ) id 1pgRQL-006rfT-Bu; Sun, 26 Mar 2023 16:32:45 +0200 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1pgRQK-0088ZK-53; Sun, 26 Mar 2023 16:32:44 +0200 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: "Lad, Prabhakar" , Mauro Carvalho Chehab Cc: linux-media@vger.kernel.org, kernel@pengutronix.de Subject: [PATCH 086/117] media: vpif: Convert to platform remove callback returning void Date: Sun, 26 Mar 2023 16:31:53 +0200 Message-Id: <20230326143224.572654-89-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230326143224.572654-1-u.kleine-koenig@pengutronix.de> References: <20230326143224.572654-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1643; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=MiQAISA308S5v6FBmYIAESgilZxyA6DuhA7FnmNNhq8=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBkIFbsKjMz4EO0Uo5xn+aSsQ1Oq7NTWDZ0/ybrQ QgUOB/8o+CJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZCBW7AAKCRCPgPtYfRL+ TpFWB/kByjPRX9ZyiQdYWooX2qCVZMMVJSw2iuyTko4Hv1TXsne/0+CuQi+IpkCZxqBLiXw9tr8 dIuq6tGOBvKkDw61m1cGbW4YCVJgXpZvk7w8wgOgasBeTM0kU33AZ/0cVLnAWfUU2GcWD3ueSLb rS7/b86pch1L6JdvLyLPHfGPpRPgbvxJnFVdQ4sNq4DlFaAIKOvXGcbFZlzgXTxC4MzGNcUIqz+ Z1tLv9O1JpZO3QfQ+iXjr/WupJmBX8rF8ziRNQElJidLj6i/ff16fhvVlh/8Stx0O1y3orILjc8 pi09ROuFoUZvizaJhJ83+PBPOQ85PmqObjVfqiIQV4NkdmnV X-Developer-Key: i=u.kleine-koenig@pengutronix.de; a=openpgp; fpr=0D2511F322BFAB1C1580266BE2DCDD9132669BD6 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.ext.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-media@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@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 (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 --- drivers/media/platform/ti/davinci/vpif.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/media/platform/ti/davinci/vpif.c b/drivers/media/platform/ti/davinci/vpif.c index 832489822706..63cdfed37bc9 100644 --- a/drivers/media/platform/ti/davinci/vpif.c +++ b/drivers/media/platform/ti/davinci/vpif.c @@ -538,7 +538,7 @@ static int vpif_probe(struct platform_device *pdev) return ret; } -static int vpif_remove(struct platform_device *pdev) +static void vpif_remove(struct platform_device *pdev) { struct vpif_data *data = platform_get_drvdata(pdev); @@ -551,8 +551,6 @@ static int vpif_remove(struct platform_device *pdev) pm_runtime_disable(&pdev->dev); kfree(data); - - return 0; } #ifdef CONFIG_PM @@ -592,7 +590,7 @@ static struct platform_driver vpif_driver = { .name = VPIF_DRIVER_NAME, .pm = vpif_pm_ops, }, - .remove = vpif_remove, + .remove_new = vpif_remove, .probe = vpif_probe, }; From patchwork Sun Mar 26 14:31:54 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= X-Patchwork-Id: 13188218 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 4EC89C77B61 for ; Sun, 26 Mar 2023 14:33:53 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232372AbjCZOdw (ORCPT ); Sun, 26 Mar 2023 10:33:52 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60670 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232424AbjCZOcy (ORCPT ); Sun, 26 Mar 2023 10:32:54 -0400 Received: from metis.ext.pengutronix.de (metis.ext.pengutronix.de [IPv6:2001:67c:670:201:290:27ff:fe1d:cc33]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9E4857DAD for ; Sun, 26 Mar 2023 07:32:52 -0700 (PDT) Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.ext.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pgRQO-0000Dw-95; Sun, 26 Mar 2023 16:32:48 +0200 Received: from [2a0a:edc0:0:900:1d::77] (helo=ptz.office.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtp (Exim 4.94.2) (envelope-from ) id 1pgRQL-006rfd-Ro; Sun, 26 Mar 2023 16:32:45 +0200 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1pgRQK-0088ZO-Bv; Sun, 26 Mar 2023 16:32:44 +0200 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: "Lad, Prabhakar" , Mauro Carvalho Chehab Cc: linux-media@vger.kernel.org, kernel@pengutronix.de Subject: [PATCH 087/117] media: vpif_capture: Convert to platform remove callback returning void Date: Sun, 26 Mar 2023 16:31:54 +0200 Message-Id: <20230326143224.572654-90-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230326143224.572654-1-u.kleine-koenig@pengutronix.de> References: <20230326143224.572654-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1753; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=aEcwcqxWBw92D4bbzR6otWBRLMbsuZEoMuXBC470Pc8=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBkIFbt+RuEEl8CyRZwiBVw96R926AFssWw1djxP SJAnQvNzn+JATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZCBW7QAKCRCPgPtYfRL+ TpC3B/933iOR9VtroEfkFDBE8Nj74Cg5HG5R9PWd58oltag9nyiZX2ZGEFyQCyclyrQfMB1YQB5 IrTOj36o5vf009bAeSsMAOfMNNv28U2cCNz+uBzgFBaTUzXt8cBQiH2Q8R6u9gwaspgAdOq1bgm jof63F39zlISfhVBUYckSEKzCuk6OkBnROXYUkNzGLJ3+8hnAxV/q51dBBzWF/0tMXCZ2Pmy38u UkLKKLlNYyCyO8Jq6HoDg9GqVgdRqtGskWdJyPH0mbydhw+/eQkQ8wafWoB63lZwR9aXYQzVZcU HMgVx0YFIIIWWyC3nOz2lss+buTEzvlRuoWjIGqvp2V3wynS X-Developer-Key: i=u.kleine-koenig@pengutronix.de; a=openpgp; fpr=0D2511F322BFAB1C1580266BE2DCDD9132669BD6 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.ext.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-media@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@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 (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 --- drivers/media/platform/ti/davinci/vpif_capture.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/drivers/media/platform/ti/davinci/vpif_capture.c b/drivers/media/platform/ti/davinci/vpif_capture.c index 580723333fcc..44d269d6038c 100644 --- a/drivers/media/platform/ti/davinci/vpif_capture.c +++ b/drivers/media/platform/ti/davinci/vpif_capture.c @@ -1714,7 +1714,7 @@ static __init int vpif_probe(struct platform_device *pdev) * * The vidoe device is unregistered */ -static int vpif_remove(struct platform_device *device) +static void vpif_remove(struct platform_device *device) { struct channel_obj *ch; int i; @@ -1732,7 +1732,6 @@ static int vpif_remove(struct platform_device *device) video_unregister_device(&ch->video_dev); kfree(vpif_obj.dev[i]); } - return 0; } #ifdef CONFIG_PM_SLEEP @@ -1815,7 +1814,7 @@ static __refdata struct platform_driver vpif_driver = { .pm = &vpif_pm_ops, }, .probe = vpif_probe, - .remove = vpif_remove, + .remove_new = vpif_remove, }; module_platform_driver(vpif_driver); From patchwork Sun Mar 26 14:31:55 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= X-Patchwork-Id: 13188221 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 6AF7CC6FD1C for ; Sun, 26 Mar 2023 14:33:57 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232458AbjCZOd4 (ORCPT ); Sun, 26 Mar 2023 10:33:56 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60602 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232464AbjCZOcy (ORCPT ); Sun, 26 Mar 2023 10:32:54 -0400 Received: from metis.ext.pengutronix.de (metis.ext.pengutronix.de [IPv6:2001:67c:670:201:290:27ff:fe1d:cc33]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id F08BC7ED3 for ; Sun, 26 Mar 2023 07:32:52 -0700 (PDT) Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.ext.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pgRQO-0000FQ-Qx; Sun, 26 Mar 2023 16:32:48 +0200 Received: from [2a0a:edc0:0:900:1d::77] (helo=ptz.office.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtp (Exim 4.94.2) (envelope-from ) id 1pgRQM-006rfr-GB; Sun, 26 Mar 2023 16:32:46 +0200 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1pgRQK-0088ZT-JA; Sun, 26 Mar 2023 16:32:44 +0200 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: "Lad, Prabhakar" , Mauro Carvalho Chehab Cc: linux-media@vger.kernel.org, kernel@pengutronix.de Subject: [PATCH 088/117] media: vpif_display: Convert to platform remove callback returning void Date: Sun, 26 Mar 2023 16:31:55 +0200 Message-Id: <20230326143224.572654-91-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230326143224.572654-1-u.kleine-koenig@pengutronix.de> References: <20230326143224.572654-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1772; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=5z/UCYi7pnVTwBpUoBR38shL1sqEGMgf8UyTOszeQ1M=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBkIFbvLC73IX76nybiayNjhMhJgp8x2vYKfBY2F E6R2JjpVYyJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZCBW7wAKCRCPgPtYfRL+ Tuh0B/sF7oL6VX9Pz5jq/uTqN8GHNFdUIv/fkfKN7Iooq9sNXYLvtGJ/18zjZDEhZsQWXEheKxJ E+c9hKjm/COZMS2VC5nsxE7A6tnIcuQPKZCRvwoO7k23QZR3Vjvs3NFFc+JduoUHwwIl7+LDjyD eEmKpcA5BmwNoYJoGcnrbv2L5tdpfXc8Y5k2/HN53Tur9kyXRd4oM9EGTP+rREcBlGXA9xFfR49 WPYGxdxWJTBMbXqyh59afAWH8hGVPbeYLQ2Qs7/S2yxc7q29YBBEJsOmjPSdW+KY1iyGZ5JZhb0 NEj915v6Rxm+Heo8LY/+6UorvXf9Nqg4cC3KL/4Wj5LQfN8P X-Developer-Key: i=u.kleine-koenig@pengutronix.de; a=openpgp; fpr=0D2511F322BFAB1C1580266BE2DCDD9132669BD6 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.ext.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-media@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@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 (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 --- drivers/media/platform/ti/davinci/vpif_display.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/media/platform/ti/davinci/vpif_display.c b/drivers/media/platform/ti/davinci/vpif_display.c index b2df81603f62..f8ec2991c667 100644 --- a/drivers/media/platform/ti/davinci/vpif_display.c +++ b/drivers/media/platform/ti/davinci/vpif_display.c @@ -1305,7 +1305,7 @@ static __init int vpif_probe(struct platform_device *pdev) /* * vpif_remove: It un-register channels from V4L2 driver */ -static int vpif_remove(struct platform_device *device) +static void vpif_remove(struct platform_device *device) { struct channel_obj *ch; int i; @@ -1321,8 +1321,6 @@ static int vpif_remove(struct platform_device *device) video_unregister_device(&ch->video_dev); } free_vpif_objs(); - - return 0; } #ifdef CONFIG_PM_SLEEP @@ -1399,7 +1397,7 @@ static __refdata struct platform_driver vpif_driver = { .pm = &vpif_pm_ops, }, .probe = vpif_probe, - .remove = vpif_remove, + .remove_new = vpif_remove, }; module_platform_driver(vpif_driver); From patchwork Sun Mar 26 14:31:56 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= X-Patchwork-Id: 13188226 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id D5C23C77B61 for ; Sun, 26 Mar 2023 14:34:03 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232464AbjCZOeD (ORCPT ); Sun, 26 Mar 2023 10:34:03 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60632 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232498AbjCZOcz (ORCPT ); Sun, 26 Mar 2023 10:32:55 -0400 Received: from metis.ext.pengutronix.de (metis.ext.pengutronix.de [IPv6:2001:67c:670:201:290:27ff:fe1d:cc33]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7EE2D7EDF for ; Sun, 26 Mar 2023 07:32:53 -0700 (PDT) Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.ext.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pgRQO-0000EB-Au; Sun, 26 Mar 2023 16:32:48 +0200 Received: from [2a0a:edc0:0:900:1d::77] (helo=ptz.office.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtp (Exim 4.94.2) (envelope-from ) id 1pgRQL-006rfg-Ue; Sun, 26 Mar 2023 16:32:45 +0200 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1pgRQK-0088ZY-Pj; Sun, 26 Mar 2023 16:32:44 +0200 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Mauro Carvalho Chehab , =?utf-8?q?Uwe_Kleine-K=C3=B6?= =?utf-8?q?nig?= Cc: linux-media@vger.kernel.org, kernel@pengutronix.de Subject: [PATCH 089/117] media: omap_vout: Convert to platform remove callback returning void Date: Sun, 26 Mar 2023 16:31:56 +0200 Message-Id: <20230326143224.572654-92-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230326143224.572654-1-u.kleine-koenig@pengutronix.de> References: <20230326143224.572654-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1781; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=nblhNa8GMIbQ6zHewbCwjyp1L651cE5gn0ls0Q9QTMk=; b=owGbwMvMwMXY3/A7olbonx/jabUkhhSFsA9VejVPo842nfmjHG2ft7pdVEWmm/fApRmL00TWJ 56ut8zvZDRiYWDkYpAVU2Sxb1yTaVUlF9m59t9lmEGsTCBTGLg4BWAibR/Zf3RVVeqLiE3zc3KX nftAek+Wj0RJ7+WWI6vqkrnWPVa8fFa57+pLmQKFAIc04QPpkrUu2ydv2bTOd/u9NUmP4quDfKY vdWpKlAhq2a604sKd94dyVLU/yCgHqZ7UUlj5Sq1p615PKwmtI4ru2/56tBhEzPTzi9Q6vTWo6/ KyXlnFjTH+u4zW+7lYyf387ZX2p+vnVKvfYbyBEdGJsXsZ0+/17W7rjTD1lk3+G7wt+abA/GmP9 9817flcZF32Lt13gcIH1yuv3V/1tgYlnZVe6tl7cfIaH7YFU2xM/6afSdF/Zx8VunL/2ZkbFSZm pthpXFwdmTjrJv8n66UT105kbWp8N3XxifMfYtybleQA X-Developer-Key: i=u.kleine-koenig@pengutronix.de; a=openpgp; fpr=0D2511F322BFAB1C1580266BE2DCDD9132669BD6 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.ext.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-media@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@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 (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 --- drivers/media/platform/ti/omap/omap_vout.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/drivers/media/platform/ti/omap/omap_vout.c b/drivers/media/platform/ti/omap/omap_vout.c index 3e0d9af7ffec..4143274089c3 100644 --- a/drivers/media/platform/ti/omap/omap_vout.c +++ b/drivers/media/platform/ti/omap/omap_vout.c @@ -1569,7 +1569,7 @@ static void omap_vout_cleanup_device(struct omap_vout_device *vout) kfree(vout); } -static int omap_vout_remove(struct platform_device *pdev) +static void omap_vout_remove(struct platform_device *pdev) { int k; struct v4l2_device *v4l2_dev = platform_get_drvdata(pdev); @@ -1587,7 +1587,6 @@ static int omap_vout_remove(struct platform_device *pdev) omap_dss_put_device(vid_dev->displays[k]); } kfree(vid_dev); - return 0; } static int __init omap_vout_probe(struct platform_device *pdev) @@ -1721,7 +1720,7 @@ static struct platform_driver omap_vout_driver = { .driver = { .name = VOUT_NAME, }, - .remove = omap_vout_remove, + .remove_new = omap_vout_remove, }; static int __init omap_vout_init(void) From patchwork Sun Mar 26 14:31:57 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= X-Patchwork-Id: 13188213 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 9A60EC74A5B for ; Sun, 26 Mar 2023 14:33:48 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232583AbjCZOdr (ORCPT ); Sun, 26 Mar 2023 10:33:47 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:32776 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232479AbjCZOcx (ORCPT ); Sun, 26 Mar 2023 10:32:53 -0400 Received: from metis.ext.pengutronix.de (metis.ext.pengutronix.de [IPv6:2001:67c:670:201:290:27ff:fe1d:cc33]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D7DDB65A4 for ; Sun, 26 Mar 2023 07:32:51 -0700 (PDT) Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.ext.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pgRQO-0000EN-8j; Sun, 26 Mar 2023 16:32:48 +0200 Received: from [2a0a:edc0:0:900:1d::77] (helo=ptz.office.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtp (Exim 4.94.2) (envelope-from ) id 1pgRQM-006rfl-17; Sun, 26 Mar 2023 16:32:46 +0200 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1pgRQL-0088Zb-0O; Sun, 26 Mar 2023 16:32:45 +0200 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Laurent Pinchart , Mauro Carvalho Chehab Cc: linux-media@vger.kernel.org, kernel@pengutronix.de Subject: [PATCH 090/117] media: isp: Convert to platform remove callback returning void Date: Sun, 26 Mar 2023 16:31:57 +0200 Message-Id: <20230326143224.572654-93-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230326143224.572654-1-u.kleine-koenig@pengutronix.de> References: <20230326143224.572654-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1721; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=3VExVSSsO7/B3lm+SWJ9hExfHLfDuHO1c63efMmRrZA=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBkIFbxKlUq2guXl9nh7e6yGwM7qnfZSdnk+oogK hBhK9CZAmOJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZCBW8QAKCRCPgPtYfRL+ TqTnB/9siqx02HYG7IroqTm3QTuqlVawrm3Jz/tmn/6HrubQvQP2BeKz/jc4cPAfoJhifjz0WSj E23uYRSLMAc1TmL3EIKtX93vnDLJLk+x5eCYh0i1Su9ct4uLHLD1PqnEqngPYbuLmY/9FGK230N 9TOOhNSX3FWwtyfLfMp8G647sWBlqDXvuK5lKZ2rGNsxhWkw9kyKq4vQOOUL17kkGdrEbBsl+60 aJDLJpBmfxsiIaKMbDuKyRd6y/F0jjwRx+JLn2y/+cdx7zDsVnOrrOGoh2gcKQeluUPa8q7CeUP 3s1a1BvZvv6QUjBhAh4kkfHJybAKJZADoiHtD1C9DZsRFsXQ X-Developer-Key: i=u.kleine-koenig@pengutronix.de; a=openpgp; fpr=0D2511F322BFAB1C1580266BE2DCDD9132669BD6 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.ext.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-media@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@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 (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 --- drivers/media/platform/ti/omap3isp/isp.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/media/platform/ti/omap3isp/isp.c b/drivers/media/platform/ti/omap3isp/isp.c index e7327e38482d..f3aaa9e76492 100644 --- a/drivers/media/platform/ti/omap3isp/isp.c +++ b/drivers/media/platform/ti/omap3isp/isp.c @@ -1997,7 +1997,7 @@ static int isp_attach_iommu(struct isp_device *isp) * * Always returns 0. */ -static int isp_remove(struct platform_device *pdev) +static void isp_remove(struct platform_device *pdev) { struct isp_device *isp = platform_get_drvdata(pdev); @@ -2014,8 +2014,6 @@ static int isp_remove(struct platform_device *pdev) v4l2_async_nf_cleanup(&isp->notifier); kfree(isp); - - return 0; } enum isp_of_phy { @@ -2476,7 +2474,7 @@ MODULE_DEVICE_TABLE(of, omap3isp_of_table); static struct platform_driver omap3isp_driver = { .probe = isp_probe, - .remove = isp_remove, + .remove_new = isp_remove, .id_table = omap3isp_id_table, .driver = { .name = "omap3isp", From patchwork Sun Mar 26 14:31:58 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= X-Patchwork-Id: 13188233 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id A1392C77B62 for ; Sun, 26 Mar 2023 14:34:11 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232496AbjCZOeK (ORCPT ); Sun, 26 Mar 2023 10:34:10 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60656 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232468AbjCZOc5 (ORCPT ); Sun, 26 Mar 2023 10:32:57 -0400 Received: from metis.ext.pengutronix.de (metis.ext.pengutronix.de [IPv6:2001:67c:670:201:290:27ff:fe1d:cc33]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B96B47DBA for ; Sun, 26 Mar 2023 07:32:54 -0700 (PDT) Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.ext.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pgRQO-0000Fb-QZ; Sun, 26 Mar 2023 16:32:48 +0200 Received: from [2a0a:edc0:0:900:1d::77] (helo=ptz.office.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtp (Exim 4.94.2) (envelope-from ) id 1pgRQM-006rfu-Hs; Sun, 26 Mar 2023 16:32:46 +0200 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1pgRQL-0088Ze-84; Sun, 26 Mar 2023 16:32:45 +0200 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Benoit Parrot , Mauro Carvalho Chehab Cc: linux-media@vger.kernel.org, kernel@pengutronix.de Subject: [PATCH 091/117] media: vpe: Convert to platform remove callback returning void Date: Sun, 26 Mar 2023 16:31:58 +0200 Message-Id: <20230326143224.572654-94-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230326143224.572654-1-u.kleine-koenig@pengutronix.de> References: <20230326143224.572654-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1731; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=SaKb+M7SZFcHMEysg5wDiPuqmhYqhK2drrNQp5pds38=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBkIFbyQpp6VepQDtlLVuvwIXNeeOBBOKN6lKs53 4qfFuWzuZeJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZCBW8gAKCRCPgPtYfRL+ TtUdB/0f1ijkgu/EuWxbhugIXF7JLxYQa4loEp6Bfmg+0bZ3jPkWNONnbtqoTONCZ7RJBl3p6tT AUqSpfvoHnZ5WQI4UY05rEfeip3zsuHs3U57X/UtVl02IfcKfk6Ji6F9DmezhQtw1WkEBlSuOkO rdX3S8a30zvU6e7pCO18AgEYi8ku1udFR0+lB/s6NrW0D8Q3XvdFtGiGLNyOwvWUXAD/J3BCEEE uRl18TCPvbSwhHMkGKXhjMZN3SWjAKCJJSGB5+sjYB79HIJg7B29ohzz0Sgw20WBmo7wBKHy2Xb WnC3lRM0usdrwGVWml4gO0vHxU4zI1fiGNyG+ELTlwPUN+gO X-Developer-Key: i=u.kleine-koenig@pengutronix.de; a=openpgp; fpr=0D2511F322BFAB1C1580266BE2DCDD9132669BD6 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.ext.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-media@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@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 (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 --- drivers/media/platform/ti/vpe/vpe.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/media/platform/ti/vpe/vpe.c b/drivers/media/platform/ti/vpe/vpe.c index 5b1c5d96a407..6848cbc82f52 100644 --- a/drivers/media/platform/ti/vpe/vpe.c +++ b/drivers/media/platform/ti/vpe/vpe.c @@ -2622,7 +2622,7 @@ static int vpe_probe(struct platform_device *pdev) return ret; } -static int vpe_remove(struct platform_device *pdev) +static void vpe_remove(struct platform_device *pdev) { struct vpe_dev *dev = platform_get_drvdata(pdev); @@ -2635,8 +2635,6 @@ static int vpe_remove(struct platform_device *pdev) vpe_set_clock_enable(dev, 0); vpe_runtime_put(pdev); pm_runtime_disable(&pdev->dev); - - return 0; } #if defined(CONFIG_OF) @@ -2651,7 +2649,7 @@ MODULE_DEVICE_TABLE(of, vpe_of_match); static struct platform_driver vpe_pdrv = { .probe = vpe_probe, - .remove = vpe_remove, + .remove_new = vpe_remove, .driver = { .name = VPE_MODULE_NAME, .of_match_table = of_match_ptr(vpe_of_match), From patchwork Sun Mar 26 14:31:59 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= X-Patchwork-Id: 13188220 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 1BB27C74A5B for ; Sun, 26 Mar 2023 14:33:56 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231877AbjCZOdz (ORCPT ); Sun, 26 Mar 2023 10:33:55 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60384 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232433AbjCZOcy (ORCPT ); Sun, 26 Mar 2023 10:32:54 -0400 Received: from metis.ext.pengutronix.de (metis.ext.pengutronix.de [IPv6:2001:67c:670:201:290:27ff:fe1d:cc33]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BA84A7ED2 for ; Sun, 26 Mar 2023 07:32:52 -0700 (PDT) Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.ext.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pgRQO-0000Fg-Sl; Sun, 26 Mar 2023 16:32:48 +0200 Received: from [2a0a:edc0:0:900:1d::77] (helo=ptz.office.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtp (Exim 4.94.2) (envelope-from ) id 1pgRQM-006rfw-Hz; Sun, 26 Mar 2023 16:32:46 +0200 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1pgRQL-0088Zh-Dn; Sun, 26 Mar 2023 16:32:45 +0200 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Ezequiel Garcia , Philipp Zabel , Mauro Carvalho Chehab Cc: linux-media@vger.kernel.org, linux-rockchip@lists.infradead.org, kernel@pengutronix.de Subject: [PATCH 092/117] media: hantro_drv: Convert to platform remove callback returning void Date: Sun, 26 Mar 2023 16:31:59 +0200 Message-Id: <20230326143224.572654-95-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230326143224.572654-1-u.kleine-koenig@pengutronix.de> References: <20230326143224.572654-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1845; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=TN8gitWclwX0bEZHPliWL+MpMfLhdwSxRa3vI9fej70=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBkIFbz+QQp+nHH7O8XtcFcJSBkWVdls+Q9/cJxR 6ZND9lYh66JATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZCBW8wAKCRCPgPtYfRL+ TkVtCACK0akQVv6Lp3WSIDoAtHERnPMPO49yB0zmpuOZE5kKHqReCRF2EDGls/IByydhEcpNnKq TWvZmrp26l21NstAP98GPS/R5pu2lOgcA4w5QU0JinvMx8CVQfV/et3GGhN5eUEys164wI0t1xz b1rx6FXjsnFkcRkrkmNYzyF879IMj4kip4X4n0GOKbN0fs011q1cicnQKnIwuBmKSxM234b7bDE DYX7rgDmsFeQXsbAQKuhTQ/1Ywiy0SkPmc1+0ko07QoYiQ7uQpDeueR70MNf1naeHzD6J9lmiad Zc9kHofDAaX7T5CX6EnqXrD7H5T0DQdnyrRFFxqpVxS5FwkS X-Developer-Key: i=u.kleine-koenig@pengutronix.de; a=openpgp; fpr=0D2511F322BFAB1C1580266BE2DCDD9132669BD6 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.ext.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-media@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@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 (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 --- drivers/media/platform/verisilicon/hantro_drv.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/drivers/media/platform/verisilicon/hantro_drv.c b/drivers/media/platform/verisilicon/hantro_drv.c index b0aeedae7b65..ddec42d0bd49 100644 --- a/drivers/media/platform/verisilicon/hantro_drv.c +++ b/drivers/media/platform/verisilicon/hantro_drv.c @@ -1093,7 +1093,7 @@ static int hantro_probe(struct platform_device *pdev) return ret; } -static int hantro_remove(struct platform_device *pdev) +static void hantro_remove(struct platform_device *pdev) { struct hantro_dev *vpu = platform_get_drvdata(pdev); @@ -1109,7 +1109,6 @@ static int hantro_remove(struct platform_device *pdev) reset_control_assert(vpu->resets); pm_runtime_dont_use_autosuspend(vpu->dev); pm_runtime_disable(vpu->dev); - return 0; } #ifdef CONFIG_PM @@ -1132,7 +1131,7 @@ static const struct dev_pm_ops hantro_pm_ops = { static struct platform_driver hantro_driver = { .probe = hantro_probe, - .remove = hantro_remove, + .remove_new = hantro_remove, .driver = { .name = DRIVER_NAME, .of_match_table = of_match_ptr(of_hantro_match), From patchwork Sun Mar 26 14:32:00 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= X-Patchwork-Id: 13188245 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 02D6FC6FD1C for ; Sun, 26 Mar 2023 14:34:24 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232532AbjCZOeW (ORCPT ); Sun, 26 Mar 2023 10:34:22 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:32816 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232533AbjCZOdB (ORCPT ); Sun, 26 Mar 2023 10:33:01 -0400 Received: from metis.ext.pengutronix.de (metis.ext.pengutronix.de [IPv6:2001:67c:670:201:290:27ff:fe1d:cc33]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 60A9E116 for ; Sun, 26 Mar 2023 07:32:55 -0700 (PDT) Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.ext.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pgRQO-0000Fu-TQ; Sun, 26 Mar 2023 16:32:48 +0200 Received: from [2a0a:edc0:0:900:1d::77] (helo=ptz.office.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtp (Exim 4.94.2) (envelope-from ) id 1pgRQM-006rg3-Mt; Sun, 26 Mar 2023 16:32:46 +0200 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1pgRQL-0088Zl-KM; Sun, 26 Mar 2023 16:32:45 +0200 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Mauro Carvalho Chehab , =?utf-8?q?Uwe_Kleine-K=C3=B6?= =?utf-8?q?nig?= Cc: linux-media@vger.kernel.org, kernel@pengutronix.de Subject: [PATCH 093/117] media: via-camera: Convert to platform remove callback returning void Date: Sun, 26 Mar 2023 16:32:00 +0200 Message-Id: <20230326143224.572654-96-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230326143224.572654-1-u.kleine-koenig@pengutronix.de> References: <20230326143224.572654-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1773; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=2h6vp3wygh+fbHmZXfq4/Vx9AJtxfUJMECyNAvYwd04=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBkIFb09U6of+mDzpe4TOPtOftDqHMmIDD4eDNsw QXpuK0/f5OJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZCBW9AAKCRCPgPtYfRL+ Tp1cCACN+Tn57qYVYJ5RHB4upQZ8VPnlyvyz/FoirmxlnxTBzIGF/b1ZYA8LdcrdoSLVGsYgp30 heDQx5DdEgCNeWMeHM+8xxgSnciVs4ym8wSBO0m5fy+g86aGW47RJLTDihcByr5rHr6EhnfO9Ix EfV9bQkZRc/P1uGK4/K3CRVMeM56Hr3GV/tEY1URgfDP0oT73X3olQTOrE1xw7B5uMffuhCV+bC 3yrg4/mebS4E93q3HrpVcdKzoTCqGvQsdFd0oAxY21ZxqJtHuZU8ytFLLPy5Jt0rW0c6MRMTfUo 8vfroEMevnNzdOxdatfI4SbjaJbLwE3BkIzog6AqHaSPuvXp X-Developer-Key: i=u.kleine-koenig@pengutronix.de; a=openpgp; fpr=0D2511F322BFAB1C1580266BE2DCDD9132669BD6 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.ext.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-media@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@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 (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 --- drivers/media/platform/via/via-camera.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/drivers/media/platform/via/via-camera.c b/drivers/media/platform/via/via-camera.c index 95483c84c3f2..94a1260ac393 100644 --- a/drivers/media/platform/via/via-camera.c +++ b/drivers/media/platform/via/via-camera.c @@ -1294,7 +1294,7 @@ static int viacam_probe(struct platform_device *pdev) return ret; } -static int viacam_remove(struct platform_device *pdev) +static void viacam_remove(struct platform_device *pdev) { struct via_camera *cam = via_cam_info; struct viafb_dev *viadev = pdev->dev.platform_data; @@ -1309,7 +1309,6 @@ static int viacam_remove(struct platform_device *pdev) v4l2_ctrl_handler_free(&cam->ctrl_handler); kfree(cam); via_cam_info = NULL; - return 0; } static struct platform_driver viacam_driver = { @@ -1317,7 +1316,7 @@ static struct platform_driver viacam_driver = { .name = "viafb-camera", }, .probe = viacam_probe, - .remove = viacam_remove, + .remove_new = viacam_remove, }; module_platform_driver(viacam_driver); From patchwork Sun Mar 26 14:32:01 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= X-Patchwork-Id: 13188217 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 2E55AC74A5B for ; Sun, 26 Mar 2023 14:33:52 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231929AbjCZOdv (ORCPT ); Sun, 26 Mar 2023 10:33:51 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60432 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232467AbjCZOcy (ORCPT ); Sun, 26 Mar 2023 10:32:54 -0400 Received: from metis.ext.pengutronix.de (metis.ext.pengutronix.de [IPv6:2001:67c:670:201:290:27ff:fe1d:cc33]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B8E8E7ECC for ; Sun, 26 Mar 2023 07:32:52 -0700 (PDT) Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.ext.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pgRQP-0000GL-69; Sun, 26 Mar 2023 16:32:49 +0200 Received: from [2a0a:edc0:0:900:1d::77] (helo=ptz.office.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtp (Exim 4.94.2) (envelope-from ) id 1pgRQM-006rgB-Td; Sun, 26 Mar 2023 16:32:46 +0200 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1pgRQL-0088Zp-TV; Sun, 26 Mar 2023 16:32:45 +0200 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Philipp Zabel , Mauro Carvalho Chehab Cc: linux-media@vger.kernel.org, kernel@pengutronix.de Subject: [PATCH 094/117] media: video-mux: Convert to platform remove callback returning void Date: Sun, 26 Mar 2023 16:32:01 +0200 Message-Id: <20230326143224.572654-97-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230326143224.572654-1-u.kleine-koenig@pengutronix.de> References: <20230326143224.572654-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1860; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=h1onB/c1Jnrpm4RTRzscKg21G0D/eJyhFSEGCySoO2Y=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBkIFb1eA7MaooTUb0Xcs81sXqjXayel8WLXW6Ku pTvFH3EZ4KJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZCBW9QAKCRCPgPtYfRL+ TvkvCACiUUarEWB50YIbkYouYFf+P+Dus1wS0UYKfx1sdPCefJNdoD8fLfzsOs/bxAF1rbeNcms g3oUl88zSSmR/r7kU4QKxZLrQpPPW6nR6z4VpTioX70KT7w993Uey/XWyVUR1onTAdeFt13KcdM 2e3LGMZlFd6bzgN+aQ81nWYMNj0axKyc0V/fKEgxObGP0KhkKQhEa/eAwQimFDOXwjBZo/kZUOW dAc5htirvnbfdRLUvyQ9wSpiIQ7UL3kkViSLbTWB6GSH4zZzWVpe75WgeIwkB9ModyRML5Orac6 baor3/QkvdmB3bXTcZWtClPPtVquj4jvzXxPu8GHYttC6ALt X-Developer-Key: i=u.kleine-koenig@pengutronix.de; a=openpgp; fpr=0D2511F322BFAB1C1580266BE2DCDD9132669BD6 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.ext.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-media@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@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 (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 --- drivers/media/platform/video-mux.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/media/platform/video-mux.c b/drivers/media/platform/video-mux.c index 71d97042a470..1d9f32e5a917 100644 --- a/drivers/media/platform/video-mux.c +++ b/drivers/media/platform/video-mux.c @@ -481,7 +481,7 @@ static int video_mux_probe(struct platform_device *pdev) return ret; } -static int video_mux_remove(struct platform_device *pdev) +static void video_mux_remove(struct platform_device *pdev) { struct video_mux *vmux = platform_get_drvdata(pdev); struct v4l2_subdev *sd = &vmux->subdev; @@ -490,8 +490,6 @@ static int video_mux_remove(struct platform_device *pdev) v4l2_async_nf_cleanup(&vmux->notifier); v4l2_async_unregister_subdev(sd); media_entity_cleanup(&sd->entity); - - return 0; } static const struct of_device_id video_mux_dt_ids[] = { @@ -502,7 +500,7 @@ MODULE_DEVICE_TABLE(of, video_mux_dt_ids); static struct platform_driver video_mux_driver = { .probe = video_mux_probe, - .remove = video_mux_remove, + .remove_new = video_mux_remove, .driver = { .of_match_table = video_mux_dt_ids, .name = "video-mux", From patchwork Sun Mar 26 14:32:02 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= X-Patchwork-Id: 13188255 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 30244C74A5B for ; Sun, 26 Mar 2023 14:34:33 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232602AbjCZOec (ORCPT ); Sun, 26 Mar 2023 10:34:32 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:32776 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232548AbjCZOdF (ORCPT ); Sun, 26 Mar 2023 10:33:05 -0400 Received: from metis.ext.pengutronix.de (metis.ext.pengutronix.de [IPv6:2001:67c:670:201:290:27ff:fe1d:cc33]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 79D1765AB for ; Sun, 26 Mar 2023 07:32:58 -0700 (PDT) Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.ext.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pgRQP-0000GD-Iz; Sun, 26 Mar 2023 16:32:49 +0200 Received: from [2a0a:edc0:0:900:1d::77] (helo=ptz.office.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtp (Exim 4.94.2) (envelope-from ) id 1pgRQM-006rg7-Qn; Sun, 26 Mar 2023 16:32:46 +0200 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1pgRQM-0088Zv-5E; Sun, 26 Mar 2023 16:32:46 +0200 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Hyun Kwon , Laurent Pinchart , Mauro Carvalho Chehab , Michal Simek Cc: linux-media@vger.kernel.org, linux-arm-kernel@lists.infradead.org, kernel@pengutronix.de Subject: [PATCH 095/117] media: xilinx-csi2rxss: Convert to platform remove callback returning void Date: Sun, 26 Mar 2023 16:32:02 +0200 Message-Id: <20230326143224.572654-98-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230326143224.572654-1-u.kleine-koenig@pengutronix.de> References: <20230326143224.572654-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1953; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=FZR4BFA0Qk42KswnwMjnFUu/VtbyKPil5uHT81HsGo4=; b=owGbwMvMwMXY3/A7olbonx/jabUkhhSFsD+pFaoTc9sYO8RXXfovlvmVO688aFv8lRROFX+Nl Ok1l7I7GY1ZGBi5GGTFFFnsG9dkWlXJRXau/XcZZhArE8gUBi5OAZiIJiP7//hJoZW7y091sW6S jqyxmSJjPLnkEA8vTxcTd2V8xtTkatGvk7lfP7z1vYazt/uneoDolIv7c1ZPEWFIqSiJWJDLcCv E4Jv0ng9xXUbH09NmRZzxbvyRwrNVeZ5p2/bK/uJvHz7JaHoblu5YvlHKlqkw7xhLS/RNsSO2Oy 5N/6H6zflchqZ1xbO/8xY1yNVxqfu81dnzmu1QpHC28cTWk3WSma9EdRs6xS4+ms86n+/va6Pqt 7NmV2id9LYRXWNj4L0l7+7v0x0bMn8/ynSpDW6evPHKxrkrtxzflOc7NTAh0U5EPWiVY+GjWX+V bm9UMbHwjA/NmrtWQa7yzjzW1/LyDnnzqxq9d85JDXgPAA== X-Developer-Key: i=u.kleine-koenig@pengutronix.de; a=openpgp; fpr=0D2511F322BFAB1C1580266BE2DCDD9132669BD6 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.ext.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-media@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@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 (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 --- drivers/media/platform/xilinx/xilinx-csi2rxss.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/media/platform/xilinx/xilinx-csi2rxss.c b/drivers/media/platform/xilinx/xilinx-csi2rxss.c index d8a23f18cfbc..5b53745fe44e 100644 --- a/drivers/media/platform/xilinx/xilinx-csi2rxss.c +++ b/drivers/media/platform/xilinx/xilinx-csi2rxss.c @@ -1059,7 +1059,7 @@ static int xcsi2rxss_probe(struct platform_device *pdev) return ret; } -static int xcsi2rxss_remove(struct platform_device *pdev) +static void xcsi2rxss_remove(struct platform_device *pdev) { struct xcsi2rxss_state *xcsi2rxss = platform_get_drvdata(pdev); struct v4l2_subdev *subdev = &xcsi2rxss->subdev; @@ -1070,8 +1070,6 @@ static int xcsi2rxss_remove(struct platform_device *pdev) mutex_destroy(&xcsi2rxss->lock); clk_bulk_disable_unprepare(num_clks, xcsi2rxss->clks); clk_bulk_put(num_clks, xcsi2rxss->clks); - - return 0; } static const struct of_device_id xcsi2rxss_of_id_table[] = { @@ -1086,7 +1084,7 @@ static struct platform_driver xcsi2rxss_driver = { .of_match_table = xcsi2rxss_of_id_table, }, .probe = xcsi2rxss_probe, - .remove = xcsi2rxss_remove, + .remove_new = xcsi2rxss_remove, }; module_platform_driver(xcsi2rxss_driver); From patchwork Sun Mar 26 14:32:03 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= X-Patchwork-Id: 13188247 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 92ECCC77B61 for ; Sun, 26 Mar 2023 14:34:25 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232411AbjCZOeY (ORCPT ); Sun, 26 Mar 2023 10:34:24 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33094 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232537AbjCZOdB (ORCPT ); Sun, 26 Mar 2023 10:33:01 -0400 Received: from metis.ext.pengutronix.de (metis.ext.pengutronix.de [IPv6:2001:67c:670:201:290:27ff:fe1d:cc33]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9FB174222 for ; Sun, 26 Mar 2023 07:32:56 -0700 (PDT) Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.ext.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pgRQP-0000Gw-Iu; Sun, 26 Mar 2023 16:32:49 +0200 Received: from [2a0a:edc0:0:900:1d::77] (helo=ptz.office.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtp (Exim 4.94.2) (envelope-from ) id 1pgRQN-006rgG-4Q; Sun, 26 Mar 2023 16:32:47 +0200 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1pgRQM-0088Zy-BM; Sun, 26 Mar 2023 16:32:46 +0200 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Hyun Kwon , Laurent Pinchart , Mauro Carvalho Chehab , Michal Simek Cc: linux-media@vger.kernel.org, linux-arm-kernel@lists.infradead.org, kernel@pengutronix.de Subject: [PATCH 096/117] media: xilinx-tpg: Convert to platform remove callback returning void Date: Sun, 26 Mar 2023 16:32:03 +0200 Message-Id: <20230326143224.572654-99-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230326143224.572654-1-u.kleine-koenig@pengutronix.de> References: <20230326143224.572654-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1821; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=xJns6D+KgLvHNTqGGeDmhK7PxGSbwNgfYYo8C86ngV8=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBkIFcC6QJJuuLDmbbRbtEb2CCwae6rQuuT2RrzA Q3Runy9C/KJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZCBXAgAKCRCPgPtYfRL+ Tnv4B/4saKNNmKzJRbUFbLwE4QCi1fcCdP/2m6MeY6E2opUl6sPvm0VsgoW6XOgVm7hwM2E6Saw 9YGjXFt/Np0FsToWrOYEJvsQtjPwLcWA47/WEV5uGlljrxSi/KP1F8K7yhilqoKL/mNKEuovj4A kKhkL7DZUl19wQjRov4qHwzC3cmYPfCN5wEt79QQz1Sdqwp6oeCrsGbOOSyDCk+crsNmlq8OYDO 4H6vvMNGhqoUvqyuL6YsTWQyK2BkbMTa7vFvBoAFpQszRF03N51RUNsEB0OFdgkR7YS3etXsWAS J8Cx8RqO2kpjELOYp0dsqMb6tiXS4titQVgU4zGkcShc2G+d X-Developer-Key: i=u.kleine-koenig@pengutronix.de; a=openpgp; fpr=0D2511F322BFAB1C1580266BE2DCDD9132669BD6 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.ext.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-media@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@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 (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 --- drivers/media/platform/xilinx/xilinx-tpg.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/media/platform/xilinx/xilinx-tpg.c b/drivers/media/platform/xilinx/xilinx-tpg.c index 0f2d5a0edf0c..80353ca44402 100644 --- a/drivers/media/platform/xilinx/xilinx-tpg.c +++ b/drivers/media/platform/xilinx/xilinx-tpg.c @@ -894,7 +894,7 @@ static int xtpg_probe(struct platform_device *pdev) return ret; } -static int xtpg_remove(struct platform_device *pdev) +static void xtpg_remove(struct platform_device *pdev) { struct xtpg_device *xtpg = platform_get_drvdata(pdev); struct v4l2_subdev *subdev = &xtpg->xvip.subdev; @@ -904,8 +904,6 @@ static int xtpg_remove(struct platform_device *pdev) media_entity_cleanup(&subdev->entity); xvip_cleanup_resources(&xtpg->xvip); - - return 0; } static SIMPLE_DEV_PM_OPS(xtpg_pm_ops, xtpg_pm_suspend, xtpg_pm_resume); @@ -923,7 +921,7 @@ static struct platform_driver xtpg_driver = { .of_match_table = xtpg_of_id_table, }, .probe = xtpg_probe, - .remove = xtpg_remove, + .remove_new = xtpg_remove, }; module_platform_driver(xtpg_driver); From patchwork Sun Mar 26 14:32:04 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= X-Patchwork-Id: 13188253 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id C989CC74A5B for ; Sun, 26 Mar 2023 14:34:30 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232592AbjCZOea (ORCPT ); Sun, 26 Mar 2023 10:34:30 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33420 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232524AbjCZOdE (ORCPT ); Sun, 26 Mar 2023 10:33:04 -0400 Received: from metis.ext.pengutronix.de (metis.ext.pengutronix.de [IPv6:2001:67c:670:201:290:27ff:fe1d:cc33]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 792A9658D for ; Sun, 26 Mar 2023 07:32:58 -0700 (PDT) Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.ext.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pgRQP-0000I5-It; Sun, 26 Mar 2023 16:32:49 +0200 Received: from [2a0a:edc0:0:900:1d::77] (helo=ptz.office.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtp (Exim 4.94.2) (envelope-from ) id 1pgRQN-006rgK-Cc; Sun, 26 Mar 2023 16:32:47 +0200 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1pgRQM-0088a1-GV; Sun, 26 Mar 2023 16:32:46 +0200 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Hyun Kwon , Laurent Pinchart , Mauro Carvalho Chehab , Michal Simek Cc: linux-media@vger.kernel.org, linux-arm-kernel@lists.infradead.org, kernel@pengutronix.de Subject: [PATCH 097/117] media: xilinx-vipp: Convert to platform remove callback returning void Date: Sun, 26 Mar 2023 16:32:04 +0200 Message-Id: <20230326143224.572654-100-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230326143224.572654-1-u.kleine-koenig@pengutronix.de> References: <20230326143224.572654-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1776; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=6OAWTHlekHyFbI7Rz7ASEg8jvG88Xk0LvzT5bYTgKnU=; b=owGbwMvMwMXY3/A7olbonx/jabUkhhSFcObaeBvD6Z1HD1tcU3Hr8GO7LCGvxt+veW9xpFBEl a3hlNOdjMYsDIxcDLJiiiz2jWsyrarkIjvX/rsMM4iVCWQKAxenAEzkhwb7b3bHa/qqi4/OVm+5 7LngcFVu9uUfU4QfJwSHsl5lbH7l8Wxm/Z0E/7Lbmh1J9kaGMw70bvdwe28wU9bAbcebIO93OiG /m8xZn3kcDnX4tvOo3v1Vcw9HBi5KFbh4TXXLqVZXXe2Vd7qkPX5N5a5V7/mYOnHT19qL504H26 x4pxAkHfPIrnTWgfkO5ww7PK4qF6TN/t/0uTRya33KOZ6t35TqvC6dlVssDvS2bLfiqYc7bn1aY 7VSrZHzQNwn6Zz9ptFqncfFVd3is99ltjFcv3fRK3xq5tPrS1n86yxn5jBsThFfFuzRs2j6EQGR F3pCSwoL7rb9WPojb/l/++0aJ+Rb9S74Gwcumbnu5D9vAA== X-Developer-Key: i=u.kleine-koenig@pengutronix.de; a=openpgp; fpr=0D2511F322BFAB1C1580266BE2DCDD9132669BD6 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.ext.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-media@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@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 (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 --- drivers/media/platform/xilinx/xilinx-vipp.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/media/platform/xilinx/xilinx-vipp.c b/drivers/media/platform/xilinx/xilinx-vipp.c index 0a16c218a50a..3123216b3f70 100644 --- a/drivers/media/platform/xilinx/xilinx-vipp.c +++ b/drivers/media/platform/xilinx/xilinx-vipp.c @@ -617,14 +617,12 @@ static int xvip_composite_probe(struct platform_device *pdev) return ret; } -static int xvip_composite_remove(struct platform_device *pdev) +static void xvip_composite_remove(struct platform_device *pdev) { struct xvip_composite_device *xdev = platform_get_drvdata(pdev); xvip_graph_cleanup(xdev); xvip_composite_v4l2_cleanup(xdev); - - return 0; } static const struct of_device_id xvip_composite_of_id_table[] = { @@ -639,7 +637,7 @@ static struct platform_driver xvip_composite_driver = { .of_match_table = xvip_composite_of_id_table, }, .probe = xvip_composite_probe, - .remove = xvip_composite_remove, + .remove_new = xvip_composite_remove, }; module_platform_driver(xvip_composite_driver); From patchwork Sun Mar 26 14:32:05 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= X-Patchwork-Id: 13188262 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 5921CC77B61 for ; Sun, 26 Mar 2023 14:34:37 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232598AbjCZOeg (ORCPT ); Sun, 26 Mar 2023 10:34:36 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60370 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232517AbjCZOdI (ORCPT ); Sun, 26 Mar 2023 10:33:08 -0400 Received: from metis.ext.pengutronix.de (metis.ext.pengutronix.de [IPv6:2001:67c:670:201:290:27ff:fe1d:cc33]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 862346A69 for ; Sun, 26 Mar 2023 07:32:58 -0700 (PDT) Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.ext.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pgRQP-0000JC-It; Sun, 26 Mar 2023 16:32:49 +0200 Received: from [2a0a:edc0:0:900:1d::77] (helo=ptz.office.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtp (Exim 4.94.2) (envelope-from ) id 1pgRQN-006rgS-Jx; Sun, 26 Mar 2023 16:32:47 +0200 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1pgRQM-0088a8-Q6; Sun, 26 Mar 2023 16:32:46 +0200 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Hyun Kwon , Laurent Pinchart , Mauro Carvalho Chehab , Michal Simek Cc: linux-media@vger.kernel.org, linux-arm-kernel@lists.infradead.org, kernel@pengutronix.de Subject: [PATCH 098/117] media: xilinx-vtc: Convert to platform remove callback returning void Date: Sun, 26 Mar 2023 16:32:05 +0200 Message-Id: <20230326143224.572654-101-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230326143224.572654-1-u.kleine-koenig@pengutronix.de> References: <20230326143224.572654-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1668; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=fjr9tIdSc05qYF67imX4hoFI+DzF97z0DWpSMN62+oE=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBkIFcEFx/flNwnvLYI9GWtIGv3ypiUAXSmRQPyV ZcEej2frS2JATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZCBXBAAKCRCPgPtYfRL+ TsYdB/9MMLLYwXMHe4GjBsaII48sj95krtIMwxjGZOT8LmA2PwFQAk3rLk6/97DB0SJe2ONfvY4 6Y6r1Lc+A83Q1R/Y9NbKC9BnzXYrB8ItU+OnCo8iWD9P2AKj2OHGamp3BYZtSv6uXBLoVbiaymO eYpHrTrOTejCfsjHliMNGesmNPl0+xcNez7bCpDJYl4BSjlEykBVpZ5JQSAiSyryphp315oksar vRbkKgPcfGsWKmKt5ftNF0rThPhr1hVfR44EL6aAwReXvc1oCilt8fbsFZJAnERgVBd9ec9EBa6 jLAPGgNmIdn6nynsLI30O/MhyQEFw7lv2F436u+PNkU/tuio X-Developer-Key: i=u.kleine-koenig@pengutronix.de; a=openpgp; fpr=0D2511F322BFAB1C1580266BE2DCDD9132669BD6 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.ext.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-media@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@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 (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 --- drivers/media/platform/xilinx/xilinx-vtc.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/media/platform/xilinx/xilinx-vtc.c b/drivers/media/platform/xilinx/xilinx-vtc.c index 0ae0208d7529..0d5e35c29488 100644 --- a/drivers/media/platform/xilinx/xilinx-vtc.c +++ b/drivers/media/platform/xilinx/xilinx-vtc.c @@ -344,15 +344,13 @@ static int xvtc_probe(struct platform_device *pdev) return 0; } -static int xvtc_remove(struct platform_device *pdev) +static void xvtc_remove(struct platform_device *pdev) { struct xvtc_device *xvtc = platform_get_drvdata(pdev); xvtc_unregister_device(xvtc); xvip_cleanup_resources(&xvtc->xvip); - - return 0; } static const struct of_device_id xvtc_of_id_table[] = { @@ -367,7 +365,7 @@ static struct platform_driver xvtc_driver = { .of_match_table = xvtc_of_id_table, }, .probe = xvtc_probe, - .remove = xvtc_remove, + .remove_new = xvtc_remove, }; module_platform_driver(xvtc_driver); From patchwork Sun Mar 26 14:32:06 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= X-Patchwork-Id: 13188267 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 30EF5C761AF for ; Sun, 26 Mar 2023 14:34:47 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232614AbjCZOeo (ORCPT ); Sun, 26 Mar 2023 10:34:44 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34212 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232547AbjCZOdN (ORCPT ); Sun, 26 Mar 2023 10:33:13 -0400 Received: from metis.ext.pengutronix.de (metis.ext.pengutronix.de [IPv6:2001:67c:670:201:290:27ff:fe1d:cc33]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D38A77D99 for ; Sun, 26 Mar 2023 07:33:02 -0700 (PDT) Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.ext.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pgRQS-0000Ji-BJ; Sun, 26 Mar 2023 16:32:52 +0200 Received: from [2a0a:edc0:0:900:1d::77] (helo=ptz.office.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtp (Exim 4.94.2) (envelope-from ) id 1pgRQN-006rgW-MV; Sun, 26 Mar 2023 16:32:47 +0200 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1pgRQN-0088aD-0S; Sun, 26 Mar 2023 16:32:47 +0200 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Mauro Carvalho Chehab , ye xingchen , =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= , Hans Verkuil Cc: linux-media@vger.kernel.org, kernel@pengutronix.de Subject: [PATCH 099/117] media: radio-si476x: Convert to platform remove callback returning void Date: Sun, 26 Mar 2023 16:32:06 +0200 Message-Id: <20230326143224.572654-102-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230326143224.572654-1-u.kleine-koenig@pengutronix.de> References: <20230326143224.572654-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1812; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=2aklwToCXXRcjaigeHXKipepUnrBG+3zgugohz+5bWU=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBkIFcKoU41xTLAaY+LpBeprbrGWgQIyFEcBIOf2 /O5DQd0gReJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZCBXCgAKCRCPgPtYfRL+ TmCBB/0TpQ5NlybANWiRB8yvOnQyuYaWieYBXkJo+OyGFhXaJ4pp48uG2jRtjjLLjgYdA8uQM5I 0Zt92agnadmDd2vW8lFC08RfyT9fabGcHhBGEJAF6Olet3N9CJU/tvj92HuYEVZFv6OoK8WrkSh leVOFrwfP8yASWHCazhTITmLjv0QwIXAESSV7MRLEEkvaTqa4Sl5ewHuCqeuS70xy/hh1DUWFEl F7iwfaiKG/JGY/0qioX17ez9HhC7eS5ME5kZaBveeVWGLOAe/JFmr8QYuT/GgU9vTv8X+ICBkdI v014p9+DKlThQdv/jR+5yDZ6dUxh/wm/wP4/bG2XpwCFLeXR X-Developer-Key: i=u.kleine-koenig@pengutronix.de; a=openpgp; fpr=0D2511F322BFAB1C1580266BE2DCDD9132669BD6 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.ext.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-media@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@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 (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 --- drivers/media/radio/radio-si476x.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/media/radio/radio-si476x.c b/drivers/media/radio/radio-si476x.c index 171f9cc9ee5e..6061506159f1 100644 --- a/drivers/media/radio/radio-si476x.c +++ b/drivers/media/radio/radio-si476x.c @@ -1498,7 +1498,7 @@ static int si476x_radio_probe(struct platform_device *pdev) return rval; } -static int si476x_radio_remove(struct platform_device *pdev) +static void si476x_radio_remove(struct platform_device *pdev) { struct si476x_radio *radio = platform_get_drvdata(pdev); @@ -1506,8 +1506,6 @@ static int si476x_radio_remove(struct platform_device *pdev) video_unregister_device(&radio->videodev); v4l2_device_unregister(&radio->v4l2dev); debugfs_remove_recursive(radio->debugfs); - - return 0; } MODULE_ALIAS("platform:si476x-radio"); @@ -1517,7 +1515,7 @@ static struct platform_driver si476x_radio_driver = { .name = DRIVER_NAME, }, .probe = si476x_radio_probe, - .remove = si476x_radio_remove, + .remove_new = si476x_radio_remove, }; module_platform_driver(si476x_radio_driver); From patchwork Sun Mar 26 14:32:07 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= X-Patchwork-Id: 13188238 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 30E1DC77B6E for ; Sun, 26 Mar 2023 14:34:16 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232513AbjCZOeP (ORCPT ); Sun, 26 Mar 2023 10:34:15 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60632 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232521AbjCZOc7 (ORCPT ); Sun, 26 Mar 2023 10:32:59 -0400 Received: from metis.ext.pengutronix.de (metis.ext.pengutronix.de [IPv6:2001:67c:670:201:290:27ff:fe1d:cc33]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 78038186 for ; Sun, 26 Mar 2023 07:32:55 -0700 (PDT) Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.ext.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pgRQQ-0000L2-44; Sun, 26 Mar 2023 16:32:50 +0200 Received: from [2a0a:edc0:0:900:1d::77] (helo=ptz.office.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtp (Exim 4.94.2) (envelope-from ) id 1pgRQN-006rgc-Uv; Sun, 26 Mar 2023 16:32:47 +0200 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1pgRQN-0088aH-7i; Sun, 26 Mar 2023 16:32:47 +0200 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Mauro Carvalho Chehab , =?utf-8?q?Uwe_Kleine-K=C3=B6?= =?utf-8?q?nig?= Cc: linux-media@vger.kernel.org, kernel@pengutronix.de Subject: [PATCH 100/117] media: radio-timb: Convert to platform remove callback returning void Date: Sun, 26 Mar 2023 16:32:07 +0200 Message-Id: <20230326143224.572654-103-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230326143224.572654-1-u.kleine-koenig@pengutronix.de> References: <20230326143224.572654-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1671; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=nWvweDVqfu3Nzzfs+iXDU6woYmBXHy6lg55QsX9SW0w=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBkIFcQYHRMdQAN/UTpdGePU06mqNjXFAPLlgfTK CbJ7e8jy4yJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZCBXEAAKCRCPgPtYfRL+ Thc2CACALeSbXVVS1FH7Un3EpAi9OlN1oMBqi26jnj8Ter3oASBeXd9j+CKpkJbbTgnm4gg3GA2 X895KD0IjBR0ZL6kxJENjh9nNl0ngNV03Lgk9w7ua2sO3EMSFTVQGKaQ/pKakXs47aP1+zsbjPN m6cN384bpUDG0PvrsIquA++CZxI7KRKGzLJNmjBkQPnKE99lNBHOVCktZQsbQse+WO0TH+0kBGA K0LoRKwoQhRX2SF3Cwx8Secr6DdhQTR6iGFxJxuDVc7CK9ou1vSRmziqWMj+hEx02LYpRk9aoy/ Uu2C34jVF/ydfYU+V87i8NG6GuILYNQ+Fl32mI8dS1jU9/RK X-Developer-Key: i=u.kleine-koenig@pengutronix.de; a=openpgp; fpr=0D2511F322BFAB1C1580266BE2DCDD9132669BD6 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.ext.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-media@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@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 (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 --- drivers/media/radio/radio-timb.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/drivers/media/radio/radio-timb.c b/drivers/media/radio/radio-timb.c index 948ee3eec914..04daa9c358c2 100644 --- a/drivers/media/radio/radio-timb.c +++ b/drivers/media/radio/radio-timb.c @@ -151,13 +151,12 @@ static int timbradio_probe(struct platform_device *pdev) return err; } -static int timbradio_remove(struct platform_device *pdev) +static void timbradio_remove(struct platform_device *pdev) { struct timbradio *tr = platform_get_drvdata(pdev); video_unregister_device(&tr->video_dev); v4l2_device_unregister(&tr->v4l2_dev); - return 0; } static struct platform_driver timbradio_platform_driver = { @@ -165,7 +164,7 @@ static struct platform_driver timbradio_platform_driver = { .name = DRIVER_NAME, }, .probe = timbradio_probe, - .remove = timbradio_remove, + .remove_new = timbradio_remove, }; module_platform_driver(timbradio_platform_driver); From patchwork Sun Mar 26 14:32:08 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= X-Patchwork-Id: 13188251 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id DA9C7C6FD1C for ; Sun, 26 Mar 2023 14:34:28 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232541AbjCZOe2 (ORCPT ); Sun, 26 Mar 2023 10:34:28 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60672 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231258AbjCZOdD (ORCPT ); Sun, 26 Mar 2023 10:33:03 -0400 Received: from metis.ext.pengutronix.de (metis.ext.pengutronix.de [IPv6:2001:67c:670:201:290:27ff:fe1d:cc33]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8D47813D for ; Sun, 26 Mar 2023 07:32:55 -0700 (PDT) Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.ext.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pgRQQ-0000NA-8i; Sun, 26 Mar 2023 16:32:50 +0200 Received: from [2a0a:edc0:0:900:1d::77] (helo=ptz.office.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtp (Exim 4.94.2) (envelope-from ) id 1pgRQO-006rgk-FR; Sun, 26 Mar 2023 16:32:48 +0200 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1pgRQN-0088aK-Fa; Sun, 26 Mar 2023 16:32:47 +0200 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Mauro Carvalho Chehab , =?utf-8?q?Uwe_Kleine-K=C3=B6?= =?utf-8?q?nig?= Cc: linux-media@vger.kernel.org, kernel@pengutronix.de Subject: [PATCH 101/117] media: radio-wl1273: Convert to platform remove callback returning void Date: Sun, 26 Mar 2023 16:32:08 +0200 Message-Id: <20230326143224.572654-104-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230326143224.572654-1-u.kleine-koenig@pengutronix.de> References: <20230326143224.572654-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1951; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=m+98ILAxhB1JrJH6KUHUClHXYNnJG1ulOPSZ9Z9Phrk=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBkIFcWYDIdXbl18q4mKEsMWqof/c2OlbGDW6GbU tcpJpBlauCJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZCBXFgAKCRCPgPtYfRL+ TstXB/sFt1Z1WbSQqQMATnaiD0LF8TFazz+aH/YX/1QvNCbHvgzMB2TzgD6Cq8KV7skTX5J7Bq1 27kZ4121pMpOLwATvDFe8axey6OgN0BsqyzBrhKQ5ox4is843J/l4m1durkzNrPX6/BIzMe1N9k smlHcWsPfu4/NXLOcK2iqVLxQ9uqbIaygmlg+KDMR5OgDtzpKq2154IVwzFr2L3gMJv1CSb/cCS /oxvRINLdVsekxEBarvzCxsZYi7ZoGD0EmbioLrwX2UmOud85Ns/0Rrra6mhv5tGZ3UakdiIhNt lIz5yu/aP2ecC9eWGjivWsH6RDbv+gdQ58vr721KroN3vgOY X-Developer-Key: i=u.kleine-koenig@pengutronix.de; a=openpgp; fpr=0D2511F322BFAB1C1580266BE2DCDD9132669BD6 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.ext.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-media@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@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 (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 --- drivers/media/radio/radio-wl1273.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/media/radio/radio-wl1273.c b/drivers/media/radio/radio-wl1273.c index 484046471c03..e8166eac9efe 100644 --- a/drivers/media/radio/radio-wl1273.c +++ b/drivers/media/radio/radio-wl1273.c @@ -1977,7 +1977,7 @@ static const struct video_device wl1273_viddev_template = { V4L2_CAP_RDS_OUTPUT, }; -static int wl1273_fm_radio_remove(struct platform_device *pdev) +static void wl1273_fm_radio_remove(struct platform_device *pdev) { struct wl1273_device *radio = platform_get_drvdata(pdev); struct wl1273_core *core = radio->core; @@ -1990,8 +1990,6 @@ static int wl1273_fm_radio_remove(struct platform_device *pdev) v4l2_ctrl_handler_free(&radio->ctrl_handler); video_unregister_device(&radio->videodev); v4l2_device_unregister(&radio->v4l2dev); - - return 0; } static int wl1273_fm_radio_probe(struct platform_device *pdev) @@ -2147,7 +2145,7 @@ static int wl1273_fm_radio_probe(struct platform_device *pdev) static struct platform_driver wl1273_fm_radio_driver = { .probe = wl1273_fm_radio_probe, - .remove = wl1273_fm_radio_remove, + .remove_new = wl1273_fm_radio_remove, .driver = { .name = "wl1273_fm_radio", }, From patchwork Sun Mar 26 14:32:09 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= X-Patchwork-Id: 13188242 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id AED32C761AF for ; Sun, 26 Mar 2023 14:34:20 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232596AbjCZOeT (ORCPT ); Sun, 26 Mar 2023 10:34:19 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:32812 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232474AbjCZOdB (ORCPT ); Sun, 26 Mar 2023 10:33:01 -0400 Received: from metis.ext.pengutronix.de (metis.ext.pengutronix.de [IPv6:2001:67c:670:201:290:27ff:fe1d:cc33]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7DBFF35A0 for ; Sun, 26 Mar 2023 07:32:55 -0700 (PDT) Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.ext.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pgRQQ-0000NV-HX; Sun, 26 Mar 2023 16:32:50 +0200 Received: from [2a0a:edc0:0:900:1d::77] (helo=ptz.office.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtp (Exim 4.94.2) (envelope-from ) id 1pgRQO-006rgo-JM; Sun, 26 Mar 2023 16:32:48 +0200 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1pgRQN-0088aO-LG; Sun, 26 Mar 2023 16:32:47 +0200 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Eduardo Valentin , Mauro Carvalho Chehab , =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= Cc: linux-media@vger.kernel.org, kernel@pengutronix.de Subject: [PATCH 102/117] media: radio-platform-si4713: Convert to platform remove callback returning void Date: Sun, 26 Mar 2023 16:32:09 +0200 Message-Id: <20230326143224.572654-105-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230326143224.572654-1-u.kleine-koenig@pengutronix.de> References: <20230326143224.572654-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=2081; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=latyRcX3Cuz+KrS8QqhhZjtxZX/vMr10c1SA0hWivvs=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBkIFcdFik6RuJGFqKxtuaCXsUOpA+2AqQXC5moZ wP1y+NUcLaJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZCBXHQAKCRCPgPtYfRL+ Tmy4B/4wm9m7UvS6kZiEzZ+XgydNqY7dpv2rRMYoxsuaEMoG8zU7f8iuWcbsK1W73+nqR3EAOj/ qQAYFpALz4onrsMaMYwAWEmK8f8HUQBq2xBBjdECL5+eQXCwfFL6QR75dXGQuACx2Gk0fFpUM6V YxGuVe5UBB95gbUKLNqjgHp8/TTTfGLatHxB9K6MeeUjEhu2Ri7gY8+AanSR5AyosYW/F59b6/V XTfZn/N8qrP/OUrh+MJduae2OduqirCBU4jDU0KGjxsRC4KLoxK0JcWopiZ+1D9yXFAUiFw4iSS umdeeb5toUOxnh6GGM6tUYlOKc6N1kfksg3ubfDyqGvc4cq4 X-Developer-Key: i=u.kleine-koenig@pengutronix.de; a=openpgp; fpr=0D2511F322BFAB1C1580266BE2DCDD9132669BD6 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.ext.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-media@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@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 (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 --- drivers/media/radio/si4713/radio-platform-si4713.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/media/radio/si4713/radio-platform-si4713.c b/drivers/media/radio/si4713/radio-platform-si4713.c index 433f9642786d..9fdaed68a962 100644 --- a/drivers/media/radio/si4713/radio-platform-si4713.c +++ b/drivers/media/radio/si4713/radio-platform-si4713.c @@ -190,7 +190,7 @@ static int radio_si4713_pdriver_probe(struct platform_device *pdev) } /* radio_si4713_pdriver_remove - remove the device */ -static int radio_si4713_pdriver_remove(struct platform_device *pdev) +static void radio_si4713_pdriver_remove(struct platform_device *pdev) { struct v4l2_device *v4l2_dev = platform_get_drvdata(pdev); struct radio_si4713_device *rsdev; @@ -198,8 +198,6 @@ static int radio_si4713_pdriver_remove(struct platform_device *pdev) rsdev = container_of(v4l2_dev, struct radio_si4713_device, v4l2_dev); video_unregister_device(&rsdev->radio_dev); v4l2_device_unregister(&rsdev->v4l2_dev); - - return 0; } static struct platform_driver radio_si4713_pdriver = { @@ -207,7 +205,7 @@ static struct platform_driver radio_si4713_pdriver = { .name = "radio-si4713", }, .probe = radio_si4713_pdriver_probe, - .remove = radio_si4713_pdriver_remove, + .remove_new = radio_si4713_pdriver_remove, }; module_platform_driver(radio_si4713_pdriver); From patchwork Sun Mar 26 14:32:10 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= X-Patchwork-Id: 13188232 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id BEFAFC6FD1C for ; Sun, 26 Mar 2023 14:34:10 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232374AbjCZOeK (ORCPT ); Sun, 26 Mar 2023 10:34:10 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33094 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232507AbjCZOc4 (ORCPT ); Sun, 26 Mar 2023 10:32:56 -0400 Received: from metis.ext.pengutronix.de (metis.ext.pengutronix.de [IPv6:2001:67c:670:201:290:27ff:fe1d:cc33]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 72CE17A80 for ; Sun, 26 Mar 2023 07:32:54 -0700 (PDT) Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.ext.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pgRQQ-0000OB-O7; Sun, 26 Mar 2023 16:32:50 +0200 Received: from [2a0a:edc0:0:900:1d::77] (helo=ptz.office.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtp (Exim 4.94.2) (envelope-from ) id 1pgRQO-006rgs-Q8; Sun, 26 Mar 2023 16:32:48 +0200 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1pgRQN-0088aT-Tl; Sun, 26 Mar 2023 16:32:47 +0200 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Sean Young , Mauro Carvalho Chehab Cc: linux-media@vger.kernel.org, kernel@pengutronix.de Subject: [PATCH 103/117] media: gpio-ir-recv: Convert to platform remove callback returning void Date: Sun, 26 Mar 2023 16:32:10 +0200 Message-Id: <20230326143224.572654-106-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230326143224.572654-1-u.kleine-koenig@pengutronix.de> References: <20230326143224.572654-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1843; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=QvTjRXH1Ge8Nj0NvbEA9hePV5pbkEDLl8Hpexb8vbZ4=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBkIFceT0E6MiCO45vSDr7pg0BJpGnuN25bGhoKe WBzc4mG5tuJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZCBXHgAKCRCPgPtYfRL+ TrACB/9Jd+qyE1bi1HzQQk5OOoXmLG8PM9mGhBChyT5JeYVymuK7MZl1OJT6NuGo/A+f0EVOunP vGDCa5RCgl+8l1UbTJEWE5Ih1+aj/GTweIc8LXB0etWe1lkUsHFLDHYvy5bX5XK842nGJyUXLNT jmwkygBJbtzGXvv4bF57POG0fU5erJAl1/JKcswdAP/ztHcl8yMIb9ZNWrE0WWxPVIe62OGA8Bs ng+kqzjpCGZ3/0WjZZwHElsWhn0IstqGNP9Mfy6QT+GiNqYC8IxvIDt4u9jW9se3qOlb8XDVJst KGwb6wM/0m5Fz4S9SW5xA9yrxLrTvGpCNv4gyX5bV+/p8Swo X-Developer-Key: i=u.kleine-koenig@pengutronix.de; a=openpgp; fpr=0D2511F322BFAB1C1580266BE2DCDD9132669BD6 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.ext.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-media@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@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 (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 --- drivers/media/rc/gpio-ir-recv.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/media/rc/gpio-ir-recv.c b/drivers/media/rc/gpio-ir-recv.c index 8dbe780dae4e..fb037788ec10 100644 --- a/drivers/media/rc/gpio-ir-recv.c +++ b/drivers/media/rc/gpio-ir-recv.c @@ -126,7 +126,7 @@ static int gpio_ir_recv_probe(struct platform_device *pdev) "gpio-ir-recv-irq", gpio_dev); } -static int gpio_ir_recv_remove(struct platform_device *pdev) +static void gpio_ir_recv_remove(struct platform_device *pdev) { struct gpio_rc_dev *gpio_dev = platform_get_drvdata(pdev); struct device *pmdev = gpio_dev->pmdev; @@ -139,8 +139,6 @@ static int gpio_ir_recv_remove(struct platform_device *pdev) pm_runtime_put_noidle(pmdev); pm_runtime_set_suspended(pmdev); } - - return 0; } #ifdef CONFIG_PM @@ -202,7 +200,7 @@ MODULE_DEVICE_TABLE(of, gpio_ir_recv_of_match); static struct platform_driver gpio_ir_recv_driver = { .probe = gpio_ir_recv_probe, - .remove = gpio_ir_recv_remove, + .remove_new = gpio_ir_recv_remove, .driver = { .name = KBUILD_MODNAME, .of_match_table = of_match_ptr(gpio_ir_recv_of_match), From patchwork Sun Mar 26 14:32:11 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= X-Patchwork-Id: 13188243 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 21A42C74A5B for ; Sun, 26 Mar 2023 14:34:22 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232599AbjCZOeU (ORCPT ); Sun, 26 Mar 2023 10:34:20 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60368 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232506AbjCZOdB (ORCPT ); Sun, 26 Mar 2023 10:33:01 -0400 Received: from metis.ext.pengutronix.de (metis.ext.pengutronix.de [IPv6:2001:67c:670:201:290:27ff:fe1d:cc33]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5B1D030E8 for ; Sun, 26 Mar 2023 07:32:55 -0700 (PDT) Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.ext.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pgRQR-0000Pb-0a; Sun, 26 Mar 2023 16:32:51 +0200 Received: from [2a0a:edc0:0:900:1d::77] (helo=ptz.office.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtp (Exim 4.94.2) (envelope-from ) id 1pgRQP-006rh1-4S; Sun, 26 Mar 2023 16:32:49 +0200 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1pgRQO-0088aX-58; Sun, 26 Mar 2023 16:32:48 +0200 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Sean Young , Mauro Carvalho Chehab , =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= Cc: linux-media@vger.kernel.org, kernel@pengutronix.de Subject: [PATCH 104/117] media: img-ir-core: Convert to platform remove callback returning void Date: Sun, 26 Mar 2023 16:32:11 +0200 Message-Id: <20230326143224.572654-107-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230326143224.572654-1-u.kleine-koenig@pengutronix.de> References: <20230326143224.572654-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1768; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=FdPbm/+UkY5FDBnASIREqYQAQDnzqtJogRXQYqD9aAM=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBkIFckmkC7sIz5o6kW4kmp3VjseL8y5jOILNUDV yxZFBVhRxGJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZCBXJAAKCRCPgPtYfRL+ TomGB/9OhPI8It4ZqkLvTVfnsaXYcl14zj2akyVC+oVEiC+zy9urokN0yZT4/EySfIFXVeZ85Ww D/INK4f8gIXGqpDmj9tBflYL0O6qip+Z5rq9p0b+LYsdVJuR8Y7L1KZGUjaDhHTyn/BiPav74Ec UM/GB16LbOEf73jIiIK+InAk0KE2L6LpPskmDtFkE04DviP5bOeQ+7dStozF+Kq8znfK9fdUFa0 vLYn36jwiwH7byjAHOylMhUVZeznn2UuCzlvpeh4AdsD5JQAZ8sl5mXA46KPKxNvoHcujBus2p9 QX+Z871JWG9dcUYTCwgfFquFWjKpiV9CqcaNohJQY+zBlwnf X-Developer-Key: i=u.kleine-koenig@pengutronix.de; a=openpgp; fpr=0D2511F322BFAB1C1580266BE2DCDD9132669BD6 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.ext.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-media@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@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 (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 --- drivers/media/rc/img-ir/img-ir-core.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/drivers/media/rc/img-ir/img-ir-core.c b/drivers/media/rc/img-ir/img-ir-core.c index 6f8464872033..d87d8e14c556 100644 --- a/drivers/media/rc/img-ir/img-ir-core.c +++ b/drivers/media/rc/img-ir/img-ir-core.c @@ -152,7 +152,7 @@ static int img_ir_probe(struct platform_device *pdev) return error; } -static int img_ir_remove(struct platform_device *pdev) +static void img_ir_remove(struct platform_device *pdev) { struct img_ir_priv *priv = platform_get_drvdata(pdev); @@ -164,7 +164,6 @@ static int img_ir_remove(struct platform_device *pdev) clk_disable_unprepare(priv->clk); if (!IS_ERR(priv->sys_clk)) clk_disable_unprepare(priv->sys_clk); - return 0; } static SIMPLE_DEV_PM_OPS(img_ir_pmops, img_ir_suspend, img_ir_resume); @@ -182,7 +181,7 @@ static struct platform_driver img_ir_driver = { .pm = &img_ir_pmops, }, .probe = img_ir_probe, - .remove = img_ir_remove, + .remove_new = img_ir_remove, }; module_platform_driver(img_ir_driver); From patchwork Sun Mar 26 14:32:12 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= X-Patchwork-Id: 13188234 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 76346C77B6D for ; Sun, 26 Mar 2023 14:34:12 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232498AbjCZOeL (ORCPT ); Sun, 26 Mar 2023 10:34:11 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60670 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232492AbjCZOc6 (ORCPT ); Sun, 26 Mar 2023 10:32:58 -0400 Received: from metis.ext.pengutronix.de (metis.ext.pengutronix.de [IPv6:2001:67c:670:201:290:27ff:fe1d:cc33]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BFFBE7EC1 for ; Sun, 26 Mar 2023 07:32:54 -0700 (PDT) Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.ext.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pgRQR-0000Qz-99; Sun, 26 Mar 2023 16:32:51 +0200 Received: from [2a0a:edc0:0:900:1d::77] (helo=ptz.office.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtp (Exim 4.94.2) (envelope-from ) id 1pgRQP-006rh6-BP; Sun, 26 Mar 2023 16:32:49 +0200 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1pgRQO-0088aa-Cs; Sun, 26 Mar 2023 16:32:48 +0200 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Sean Young , Mauro Carvalho Chehab Cc: linux-media@vger.kernel.org, kernel@pengutronix.de Subject: [PATCH 105/117] media: ir-hix5hd2: Convert to platform remove callback returning void Date: Sun, 26 Mar 2023 16:32:12 +0200 Message-Id: <20230326143224.572654-108-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230326143224.572654-1-u.kleine-koenig@pengutronix.de> References: <20230326143224.572654-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1614; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=mtLbrou9SKVEkBABSUi2K4pwMdvqkp4GLG45TFkXHfQ=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBkIFclyew6POx775Yj7c1pAel2Knwh87FkbkTU0 uKx802OhQqJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZCBXJQAKCRCPgPtYfRL+ Tk4aCACT8Ww3jBqVXChppHGZu5CZDttduJP688Y0KByN11AMvwm1NBgW/XplIV7S27VstWmDvdO HR77HE9dMzKb/zH9DjjAaX5uLWjzIhqRkW6Oa0aI5SSMtGhoWDnEcW6jduKa3BKvocpdnb6tzIo 6HhMi0htf7J4JOELRXNWOOHcqsm6TdAXHogfji5lHoLNAqjWjtKjO63HSz2anZwF6sHzlQt9SvH me1tqS5XBpbiJTNGjl+NJuOQPa64zpyZVZnzb/fmxOG55XU60oEvdQf/Z/Rhtw0i/k2PcKpUkAk +Kl+5aIvQ3JGkQ0bUv72WEasPNkRauGjku5CAjjyKJKDcgUd X-Developer-Key: i=u.kleine-koenig@pengutronix.de; a=openpgp; fpr=0D2511F322BFAB1C1580266BE2DCDD9132669BD6 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.ext.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-media@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@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 (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 --- drivers/media/rc/ir-hix5hd2.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/drivers/media/rc/ir-hix5hd2.c b/drivers/media/rc/ir-hix5hd2.c index 4ff954b11dc7..0034f615b466 100644 --- a/drivers/media/rc/ir-hix5hd2.c +++ b/drivers/media/rc/ir-hix5hd2.c @@ -340,13 +340,12 @@ static int hix5hd2_ir_probe(struct platform_device *pdev) return ret; } -static int hix5hd2_ir_remove(struct platform_device *pdev) +static void hix5hd2_ir_remove(struct platform_device *pdev) { struct hix5hd2_ir_priv *priv = platform_get_drvdata(pdev); clk_disable_unprepare(priv->clock); rc_unregister_device(priv->rdev); - return 0; } #ifdef CONFIG_PM_SLEEP @@ -395,7 +394,7 @@ static struct platform_driver hix5hd2_ir_driver = { .pm = &hix5hd2_ir_pm_ops, }, .probe = hix5hd2_ir_probe, - .remove = hix5hd2_ir_remove, + .remove_new = hix5hd2_ir_remove, }; module_platform_driver(hix5hd2_ir_driver); From patchwork Sun Mar 26 14:32:13 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= X-Patchwork-Id: 13188258 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id BEB1DC6FD1C for ; Sun, 26 Mar 2023 14:34:36 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232546AbjCZOef (ORCPT ); Sun, 26 Mar 2023 10:34:35 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60432 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232536AbjCZOdH (ORCPT ); Sun, 26 Mar 2023 10:33:07 -0400 Received: from metis.ext.pengutronix.de (metis.ext.pengutronix.de [IPv6:2001:67c:670:201:290:27ff:fe1d:cc33]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 79FB365B7 for ; Sun, 26 Mar 2023 07:32:58 -0700 (PDT) Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.ext.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pgRQR-0000RA-8t; Sun, 26 Mar 2023 16:32:51 +0200 Received: from [2a0a:edc0:0:900:1d::77] (helo=ptz.office.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtp (Exim 4.94.2) (envelope-from ) id 1pgRQP-006rh7-CS; Sun, 26 Mar 2023 16:32:49 +0200 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1pgRQO-0088ae-JD; Sun, 26 Mar 2023 16:32:48 +0200 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Sean Young , Mauro Carvalho Chehab , Neil Armstrong , Kevin Hilman Cc: Jerome Brunet , Martin Blumenstingl , linux-media@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-amlogic@lists.infradead.org, kernel@pengutronix.de Subject: [PATCH 106/117] media: meson-ir-tx: Convert to platform remove callback returning void Date: Sun, 26 Mar 2023 16:32:13 +0200 Message-Id: <20230326143224.572654-109-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230326143224.572654-1-u.kleine-koenig@pengutronix.de> References: <20230326143224.572654-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1674; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=kHPP5cAhCKQcnI3fcuUH21X+adxb7h92mrf8biP7X1I=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBkIFc2doI8Irf3L+APeL6fQdlbpWqvKqvbIdtL/ 9AfRTr1y3OJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZCBXNgAKCRCPgPtYfRL+ TiQPB/43rKAeYEk5tngWQ1afUwcGeaTDq/Ex5Lt4HVQ67loUPt2JA9ipfAI7uBnjBX/qYBEDItC 6TV00fMu6QEnNHjgyvSfDyiFqfQ6ccXaPLZEl6Z7E6dddPgGZevqg4rZ7iNmX4soGou0pfDaYy6 8A+ipF0AiIthobt2ZuQv3FmYh7Oo5e8f1AzZXUd5wdCfTCgk3VRarWs4LcTx4csFSMxPGOxWYkO wrcMO1sXIe/Z1+udrBVRtvdQqBHYccSxi+RdXAp0HDWuU+FesUaUGHNoXEFWKcbbmIS4Bez7Ll0 cYhPJ/8L6A61O91JsfUuakFBXJwy8/Tl/zJzDgff0M1N2IiZ X-Developer-Key: i=u.kleine-koenig@pengutronix.de; a=openpgp; fpr=0D2511F322BFAB1C1580266BE2DCDD9132669BD6 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.ext.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-media@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@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 (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 Reviewed-by: Martin Blumenstingl --- drivers/media/rc/meson-ir-tx.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/media/rc/meson-ir-tx.c b/drivers/media/rc/meson-ir-tx.c index abdb62b16e98..6355b79893fb 100644 --- a/drivers/media/rc/meson-ir-tx.c +++ b/drivers/media/rc/meson-ir-tx.c @@ -372,13 +372,11 @@ static int __init meson_irtx_probe(struct platform_device *pdev) return 0; } -static int meson_irtx_remove(struct platform_device *pdev) +static void meson_irtx_remove(struct platform_device *pdev) { struct rc_dev *rc = platform_get_drvdata(pdev); rc_unregister_device(rc); - - return 0; } static const struct of_device_id meson_irtx_dt_match[] = { @@ -390,7 +388,7 @@ static const struct of_device_id meson_irtx_dt_match[] = { MODULE_DEVICE_TABLE(of, meson_irtx_dt_match); static struct platform_driver meson_irtx_pd = { - .remove = meson_irtx_remove, + .remove_new = meson_irtx_remove, .driver = { .name = DRIVER_NAME, .of_match_table = meson_irtx_dt_match, From patchwork Sun Mar 26 14:32:14 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= X-Patchwork-Id: 13188254 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 83E99C77B61 for ; Sun, 26 Mar 2023 14:34:32 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232524AbjCZOea (ORCPT ); Sun, 26 Mar 2023 10:34:30 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33464 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232546AbjCZOdF (ORCPT ); Sun, 26 Mar 2023 10:33:05 -0400 Received: from metis.ext.pengutronix.de (metis.ext.pengutronix.de [IPv6:2001:67c:670:201:290:27ff:fe1d:cc33]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 794266593 for ; Sun, 26 Mar 2023 07:32:58 -0700 (PDT) Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.ext.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pgRQS-0000UE-1O; Sun, 26 Mar 2023 16:32:52 +0200 Received: from [2a0a:edc0:0:900:1d::77] (helo=ptz.office.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtp (Exim 4.94.2) (envelope-from ) id 1pgRQQ-006rhN-4K; Sun, 26 Mar 2023 16:32:50 +0200 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1pgRQO-0088ai-Qv; Sun, 26 Mar 2023 16:32:48 +0200 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Sean Young , Mauro Carvalho Chehab , Neil Armstrong , Kevin Hilman Cc: Jerome Brunet , Martin Blumenstingl , linux-media@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-amlogic@lists.infradead.org, kernel@pengutronix.de Subject: [PATCH 107/117] media: meson-ir: Convert to platform remove callback returning void Date: Sun, 26 Mar 2023 16:32:14 +0200 Message-Id: <20230326143224.572654-110-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230326143224.572654-1-u.kleine-koenig@pengutronix.de> References: <20230326143224.572654-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1811; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=wYp5LkcV04MNjqVKDISGMwVDxC08wU2j1G438UbXmc8=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBkIFc8B6ECdtaukjrMUlW1e4Am7PV23oSJwTSf7 OW/cQKXajuJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZCBXPAAKCRCPgPtYfRL+ TjD8B/9ityswRX4rXG8YFgpVAK+DucWXEhqR7mgWOi4xafFoXQHOz1DViHXR2fqT4og3dIxxdu7 PEGwuvFcnFXLKqLrUZJjAvw2FbwFxZoIVGKATTAljND2DFkHNewqzg2oNwoPTy6lsnrMKuH2lr8 yqG5fnuSuZzCOzfGjsDx0QwQjyMb9Fo6f6KXCU0Ubb7agkNLhofwlos+0WEIjKBRSQCX17aDY+j 3fozbtMGts5Cmg2cJD8HzYzWli2I1Qw0oZFjjSXcVGKQ5zIj6FMQ/ig+Ymu31dH2t5rJvNKD3PW Y5Xufu+bEPutpRRx4q9VpqDh4mAP2h/E1t5hTHHNdUHAw7Vn X-Developer-Key: i=u.kleine-koenig@pengutronix.de; a=openpgp; fpr=0D2511F322BFAB1C1580266BE2DCDD9132669BD6 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.ext.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-media@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@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 (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 Reviewed-by: Martin Blumenstingl --- drivers/media/rc/meson-ir.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/media/rc/meson-ir.c b/drivers/media/rc/meson-ir.c index 4b769111f78e..49aa309d1a8c 100644 --- a/drivers/media/rc/meson-ir.c +++ b/drivers/media/rc/meson-ir.c @@ -177,7 +177,7 @@ static int meson_ir_probe(struct platform_device *pdev) return 0; } -static int meson_ir_remove(struct platform_device *pdev) +static void meson_ir_remove(struct platform_device *pdev) { struct meson_ir *ir = platform_get_drvdata(pdev); unsigned long flags; @@ -186,8 +186,6 @@ static int meson_ir_remove(struct platform_device *pdev) spin_lock_irqsave(&ir->lock, flags); meson_ir_set_mask(ir, IR_DEC_REG1, REG1_ENABLE, 0); spin_unlock_irqrestore(&ir->lock, flags); - - return 0; } static void meson_ir_shutdown(struct platform_device *pdev) @@ -226,7 +224,7 @@ MODULE_DEVICE_TABLE(of, meson_ir_match); static struct platform_driver meson_ir_driver = { .probe = meson_ir_probe, - .remove = meson_ir_remove, + .remove_new = meson_ir_remove, .shutdown = meson_ir_shutdown, .driver = { .name = DRIVER_NAME, From patchwork Sun Mar 26 14:32:15 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= X-Patchwork-Id: 13188260 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 3871BC761AF for ; Sun, 26 Mar 2023 14:34:39 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232604AbjCZOei (ORCPT ); Sun, 26 Mar 2023 10:34:38 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60630 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232562AbjCZOdK (ORCPT ); Sun, 26 Mar 2023 10:33:10 -0400 Received: from metis.ext.pengutronix.de (metis.ext.pengutronix.de [IPv6:2001:67c:670:201:290:27ff:fe1d:cc33]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6E9AB7AB9 for ; Sun, 26 Mar 2023 07:33:00 -0700 (PDT) Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.ext.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pgRQR-0000Tv-Tk; Sun, 26 Mar 2023 16:32:51 +0200 Received: from [2a0a:edc0:0:900:1d::77] (helo=ptz.office.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtp (Exim 4.94.2) (envelope-from ) id 1pgRQQ-006rhK-1n; Sun, 26 Mar 2023 16:32:50 +0200 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1pgRQP-0088am-0k; Sun, 26 Mar 2023 16:32:49 +0200 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Sean Wang , Sean Young , Mauro Carvalho Chehab , Matthias Brugger Cc: AngeloGioacchino Del Regno , linux-media@vger.kernel.org, kernel@pengutronix.de, linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org Subject: [PATCH 108/117] media: mtk-cir: Convert to platform remove callback returning void Date: Sun, 26 Mar 2023 16:32:15 +0200 Message-Id: <20230326143224.572654-111-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230326143224.572654-1-u.kleine-koenig@pengutronix.de> References: <20230326143224.572654-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1596; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=lU1RdDgCVLlCsb/5z6KnJIo7xN0yoS8qGARlY6xon2g=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBkIFdC1rNVy7Bq53g9nT0u1IGm+3MdTtjUTG0+n Z+iKKpJ7juJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZCBXQgAKCRCPgPtYfRL+ TvzaB/4x1CsgN+jw2vmR6VOIzhF0VtklHVsaM1mCVhFAlsAOc87OR8/ajkgPnGDiBPX9qTQ7VDZ GIQ+53bVnoRnoJLQrt1kOAfU1f3MYcUSCiEiPfsVmSFEdlwHR7D9IbNtbKWgHWUeEBv+tJUJR3e LkNcpwoy61kC17sOZVYetG5wM1PJTcZfKtsrkKj2lKjePHhJ6AKCuWxgtN8/oEwtKyyCbjIjgsb krZp86LJdODjWBHVPe+rZAkKU1JsatDjjWKUAnivIwb526wSAgtbSvV46LAiHco4CSYvwCfuvXK N6+cOXITCHF8gcXkaJOC78YeS7EPMdGddKy8f96zDQOo9ukl X-Developer-Key: i=u.kleine-koenig@pengutronix.de; a=openpgp; fpr=0D2511F322BFAB1C1580266BE2DCDD9132669BD6 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.ext.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-media@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@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 (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 --- drivers/media/rc/mtk-cir.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/media/rc/mtk-cir.c b/drivers/media/rc/mtk-cir.c index 27b7412d02a5..df9349330a93 100644 --- a/drivers/media/rc/mtk-cir.c +++ b/drivers/media/rc/mtk-cir.c @@ -420,7 +420,7 @@ static int mtk_ir_probe(struct platform_device *pdev) return ret; } -static int mtk_ir_remove(struct platform_device *pdev) +static void mtk_ir_remove(struct platform_device *pdev) { struct mtk_ir *ir = platform_get_drvdata(pdev); @@ -434,13 +434,11 @@ static int mtk_ir_remove(struct platform_device *pdev) clk_disable_unprepare(ir->bus); clk_disable_unprepare(ir->clk); - - return 0; } static struct platform_driver mtk_ir_driver = { .probe = mtk_ir_probe, - .remove = mtk_ir_remove, + .remove_new = mtk_ir_remove, .driver = { .name = MTK_IR_DEV, .of_match_table = mtk_ir_match, From patchwork Sun Mar 26 14:32:16 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= X-Patchwork-Id: 13188265 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 90A00C761AF for ; Sun, 26 Mar 2023 14:34:43 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232556AbjCZOem (ORCPT ); Sun, 26 Mar 2023 10:34:42 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60602 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232142AbjCZOdM (ORCPT ); Sun, 26 Mar 2023 10:33:12 -0400 Received: from metis.ext.pengutronix.de (metis.ext.pengutronix.de [IPv6:2001:67c:670:201:290:27ff:fe1d:cc33]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CD0E26594 for ; Sun, 26 Mar 2023 07:33:01 -0700 (PDT) Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.ext.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pgRQS-0000Uf-44; Sun, 26 Mar 2023 16:32:52 +0200 Received: from [2a0a:edc0:0:900:1d::77] (helo=ptz.office.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtp (Exim 4.94.2) (envelope-from ) id 1pgRQQ-006rhR-7B; Sun, 26 Mar 2023 16:32:50 +0200 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1pgRQP-0088aq-7x; Sun, 26 Mar 2023 16:32:49 +0200 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Patrice Chotard , Sean Young , Mauro Carvalho Chehab Cc: linux-arm-kernel@lists.infradead.org, linux-media@vger.kernel.org, kernel@pengutronix.de Subject: [PATCH 109/117] media: st_rc: Convert to platform remove callback returning void Date: Sun, 26 Mar 2023 16:32:16 +0200 Message-Id: <20230326143224.572654-112-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230326143224.572654-1-u.kleine-koenig@pengutronix.de> References: <20230326143224.572654-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1688; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=dilEHo9govXasHtT6jWDl0EFBpcoZnlFPvF1NoaXW08=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBkIFdDqXno4N3eqHrFThAzYL2IsNFr1wOEudN0m 0xs9SPDsUWJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZCBXQwAKCRCPgPtYfRL+ TpNeB/0UFMgu71GFrUTtlRgTTOuMjbuLF+RRHNKO76bdSr9qPImRQ0CcLhjSrAmUBGkhRwhPWHC bpQ7RjazFWwPrbO0lUuFyX/bX9Jvl+Yo7vhGfadRsn21uN5gb/+au+OAFIdsqHx9RwxntqT65+j MN50OvFz9FcnG7HRvgNqEu7HRgw9MdUq8vazOzLszUsdzrVlveka3agPPuJ1sgbIigHYHu3QkIi n5g5LwzaRz4tSVfAik4FLjOXH1DWwqhCvPKOocrdIe57d1bUeD3liOLIRJziEEHcq6kdI4F4OUx SeNve2/BRB9NDkNYY8OsuIeXE+hF2EsYSoim6ifcy7RqctDa X-Developer-Key: i=u.kleine-koenig@pengutronix.de; a=openpgp; fpr=0D2511F322BFAB1C1580266BE2DCDD9132669BD6 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.ext.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-media@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@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 (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 --- drivers/media/rc/st_rc.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/drivers/media/rc/st_rc.c b/drivers/media/rc/st_rc.c index 19e987a048cc..28477aa95563 100644 --- a/drivers/media/rc/st_rc.c +++ b/drivers/media/rc/st_rc.c @@ -194,7 +194,7 @@ static int st_rc_hardware_init(struct st_rc_device *dev) return 0; } -static int st_rc_remove(struct platform_device *pdev) +static void st_rc_remove(struct platform_device *pdev) { struct st_rc_device *rc_dev = platform_get_drvdata(pdev); @@ -202,7 +202,6 @@ static int st_rc_remove(struct platform_device *pdev) device_init_wakeup(&pdev->dev, false); clk_disable_unprepare(rc_dev->sys_clock); rc_unregister_device(rc_dev->rdev); - return 0; } static int st_rc_open(struct rc_dev *rdev) @@ -408,7 +407,7 @@ static struct platform_driver st_rc_driver = { .pm = &st_rc_pm_ops, }, .probe = st_rc_probe, - .remove = st_rc_remove, + .remove_new = st_rc_remove, }; module_platform_driver(st_rc_driver); From patchwork Sun Mar 26 14:32:17 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= X-Patchwork-Id: 13188263 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 1ADB9C77B62 for ; Sun, 26 Mar 2023 14:34:41 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232608AbjCZOek (ORCPT ); Sun, 26 Mar 2023 10:34:40 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:32812 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232550AbjCZOdL (ORCPT ); Sun, 26 Mar 2023 10:33:11 -0400 Received: from metis.ext.pengutronix.de (metis.ext.pengutronix.de [IPv6:2001:67c:670:201:290:27ff:fe1d:cc33]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6E92D7AB6 for ; Sun, 26 Mar 2023 07:33:00 -0700 (PDT) Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.ext.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pgRQS-0000Ui-2y; Sun, 26 Mar 2023 16:32:52 +0200 Received: from [2a0a:edc0:0:900:1d::77] (helo=ptz.office.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtp (Exim 4.94.2) (envelope-from ) id 1pgRQQ-006rhT-8e; Sun, 26 Mar 2023 16:32:50 +0200 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1pgRQP-0088au-Ez; Sun, 26 Mar 2023 16:32:49 +0200 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Sean Young , Mauro Carvalho Chehab , Chen-Yu Tsai , Jernej Skrabec , Samuel Holland Cc: linux-media@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-sunxi@lists.linux.dev, kernel@pengutronix.de Subject: [PATCH 110/117] media: sunxi-cir: Convert to platform remove callback returning void Date: Sun, 26 Mar 2023 16:32:17 +0200 Message-Id: <20230326143224.572654-113-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230326143224.572654-1-u.kleine-koenig@pengutronix.de> References: <20230326143224.572654-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1672; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=7hyD2BqMB/NdPUXZusMT/OdZctbrC0UG18HQRt8dIBM=; b=owGbwMvMwMXY3/A7olbonx/jabUkhhSFcK/2ZXb/E63WR2zw13Cb9OL8wq6rpzdVft4Q7aVU9 /JC1oQdnYzGLAyMXAyyYoos9o1rMq2q5CI71/67DDOIlQlkCgMXpwBMJFWK/Z9VTplo3hWN2Iv/ /VK2PktNdCpJ7Vir5R+6usfm85PqxarnpOdFTtwolJYsJ5UlkXvaxCJO7OE7wfxG1vKd6+qTTpp M2deR/Fc6lP3G/Psry7LTssJVRWr5l22J9uX13VPLeEq6exXH/0qpfSG5darC4iZM3p9b02I69j 2o/jVBwlUpTf3lyjhe18uH1u1eHCLP2LiTOz3/+TyB1H0f7b+vmCqsWXR+q6D9wYInE0OXlaazP 791pH3Roxghl7upG9T2vGiYdM5h1nFnr/9SmzZXb9raJ7vX/+iJaZY6UUYJp4KTxWq4RX9cnLRP Wk76ZJJ7089MzoV7m1blbPvR/PiAfKh6Tur1O8GHA53rAA== X-Developer-Key: i=u.kleine-koenig@pengutronix.de; a=openpgp; fpr=0D2511F322BFAB1C1580266BE2DCDD9132669BD6 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.ext.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-media@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@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 (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 Acked-by: Jernej Skrabec --- drivers/media/rc/sunxi-cir.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/media/rc/sunxi-cir.c b/drivers/media/rc/sunxi-cir.c index b631a81e58bb..75b7aed1579c 100644 --- a/drivers/media/rc/sunxi-cir.c +++ b/drivers/media/rc/sunxi-cir.c @@ -364,14 +364,12 @@ static int sunxi_ir_probe(struct platform_device *pdev) return ret; } -static int sunxi_ir_remove(struct platform_device *pdev) +static void sunxi_ir_remove(struct platform_device *pdev) { struct sunxi_ir *ir = platform_get_drvdata(pdev); rc_unregister_device(ir->rc); sunxi_ir_hw_exit(&pdev->dev); - - return 0; } static void sunxi_ir_shutdown(struct platform_device *pdev) @@ -413,7 +411,7 @@ MODULE_DEVICE_TABLE(of, sunxi_ir_match); static struct platform_driver sunxi_ir_driver = { .probe = sunxi_ir_probe, - .remove = sunxi_ir_remove, + .remove_new = sunxi_ir_remove, .shutdown = sunxi_ir_shutdown, .driver = { .name = SUNXI_IR_DEV, From patchwork Sun Mar 26 14:32:18 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= X-Patchwork-Id: 13188240 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 5F323C6FD1C for ; Sun, 26 Mar 2023 14:34:18 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232542AbjCZOeR (ORCPT ); Sun, 26 Mar 2023 10:34:17 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:32768 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232384AbjCZOdA (ORCPT ); Sun, 26 Mar 2023 10:33:00 -0400 Received: from metis.ext.pengutronix.de (metis.ext.pengutronix.de [IPv6:2001:67c:670:201:290:27ff:fe1d:cc33]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2533C1FFA for ; Sun, 26 Mar 2023 07:32:55 -0700 (PDT) Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.ext.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pgRQS-0000Up-39; Sun, 26 Mar 2023 16:32:52 +0200 Received: from [2a0a:edc0:0:900:1d::77] (helo=ptz.office.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtp (Exim 4.94.2) (envelope-from ) id 1pgRQQ-006rhX-9t; Sun, 26 Mar 2023 16:32:50 +0200 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1pgRQP-0088ay-LI; Sun, 26 Mar 2023 16:32:49 +0200 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Hans Verkuil , Mauro Carvalho Chehab Cc: linux-media@vger.kernel.org, kernel@pengutronix.de Subject: [PATCH 111/117] media: vicodec-core: Convert to platform remove callback returning void Date: Sun, 26 Mar 2023 16:32:18 +0200 Message-Id: <20230326143224.572654-114-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230326143224.572654-1-u.kleine-koenig@pengutronix.de> References: <20230326143224.572654-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1749; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=j1Q2miNrJ6gXWbqYIrvvkQQNM18mtJRkrTiAC8i+MOY=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBkIFdLHlQJto3xLikC2rC2IW99fAmqzzxNTbFzX Nlpjr6n1XOJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZCBXSwAKCRCPgPtYfRL+ TkVJB/931L4glvHdrTJY8PmhTNrtjNgVTFYW6pxTXtGXglLTqf+DSOnpGLCIGdwd60sMASaSq7w ykz2tP7O1NpGgns/s2zx5KrIs/gLo/iiyjDILy1NM03E7cnmNUCjbI1feEMFI0q1Lix2CsYCxbU HTfRyupCuvquyuvs97KALrrRv+JuACRTIiWNhrAXi71hpY4evDauFEYyTGumIV6iuNkPGEN+II8 LvN8GZ/1/EcKmlcWIoFrVEu2uuUE91IILoaciaUMWq/mHA8g4lmYnTmmdqjfK0zkpXjPF9CVz0r WJbhAFePsGVptw13vg/Wp2nAE7NAcn/A7pxyzLuYfH0xO67y X-Developer-Key: i=u.kleine-koenig@pengutronix.de; a=openpgp; fpr=0D2511F322BFAB1C1580266BE2DCDD9132669BD6 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.ext.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-media@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@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 (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 --- drivers/media/test-drivers/vicodec/vicodec-core.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/media/test-drivers/vicodec/vicodec-core.c b/drivers/media/test-drivers/vicodec/vicodec-core.c index 1d1bee111732..6f0e20df74e9 100644 --- a/drivers/media/test-drivers/vicodec/vicodec-core.c +++ b/drivers/media/test-drivers/vicodec/vicodec-core.c @@ -2179,7 +2179,7 @@ static int vicodec_probe(struct platform_device *pdev) return ret; } -static int vicodec_remove(struct platform_device *pdev) +static void vicodec_remove(struct platform_device *pdev) { struct vicodec_dev *dev = platform_get_drvdata(pdev); @@ -2196,13 +2196,11 @@ static int vicodec_remove(struct platform_device *pdev) video_unregister_device(&dev->stateful_dec.vfd); video_unregister_device(&dev->stateless_dec.vfd); v4l2_device_put(&dev->v4l2_dev); - - return 0; } static struct platform_driver vicodec_pdrv = { .probe = vicodec_probe, - .remove = vicodec_remove, + .remove_new = vicodec_remove, .driver = { .name = VICODEC_NAME, }, From patchwork Sun Mar 26 14:32:19 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= X-Patchwork-Id: 13188239 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 7D94DC77B61 for ; Sun, 26 Mar 2023 14:34:17 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232521AbjCZOeQ (ORCPT ); Sun, 26 Mar 2023 10:34:16 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33464 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232527AbjCZOdA (ORCPT ); Sun, 26 Mar 2023 10:33:00 -0400 Received: from metis.ext.pengutronix.de (metis.ext.pengutronix.de [IPv6:2001:67c:670:201:290:27ff:fe1d:cc33]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 892943C0A for ; Sun, 26 Mar 2023 07:32:56 -0700 (PDT) Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.ext.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pgRQS-0000Wx-N5; Sun, 26 Mar 2023 16:32:52 +0200 Received: from [2a0a:edc0:0:900:1d::77] (helo=ptz.office.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtp (Exim 4.94.2) (envelope-from ) id 1pgRQQ-006rhg-QX; Sun, 26 Mar 2023 16:32:50 +0200 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1pgRQP-0088b1-Tg; Sun, 26 Mar 2023 16:32:49 +0200 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: "Daniel W. S. Almeida" , Mauro Carvalho Chehab Cc: linux-media@vger.kernel.org, kernel@pengutronix.de Subject: [PATCH 112/117] media: vidtv_bridge: Convert to platform remove callback returning void Date: Sun, 26 Mar 2023 16:32:19 +0200 Message-Id: <20230326143224.572654-115-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230326143224.572654-1-u.kleine-koenig@pengutronix.de> References: <20230326143224.572654-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1863; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=hy44/ZfCUQags6wJta3/fPH5qWXuZtGZpZeBQrnbG3c=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBkIFdMTP+tUS1Ld11GRu0Y56C51BD3IgN/yQvPw /vqj0jqWDuJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZCBXTAAKCRCPgPtYfRL+ TvBtB/9ruTCb8by65GGIX31jFvoR8s2l+gCQJ55rDD1RrORWEnwprbLuGjbKovWx8xNnXiLhd5b EfHsUNh+Yzkkn1ZyWZYtTT+qpkcvvhsqF0IQU8rdDWfiR57g/kxneZf+2IkoeNjnel5+Gf9W6ou pC8CsRogNhVi6e7JXJVa+4eGrhIH0g44Dt5jYSWOqUOTJej+hirgPVlRvo3LgQ/8tMsup0FWU8e Ye/9kN9RduZcna5pVaTmEcrFQy23fgttln17eYOrdkyMsXNMSk2KnHy0szPq9jCA3r/6B8PzkJM bORnQ+lg/FyGIUEaI2O3anfKaNo1k28+0h6YZ1Qi/t0CRoXS X-Developer-Key: i=u.kleine-koenig@pengutronix.de; a=openpgp; fpr=0D2511F322BFAB1C1580266BE2DCDD9132669BD6 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.ext.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-media@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@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 (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 --- drivers/media/test-drivers/vidtv/vidtv_bridge.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/media/test-drivers/vidtv/vidtv_bridge.c b/drivers/media/test-drivers/vidtv/vidtv_bridge.c index dff7265a42ca..8b04e12af286 100644 --- a/drivers/media/test-drivers/vidtv/vidtv_bridge.c +++ b/drivers/media/test-drivers/vidtv/vidtv_bridge.c @@ -528,7 +528,7 @@ static int vidtv_bridge_probe(struct platform_device *pdev) return ret; } -static int vidtv_bridge_remove(struct platform_device *pdev) +static void vidtv_bridge_remove(struct platform_device *pdev) { struct vidtv_dvb *dvb; u32 i; @@ -552,8 +552,6 @@ static int vidtv_bridge_remove(struct platform_device *pdev) dvb_dmx_release(&dvb->demux); dvb_unregister_adapter(&dvb->adapter); dev_info(&pdev->dev, "Successfully removed vidtv\n"); - - return 0; } static void vidtv_bridge_dev_release(struct device *dev) @@ -574,7 +572,7 @@ static struct platform_driver vidtv_bridge_driver = { .name = VIDTV_PDEV_NAME, }, .probe = vidtv_bridge_probe, - .remove = vidtv_bridge_remove, + .remove_new = vidtv_bridge_remove, }; static void __exit vidtv_bridge_exit(void) From patchwork Sun Mar 26 14:32:20 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= X-Patchwork-Id: 13188244 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id C22FDC77B62 for ; Sun, 26 Mar 2023 14:34:22 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232600AbjCZOeV (ORCPT ); Sun, 26 Mar 2023 10:34:21 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60630 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232532AbjCZOdB (ORCPT ); Sun, 26 Mar 2023 10:33:01 -0400 Received: from metis.ext.pengutronix.de (metis.ext.pengutronix.de [IPv6:2001:67c:670:201:290:27ff:fe1d:cc33]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7D4FA3591 for ; Sun, 26 Mar 2023 07:32:56 -0700 (PDT) Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.ext.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pgRQT-0000YH-0B; Sun, 26 Mar 2023 16:32:53 +0200 Received: from [2a0a:edc0:0:900:1d::77] (helo=ptz.office.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtp (Exim 4.94.2) (envelope-from ) id 1pgRQR-006rhm-46; Sun, 26 Mar 2023 16:32:51 +0200 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1pgRQQ-0088b4-4e; Sun, 26 Mar 2023 16:32:50 +0200 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Mauro Carvalho Chehab , Hans Verkuil , =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= Cc: linux-media@vger.kernel.org, kernel@pengutronix.de Subject: [PATCH 113/117] media: vim2m: Convert to platform remove callback returning void Date: Sun, 26 Mar 2023 16:32:20 +0200 Message-Id: <20230326143224.572654-116-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230326143224.572654-1-u.kleine-koenig@pengutronix.de> References: <20230326143224.572654-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1618; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=7o52xkodu6t64Pqyc/kc6V6sDslcxfg6NqdzZK5ejc0=; b=owGbwMvMwMXY3/A7olbonx/jabUkhhSF8KCXBYoKcR4F2ZrZzLZ7r7pNymW/9vD/wTz1e/PsW esOch/rZDRmYWDkYpAVU2Sxb1yTaVUlF9m59t9lmEGsTCBTGLg4BWAiwWHs/6NMGhiXMXxqzFA+ OPP4h0cfJSwyYn/ZByub5JdMFJn0r1G5fIofx20HtgeZlfvezoi32iP16CPfiVeMi4TXO725b1U qbebGUBb/0mrOxklhOQ3s5bxarxZGFbBY9Dtxtzu9K18n3PlqeZfIgfSC9Vfil25ia7J5W7iwgN lENrgmxyJ30izZzJSmqxzxPh4mQhWHtrnc1TKZa+6Szm/IePopQ17s5VdKxv6XtJoV7WweFf7Y+ WKXTfPCHRPfSshNXGG/S3CDo95txjcmbfe37zmocfPLlQeaH75NzVkzwVf537VDDaKyqtHbNNof qnNci1+mJKyQGf3sWkmhdMa3jV+vaS2xFNTIXlnsetwZAA== X-Developer-Key: i=u.kleine-koenig@pengutronix.de; a=openpgp; fpr=0D2511F322BFAB1C1580266BE2DCDD9132669BD6 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.ext.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-media@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@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 (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 --- drivers/media/test-drivers/vim2m.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/media/test-drivers/vim2m.c b/drivers/media/test-drivers/vim2m.c index 7964426bf2f7..3e3b424b4860 100644 --- a/drivers/media/test-drivers/vim2m.c +++ b/drivers/media/test-drivers/vim2m.c @@ -1379,7 +1379,7 @@ static int vim2m_probe(struct platform_device *pdev) return ret; } -static int vim2m_remove(struct platform_device *pdev) +static void vim2m_remove(struct platform_device *pdev) { struct vim2m_dev *dev = platform_get_drvdata(pdev); @@ -1390,13 +1390,11 @@ static int vim2m_remove(struct platform_device *pdev) v4l2_m2m_unregister_media_controller(dev->m2m_dev); #endif video_unregister_device(&dev->vfd); - - return 0; } static struct platform_driver vim2m_pdrv = { .probe = vim2m_probe, - .remove = vim2m_remove, + .remove_new = vim2m_remove, .driver = { .name = MEM2MEM_NAME, }, From patchwork Sun Mar 26 14:32:21 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= X-Patchwork-Id: 13188248 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 7F0D2C6FD1C for ; Sun, 26 Mar 2023 14:34:26 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232500AbjCZOeZ (ORCPT ); Sun, 26 Mar 2023 10:34:25 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60670 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232394AbjCZOdC (ORCPT ); Sun, 26 Mar 2023 10:33:02 -0400 Received: from metis.ext.pengutronix.de (metis.ext.pengutronix.de [IPv6:2001:67c:670:201:290:27ff:fe1d:cc33]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id EB76B5FD7 for ; Sun, 26 Mar 2023 07:32:57 -0700 (PDT) Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.ext.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pgRQT-0000Z5-7L; Sun, 26 Mar 2023 16:32:53 +0200 Received: from [2a0a:edc0:0:900:1d::77] (helo=ptz.office.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtp (Exim 4.94.2) (envelope-from ) id 1pgRQR-006rhq-9z; Sun, 26 Mar 2023 16:32:51 +0200 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1pgRQQ-0088bA-BZ; Sun, 26 Mar 2023 16:32:50 +0200 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Shuah Khan , Mauro Carvalho Chehab Cc: Kieran Bingham , linux-media@vger.kernel.org, kernel@pengutronix.de Subject: [PATCH 114/117] media: vimc-core: Convert to platform remove callback returning void Date: Sun, 26 Mar 2023 16:32:21 +0200 Message-Id: <20230326143224.572654-117-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230326143224.572654-1-u.kleine-koenig@pengutronix.de> References: <20230326143224.572654-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1790; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=noigLH5FPu00eRydnUiSIs9qodhVusSLw+vfqx9NHoE=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBkIFdT+0A2BTjP/WFcRjPwax+WfrS+Zy3mOWy2v vtcDR7VmVaJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZCBXUwAKCRCPgPtYfRL+ TmqNB/0cG4AI97rl+lefkFeSUJczvI9xQcV1NLWsNxl3hVOIH4hfpYptIQZLvdeF/FVmVakC8g9 Zl2zwnmG6v9VNQLW1DKlApOTmBawvhd4Z9tGto5BVqCkL+j15feMuFnLWflkV7ISrZj6IrY8STf np8x4DFSGBL5XwX6x+VN1OW28ypypfHJWSP0bVLgpHqDGj4LeI1J9q4KcS/qOn0wVQL/H1uPl69 s1kLBY4z++EYBERCMTj7D2wmZTXW/z/JSYuem0CWyE5TLB/WKZLWjwG5vu3ahZdITXOdRka5Ct6 RwT2rkvfQ9m9n4aQTjO1u7MLsHpQfcCKk2s6QThnBWQJrD9v X-Developer-Key: i=u.kleine-koenig@pengutronix.de; a=openpgp; fpr=0D2511F322BFAB1C1580266BE2DCDD9132669BD6 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.ext.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-media@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@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 (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 Reviewed-by: Kieran Bingham Reviewed-by: Shuah Khan --- drivers/media/test-drivers/vimc/vimc-core.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/media/test-drivers/vimc/vimc-core.c b/drivers/media/test-drivers/vimc/vimc-core.c index e82cfa5ffbf4..af127476e920 100644 --- a/drivers/media/test-drivers/vimc/vimc-core.c +++ b/drivers/media/test-drivers/vimc/vimc-core.c @@ -387,7 +387,7 @@ static int vimc_probe(struct platform_device *pdev) return 0; } -static int vimc_remove(struct platform_device *pdev) +static void vimc_remove(struct platform_device *pdev) { struct vimc_device *vimc = platform_get_drvdata(pdev); @@ -397,8 +397,6 @@ static int vimc_remove(struct platform_device *pdev) media_device_unregister(&vimc->mdev); v4l2_device_unregister(&vimc->v4l2_dev); v4l2_device_put(&vimc->v4l2_dev); - - return 0; } static void vimc_dev_release(struct device *dev) @@ -412,7 +410,7 @@ static struct platform_device vimc_pdev = { static struct platform_driver vimc_pdrv = { .probe = vimc_probe, - .remove = vimc_remove, + .remove_new = vimc_remove, .driver = { .name = VIMC_PDEV_NAME, }, From patchwork Sun Mar 26 14:32:22 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= X-Patchwork-Id: 13188252 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 09B2DC77B61 for ; Sun, 26 Mar 2023 14:34:30 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232555AbjCZOe3 (ORCPT ); Sun, 26 Mar 2023 10:34:29 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60384 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232518AbjCZOdD (ORCPT ); Sun, 26 Mar 2023 10:33:03 -0400 Received: from metis.ext.pengutronix.de (metis.ext.pengutronix.de [IPv6:2001:67c:670:201:290:27ff:fe1d:cc33]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E3C2726BC for ; Sun, 26 Mar 2023 07:32:56 -0700 (PDT) Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.ext.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pgRQT-0000ZW-DI; Sun, 26 Mar 2023 16:32:53 +0200 Received: from [2a0a:edc0:0:900:1d::77] (helo=ptz.office.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtp (Exim 4.94.2) (envelope-from ) id 1pgRQR-006rhv-Ev; Sun, 26 Mar 2023 16:32:51 +0200 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1pgRQQ-0088bF-I0; Sun, 26 Mar 2023 16:32:50 +0200 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Daniel Almeida , Mauro Carvalho Chehab Cc: linux-media@vger.kernel.org, kernel@pengutronix.de Subject: [PATCH 115/117] media: visl-core: Convert to platform remove callback returning void Date: Sun, 26 Mar 2023 16:32:22 +0200 Message-Id: <20230326143224.572654-118-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230326143224.572654-1-u.kleine-koenig@pengutronix.de> References: <20230326143224.572654-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1597; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=xBgPjDoBOcooElSDzrMumYjMfNIa+WX+wsDCUOqM0/Y=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBkIFdUM8liaPKb9n7HqWKF/DqCDGjYhm59eFAVh PxUETmIs9GJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZCBXVAAKCRCPgPtYfRL+ ThByCACYmhC0qLmdE9neBqCuYkczrRhIGj5Uf7Y0pWC6Zy4r56HnCbdP2Q3eL5781vTVZsAr1Ze NOugTULIz8DLq2YAhSf7dLgOnUp6BBFkech98sGpHN9AzUZOyPXuv8jNNZjs8aCc4PTXRD0wn34 wQJdV4q+/BWZCFNnFpUu6CdNiJkd374InOQpSZyGAv9XBWNj5i1iWtEae4XJVWE4Gs00ztX4LHC vk01FUZoNLMAJdBX31kpUbwJOVzipK+O7RyDz3EDubWWnVw+EQStXlU+/mrsDqwIxjLYjtbqKzi CBPLuJGwnnVEj/qzT72OkzAbqDuHfzxVJwr7u/25N2pTNG0I X-Developer-Key: i=u.kleine-koenig@pengutronix.de; a=openpgp; fpr=0D2511F322BFAB1C1580266BE2DCDD9132669BD6 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.ext.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-media@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@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 (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 --- drivers/media/test-drivers/visl/visl-core.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/media/test-drivers/visl/visl-core.c b/drivers/media/test-drivers/visl/visl-core.c index 9cb60ab653bf..9970dc739ca5 100644 --- a/drivers/media/test-drivers/visl/visl-core.c +++ b/drivers/media/test-drivers/visl/visl-core.c @@ -480,7 +480,7 @@ static int visl_probe(struct platform_device *pdev) return ret; } -static int visl_remove(struct platform_device *pdev) +static void visl_remove(struct platform_device *pdev) { struct visl_dev *dev = platform_get_drvdata(pdev); @@ -493,13 +493,11 @@ static int visl_remove(struct platform_device *pdev) } #endif video_unregister_device(&dev->vfd); - - return 0; } static struct platform_driver visl_pdrv = { .probe = visl_probe, - .remove = visl_remove, + .remove_new = visl_remove, .driver = { .name = VISL_NAME, }, From patchwork Sun Mar 26 14:32:23 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= X-Patchwork-Id: 13188250 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 37C98C761AF for ; Sun, 26 Mar 2023 14:34:28 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232394AbjCZOe1 (ORCPT ); Sun, 26 Mar 2023 10:34:27 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60336 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232541AbjCZOdD (ORCPT ); Sun, 26 Mar 2023 10:33:03 -0400 Received: from metis.ext.pengutronix.de (metis.ext.pengutronix.de [IPv6:2001:67c:670:201:290:27ff:fe1d:cc33]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D21D749D9 for ; Sun, 26 Mar 2023 07:32:56 -0700 (PDT) Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.ext.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pgRQT-0000af-No; Sun, 26 Mar 2023 16:32:53 +0200 Received: from [2a0a:edc0:0:900:1d::77] (helo=ptz.office.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtp (Exim 4.94.2) (envelope-from ) id 1pgRQR-006ri1-SW; Sun, 26 Mar 2023 16:32:51 +0200 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1pgRQQ-0088bI-Oa; Sun, 26 Mar 2023 16:32:50 +0200 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Hans Verkuil , Mauro Carvalho Chehab Cc: linux-media@vger.kernel.org, kernel@pengutronix.de Subject: [PATCH 116/117] media: vivid-core: Convert to platform remove callback returning void Date: Sun, 26 Mar 2023 16:32:23 +0200 Message-Id: <20230326143224.572654-119-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230326143224.572654-1-u.kleine-koenig@pengutronix.de> References: <20230326143224.572654-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1741; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=psP47iJQfgDho0z51O3/c3SCet6c2oqTgrRbhvyMpa8=; b=owGbwMvMwMXY3/A7olbonx/jabUkhhSF8Gjd+R2hv2YcY6ws6xKYG3zuScXDZVHPovKfVu88a ph9fnJzJ6MxCwMjF4OsmCKLfeOaTKsqucjOtf8uwwxiZQKZwsDFKQATeV/O/j+wXsVg8/afeT2+ gWsZOCymzb82JzEtSc59o53Y8cD7SSIae4zdisyOvs5YFM7Oc3lbVyef4eHD93ucq/Myw7nldd9 N35prrB+frCJzw2aP5zZurjmn9HfGhzFprilK9Zhzos123ay6hMwcPY/fuVN8fi45HfuU1ePemR oDBlX2db0VZY+4ru/4lRAy/eXHQ6GlLLWvoldaVHxgrfj8OLVdxCq7KKjA9MPD2Ef1OTrtm90ZV u2aP3U3Y6PtnMaaxSXvLi6dNG+By89UT9nXK4SO6k5pttJ7nPtbaOVh0e8lnoWStm0r765+/uNc RV/67Pu2WZKmR1l7rygoKJV5tMQ/mOshPrl02snoo9NTAQ== X-Developer-Key: i=u.kleine-koenig@pengutronix.de; a=openpgp; fpr=0D2511F322BFAB1C1580266BE2DCDD9132669BD6 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.ext.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-media@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@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 (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 --- drivers/media/test-drivers/vivid/vivid-core.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/drivers/media/test-drivers/vivid/vivid-core.c b/drivers/media/test-drivers/vivid/vivid-core.c index f28440e6c9f8..b4fbe32ed538 100644 --- a/drivers/media/test-drivers/vivid/vivid-core.c +++ b/drivers/media/test-drivers/vivid/vivid-core.c @@ -2058,7 +2058,7 @@ static int vivid_probe(struct platform_device *pdev) return ret; } -static int vivid_remove(struct platform_device *pdev) +static void vivid_remove(struct platform_device *pdev) { struct vivid_dev *dev; unsigned int i, j; @@ -2138,7 +2138,6 @@ static int vivid_remove(struct platform_device *pdev) v4l2_device_put(&dev->v4l2_dev); vivid_devs[i] = NULL; } - return 0; } static void vivid_pdev_release(struct device *dev) @@ -2152,7 +2151,7 @@ static struct platform_device vivid_pdev = { static struct platform_driver vivid_pdrv = { .probe = vivid_probe, - .remove = vivid_remove, + .remove_new = vivid_remove, .driver = { .name = "vivid", }, From patchwork Sun Mar 26 14:32:24 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= X-Patchwork-Id: 13188259 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 389ABC74A5B for ; Sun, 26 Mar 2023 14:34:38 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232601AbjCZOeh (ORCPT ); Sun, 26 Mar 2023 10:34:37 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60998 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232526AbjCZOdK (ORCPT ); Sun, 26 Mar 2023 10:33:10 -0400 Received: from metis.ext.pengutronix.de (metis.ext.pengutronix.de [IPv6:2001:67c:670:201:290:27ff:fe1d:cc33]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 79A0A65A4 for ; Sun, 26 Mar 2023 07:32:58 -0700 (PDT) Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.ext.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pgRQT-0000a4-Hi; Sun, 26 Mar 2023 16:32:53 +0200 Received: from [2a0a:edc0:0:900:1d::77] (helo=ptz.office.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtp (Exim 4.94.2) (envelope-from ) id 1pgRQR-006rhy-LG; Sun, 26 Mar 2023 16:32:51 +0200 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1pgRQQ-0088bM-Vk; Sun, 26 Mar 2023 16:32:50 +0200 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Antti Palosaari , Mauro Carvalho Chehab Cc: linux-media@vger.kernel.org, kernel@pengutronix.de Subject: [PATCH 117/117] media: it913x: Convert to platform remove callback returning void Date: Sun, 26 Mar 2023 16:32:24 +0200 Message-Id: <20230326143224.572654-120-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230326143224.572654-1-u.kleine-koenig@pengutronix.de> References: <20230326143224.572654-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1748; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=IWiP7BQxrMEqnTiyDeYG5YBvZSoqaHuYCH09+5LsHok=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBkIFdhXGR3ki75ycz9AMtkzRW/wAugepMmlAUPK tJ0GM84wsuJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZCBXYQAKCRCPgPtYfRL+ TmRPB/9op5i/IUADzoGpd6X0DUHo2iFmwj+l7eubuh2vpVuPnqXv1ApfTBGyQ9qPLEqsAZLlFEG XDQd9UG88wUNhgoegkBYpme+bhlDf2eduPpTn8maZSxTdOm0/Kvzdp0p97UKZm3exMvqFSbkdiE PUO41dbMYeN1drfIzqC7Ch0OgqeBXV0PfRawbaK/asERFoILB7uxuB8kw6LBHVAgTnp4057XJzR /w88sn8x+gZsMPta1oTmXob2TUVNuQgsHoCUSbrE0999uyq1Y1Gsy07Y7D4zDqgLfXtL9qooWYs Z0912kgPPERbZ1NRDpEfNCE5ZQh9lGdqwgjbKrzdjOFzYLIJ X-Developer-Key: i=u.kleine-koenig@pengutronix.de; a=openpgp; fpr=0D2511F322BFAB1C1580266BE2DCDD9132669BD6 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.ext.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-media@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@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 (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 --- drivers/media/tuners/it913x.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/media/tuners/it913x.c b/drivers/media/tuners/it913x.c index 7696a28fe407..4d5b1c878028 100644 --- a/drivers/media/tuners/it913x.c +++ b/drivers/media/tuners/it913x.c @@ -419,7 +419,7 @@ static int it913x_probe(struct platform_device *pdev) return ret; } -static int it913x_remove(struct platform_device *pdev) +static void it913x_remove(struct platform_device *pdev) { struct it913x_dev *dev = platform_get_drvdata(pdev); struct dvb_frontend *fe = dev->fe; @@ -429,8 +429,6 @@ static int it913x_remove(struct platform_device *pdev) memset(&fe->ops.tuner_ops, 0, sizeof(struct dvb_tuner_ops)); fe->tuner_priv = NULL; kfree(dev); - - return 0; } static const struct platform_device_id it913x_id_table[] = { @@ -446,7 +444,7 @@ static struct platform_driver it913x_driver = { .suppress_bind_attrs = true, }, .probe = it913x_probe, - .remove = it913x_remove, + .remove_new = it913x_remove, .id_table = it913x_id_table, };