From patchwork Sat Mar 18 23:53: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: 664851 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 A991EC76196 for ; Sat, 18 Mar 2023 23:54:51 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229550AbjCRXyu (ORCPT ); Sat, 18 Mar 2023 19:54:50 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46994 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229593AbjCRXyq (ORCPT ); Sat, 18 Mar 2023 19:54: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 20BB9E3B3 for ; Sat, 18 Mar 2023 16:54: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 1pdgNl-00041c-Rg; Sun, 19 Mar 2023 00:54:41 +0100 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 1pdgNk-0056ZI-LS; Sun, 19 Mar 2023 00:54:40 +0100 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1pdgNk-005zTe-3d; Sun, 19 Mar 2023 00:54:40 +0100 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Helge Deller , Yihao Han Cc: linux-fbdev@vger.kernel.org, dri-devel@lists.freedesktop.org, kernel@pengutronix.de Subject: [PATCH 01/51] video: fbdev: au1100fb: Drop if with an always false condition Date: Sun, 19 Mar 2023 00:53:38 +0100 Message-Id: <20230318235428.272091-2-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230318235428.272091-1-u.kleine-koenig@pengutronix.de> References: <20230318235428.272091-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=770; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=8kWUurH4mQ0OQU+6hHzGUiErN2Kfnbs34nApHHgcpDE=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBkFk6nHBGCOiE+/M3aKXnJAlEaRTWzKQCrKdPbn SMG1BEXdXKJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZBZOpwAKCRCPgPtYfRL+ TtcdB/sHZyq7+lOWcnSDCNYblMs68C5yGPa1zoJIvZF2l9woZ8JslTJvSBkE74YRQWewTGl7XZH Fsjt0/jru5qpeQUYGenecuBxA+Ww2nVhYiZZSqoy3mL/fl9wDKu8MAr3PJwnSNSGVuFxa5SYpDb wxjngFAM7FWyJUY4e3RBS7fpmeCqyKf1OYubiIYg6HtdNFogiv1RvNUnkn7Puml451veHvCxI5c k3v56FwLMZukdlAKvzZzhLCMX/070fNVkkkLD8QKsGvHaenk6DDFctR5AHn0tgO1ua+fm78pbzg WwdenuxF6BxxI8ma4P8zUsoBNPQGQEZMDyiRgM8ajv2W13Zq 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-fbdev@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-fbdev@vger.kernel.org The driver core never calls a remove callback with the platform_device pointer being NULL. So the check for this condition can just be dropped. Signed-off-by: Uwe Kleine-König --- drivers/video/fbdev/au1100fb.c | 3 --- 1 file changed, 3 deletions(-) diff --git a/drivers/video/fbdev/au1100fb.c b/drivers/video/fbdev/au1100fb.c index 519313b8bb00..cd27e3b81bb8 100644 --- a/drivers/video/fbdev/au1100fb.c +++ b/drivers/video/fbdev/au1100fb.c @@ -524,9 +524,6 @@ int au1100fb_drv_remove(struct platform_device *dev) { struct au1100fb_device *fbdev = NULL; - if (!dev) - return -ENODEV; - fbdev = platform_get_drvdata(dev); #if !defined(CONFIG_FRAMEBUFFER_CONSOLE) && defined(CONFIG_LOGO) From patchwork Sat Mar 18 23:53: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: 665399 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 362C2C7618A for ; Sat, 18 Mar 2023 23:54:48 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229621AbjCRXyq (ORCPT ); Sat, 18 Mar 2023 19:54:46 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46948 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229488AbjCRXyp (ORCPT ); Sat, 18 Mar 2023 19:54: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 5177119699 for ; Sat, 18 Mar 2023 16:54: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 1pdgNl-00041e-LA; Sun, 19 Mar 2023 00:54:41 +0100 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 1pdgNk-0056ZQ-Vp; Sun, 19 Mar 2023 00:54:40 +0100 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1pdgNk-005zTh-Bh; Sun, 19 Mar 2023 00:54:40 +0100 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Jaya Kumar , Helge Deller Cc: linux-fbdev@vger.kernel.org, dri-devel@lists.freedesktop.org, kernel@pengutronix.de Subject: [PATCH 02/51] video: fbdev: arcfb: Convert to platform remove callback returning void Date: Sun, 19 Mar 2023 00:53:39 +0100 Message-Id: <20230318235428.272091-3-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230318235428.272091-1-u.kleine-koenig@pengutronix.de> References: <20230318235428.272091-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1545; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=khEvERgJEkssw4rj4oBb73Nu59F45R+4z26OZ36GvRc=; b=owGbwMvMwMXY3/A7olbonx/jabUkhhQxvxW+6Ukf+DkN6n47/tF76COyivtyfdxElUt85cm/g /onmF7vZDRmYWDkYpAVU2Sxb1yTaVUlF9m59t9lmEGsTCBTGLg4BeAirez/YzZYWn9Tu3SqdU3s 6596XEb/Qo+FLcoXn6e3pPPUvEjXV79qLL99Kww/dL5L9GrrKoHChC6vE3/Et8W9vPP6d/zGxvO bqlNPqSqbeN4R+VmtK7alXb3Xs7zi7Km3/SqC8r5+B5e8c2Zgvxy93Wv6noPmn5IDK5XbfxosKS 6VKhfUW5lqse6nk4Ty2rcXvbxfsK76c2jqXs8J3rYLlsiW2Jw4qPtnOf/a/SEzI5rStN4xO1tNd XQKPcLgfGOB+UUXL9/1Skf7khQ17S2NhHen17HZhk4vUkwtWVWVpnyp3ZTl8y75xSwHbnVIMByK LboRvzIv5+WH2hvzAoIfNH8QFmR24NAzUj1S3NKf7wsA 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-fbdev@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-fbdev@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/video/fbdev/arcfb.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/drivers/video/fbdev/arcfb.c b/drivers/video/fbdev/arcfb.c index 45e64016db32..7db593b78334 100644 --- a/drivers/video/fbdev/arcfb.c +++ b/drivers/video/fbdev/arcfb.c @@ -587,7 +587,7 @@ static int arcfb_probe(struct platform_device *dev) return retval; } -static int arcfb_remove(struct platform_device *dev) +static void arcfb_remove(struct platform_device *dev) { struct fb_info *info = platform_get_drvdata(dev); @@ -598,12 +598,11 @@ static int arcfb_remove(struct platform_device *dev) vfree((void __force *)info->screen_base); framebuffer_release(info); } - return 0; } static struct platform_driver arcfb_driver = { .probe = arcfb_probe, - .remove = arcfb_remove, + .remove_new = arcfb_remove, .driver = { .name = "arcfb", }, From patchwork Sat Mar 18 23:53: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: 664853 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 95F9BC76196 for ; Sat, 18 Mar 2023 23:54:48 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229488AbjCRXyr (ORCPT ); Sat, 18 Mar 2023 19:54:47 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46964 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229553AbjCRXyp (ORCPT ); Sat, 18 Mar 2023 19:54: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 CE1E51ACE7 for ; Sat, 18 Mar 2023 16:54: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 1pdgNl-00041f-S0; Sun, 19 Mar 2023 00:54:41 +0100 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 1pdgNl-0056ZU-6P; Sun, 19 Mar 2023 00:54:41 +0100 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1pdgNk-005zTk-HK; Sun, 19 Mar 2023 00:54:40 +0100 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Helge Deller , Yihao Han Cc: linux-fbdev@vger.kernel.org, dri-devel@lists.freedesktop.org, kernel@pengutronix.de Subject: [PATCH 03/51] video: fbdev: au1100fb: Convert to platform remove callback returning void Date: Sun, 19 Mar 2023 00:53:40 +0100 Message-Id: <20230318235428.272091-4-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230318235428.272091-1-u.kleine-koenig@pengutronix.de> References: <20230318235428.272091-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1791; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=ZeRUp9iq5eSAosiqXZU37Mo+K1kfkuJKRH1GA53X+Kc=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBkFk6ptVxK7/W0lh9UQPshBtNRz4P4SiXQ15mdK tOjBYKIhKKJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZBZOqQAKCRCPgPtYfRL+ Tq95B/sES7Yc4ueVz4bgjKtbhssNqor7Pti7Qm2Yj0q/TFt0DJfQpBm2Lnob2ZouxLTjMUQ6bfy 68UWIKd+DgEG+fHHNzAY11qL/w4Am4LKcMb+tsPuYMZIVo1rG2SATkziuwvYuWXiUeSrdQZHJJ5 bBUn1tMBPVc8Eg+i2XtfXENKA7BkFkovY+8rEFKVGlyijWWArNxWEL/eHdpclz47PhSffaDcvOR 397eH9cbXQy1x6zy6PJ2Aev+EWNaK2Hyzimr2C8tfTo1J+0rI1RIdTkMknOqyJXCupjct1JBX7W 0DQhBNcj59Pf8+8vEtQx0TDwp3LlCD05F63RxUw9nQ7GF44Q 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-fbdev@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-fbdev@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/video/fbdev/au1100fb.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/drivers/video/fbdev/au1100fb.c b/drivers/video/fbdev/au1100fb.c index cd27e3b81bb8..cb317398e71a 100644 --- a/drivers/video/fbdev/au1100fb.c +++ b/drivers/video/fbdev/au1100fb.c @@ -520,7 +520,7 @@ static int au1100fb_drv_probe(struct platform_device *dev) return -ENODEV; } -int au1100fb_drv_remove(struct platform_device *dev) +void au1100fb_drv_remove(struct platform_device *dev) { struct au1100fb_device *fbdev = NULL; @@ -540,8 +540,6 @@ int au1100fb_drv_remove(struct platform_device *dev) clk_disable_unprepare(fbdev->lcdclk); clk_put(fbdev->lcdclk); } - - return 0; } #ifdef CONFIG_PM @@ -590,8 +588,8 @@ static struct platform_driver au1100fb_driver = { .name = "au1100-lcd", }, .probe = au1100fb_drv_probe, - .remove = au1100fb_drv_remove, - .suspend = au1100fb_drv_suspend, + .remove_new = au1100fb_drv_remove, + .suspend = au1100fb_drv_suspend, .resume = au1100fb_drv_resume, }; module_platform_driver(au1100fb_driver); From patchwork Sat Mar 18 23:53: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: 664852 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 305CBC74A5B for ; Sat, 18 Mar 2023 23:54:51 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229758AbjCRXyt (ORCPT ); Sat, 18 Mar 2023 19:54:49 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46992 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229591AbjCRXyq (ORCPT ); Sat, 18 Mar 2023 19:54: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 BB2971A948 for ; Sat, 18 Mar 2023 16:54: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 1pdgNm-00041m-4s; Sun, 19 Mar 2023 00:54:42 +0100 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 1pdgNl-0056ZY-HA; Sun, 19 Mar 2023 00:54:41 +0100 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1pdgNk-005zTn-NB; Sun, 19 Mar 2023 00:54:40 +0100 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Helge Deller Cc: linux-fbdev@vger.kernel.org, dri-devel@lists.freedesktop.org, kernel@pengutronix.de Subject: [PATCH 04/51] video: fbdev: au1200fb: Convert to platform remove callback returning void Date: Sun, 19 Mar 2023 00:53:41 +0100 Message-Id: <20230318235428.272091-5-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230318235428.272091-1-u.kleine-koenig@pengutronix.de> References: <20230318235428.272091-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1705; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=e5MP4crUiOnpQZryjWnqLzHU9fN2OUTdYlsbRw71LVs=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBkFk6rtWVoBR3Um7W3dNB+BCHbyBD19e68acz2T EScSdzw9B6JATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZBZOqwAKCRCPgPtYfRL+ TrN7B/94vTf6JsQmf1IRGGakQX/HoghTGUaCZIdQI57rzMf8VBDqxC1vjVbazyanr/BR7PnTAZ1 +oMJCNMVxBtZGOcdQHvPjf/rWtHchN6Y9t4oFEwrKQov84UsQ9+PR1VWVqI0rdNxykAFhSQgFIn KTgvXlF9mVTgfRlyFR0Tg7fOPECE9NavheEY3Doe2iR9UzIyv2/JYJJTBIkUBJ7IOG5HErSOzHr /MAkSszZ/6Rk8CrHE8hKu40V9qnk6BaDu/D+M7W0WlDCJnosVOSPRhkRzBTru2JvboeYiAqaNqe mTsb3MzEfXdWePLa4X44JQ2FW445Z1vcvfvkHLvUiD84mCAn 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-fbdev@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-fbdev@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/video/fbdev/au1200fb.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/video/fbdev/au1200fb.c b/drivers/video/fbdev/au1200fb.c index 81c315454428..b2c3150fb78f 100644 --- a/drivers/video/fbdev/au1200fb.c +++ b/drivers/video/fbdev/au1200fb.c @@ -1762,7 +1762,7 @@ static int au1200fb_drv_probe(struct platform_device *dev) return ret; } -static int au1200fb_drv_remove(struct platform_device *dev) +static void au1200fb_drv_remove(struct platform_device *dev) { struct au1200fb_platdata *pd = platform_get_drvdata(dev); struct fb_info *fbi; @@ -1785,8 +1785,6 @@ static int au1200fb_drv_remove(struct platform_device *dev) } free_irq(platform_get_irq(dev, 0), (void *)dev); - - return 0; } #ifdef CONFIG_PM @@ -1837,7 +1835,7 @@ static struct platform_driver au1200fb_driver = { .pm = AU1200FB_PMOPS, }, .probe = au1200fb_drv_probe, - .remove = au1200fb_drv_remove, + .remove_new = au1200fb_drv_remove, }; module_platform_driver(au1200fb_driver); From patchwork Sat Mar 18 23:53: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: 664849 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 0E9DEC7619A for ; Sat, 18 Mar 2023 23:54:55 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229640AbjCRXyy (ORCPT ); Sat, 18 Mar 2023 19:54:54 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46988 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229648AbjCRXyr (ORCPT ); Sat, 18 Mar 2023 19:54: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 CCE4B19699 for ; Sat, 18 Mar 2023 16:54: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 1pdgNm-00042A-QG; Sun, 19 Mar 2023 00:54:42 +0100 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 1pdgNl-0056Zk-Rl; Sun, 19 Mar 2023 00:54:41 +0100 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1pdgNk-005zTs-U9; Sun, 19 Mar 2023 00:54:40 +0100 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Helge Deller , Javier Martinez Canillas , Thomas Zimmermann Cc: linux-fbdev@vger.kernel.org, dri-devel@lists.freedesktop.org, kernel@pengutronix.de Subject: [PATCH 05/51] video: fbdev: broadsheetfb: Convert to platform remove callback returning void Date: Sun, 19 Mar 2023 00:53:42 +0100 Message-Id: <20230318235428.272091-6-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230318235428.272091-1-u.kleine-koenig@pengutronix.de> References: <20230318235428.272091-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1621; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=VgwZokMV1vu+3tlRHHL/flQpGrx/iRGlfVD7lGhT1RU=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBkFk6s49ZQXYq/Xq+8IfpiK7tIGUo+73fjRJPv8 W92nea4HxOJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZBZOrAAKCRCPgPtYfRL+ Tjw/B/0UYkquKvFjfHEJZxhFlDnXF2qQv4FRjCzd25MyLPbzU3/Y2ENtDFzOz059sRqJ3oQZc0h MpJIPaMiHNqRWzJPViL0chSlgYj2NZqIgZVd7sNlgteKomIkDk+pi3zn6C7+94CC2rCM9u5hNcJ QWkTHvWJWNFhz7rGHT2OCTP1Btw/PiidtFPcCg9nVUKhB5zKpmc7h6n6M2PYPt58Ixw0XysjzME IDTXAmDJT7arXBSSbgCCRTjxrThsRY7JPR5fq0mF/uSfIQs3wpPqFEGPdmO/j7FEupFigrp2KdB pESQqGoYVYYbxTOXl8BHIk61x/bmKyhpptyWMuq9HTqPiOG3 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-fbdev@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-fbdev@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/video/fbdev/broadsheetfb.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/drivers/video/fbdev/broadsheetfb.c b/drivers/video/fbdev/broadsheetfb.c index 55e62dd96f9b..b518cacbf7cd 100644 --- a/drivers/video/fbdev/broadsheetfb.c +++ b/drivers/video/fbdev/broadsheetfb.c @@ -1193,7 +1193,7 @@ static int broadsheetfb_probe(struct platform_device *dev) } -static int broadsheetfb_remove(struct platform_device *dev) +static void broadsheetfb_remove(struct platform_device *dev) { struct fb_info *info = platform_get_drvdata(dev); @@ -1209,12 +1209,11 @@ static int broadsheetfb_remove(struct platform_device *dev) module_put(par->board->owner); framebuffer_release(info); } - return 0; } static struct platform_driver broadsheetfb_driver = { .probe = broadsheetfb_probe, - .remove = broadsheetfb_remove, + .remove_new = broadsheetfb_remove, .driver = { .name = "broadsheetfb", }, From patchwork Sat Mar 18 23:53: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: 665398 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 875E7C7619A for ; Sat, 18 Mar 2023 23:54:49 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229697AbjCRXys (ORCPT ); Sat, 18 Mar 2023 19:54:48 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46988 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229562AbjCRXyq (ORCPT ); Sat, 18 Mar 2023 19:54: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 6FD391B2CF for ; Sat, 18 Mar 2023 16:54: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 1pdgNm-000425-Ex; Sun, 19 Mar 2023 00:54:42 +0100 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 1pdgNl-0056Ze-Oj; Sun, 19 Mar 2023 00:54:41 +0100 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1pdgNl-005zTw-3x; Sun, 19 Mar 2023 00:54:41 +0100 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Helge Deller , Wolfram Sang Cc: linux-fbdev@vger.kernel.org, dri-devel@lists.freedesktop.org, kernel@pengutronix.de Subject: [PATCH 06/51] video: fbdev: bw2: Convert to platform remove callback returning void Date: Sun, 19 Mar 2023 00:53:43 +0100 Message-Id: <20230318235428.272091-7-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230318235428.272091-1-u.kleine-koenig@pengutronix.de> References: <20230318235428.272091-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1682; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=K08anLalQJbiuPYeNp8sUZ/pWKSOh0o3hwGpzmqpom0=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBkFk6tGm/Y42xGuS6iVSl4mROLcu/J5whA1KV9n 8CKNpFmSGOJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZBZOrQAKCRCPgPtYfRL+ TiLuB/wMk4B8Qjqnz5D+Kxh3phhRyXKqPLa8rnnkDYciv63fUbcy6yL8Q7lerSWtze1Y91EPg/M 1TRyXdE3+Q4vlFC+vZyGFxH+2+mCv0aJgZE30RN4+Fw/DMgKqhn3FXlJFNJFfX03VL4TugdlhGX Is1XHkkYdP8VTOmZiPe5q+zjimLtxpktvTOJk2KEtD/xwQZqedzXM7KjAIy9mtoGI29gVf1Wv+h rBYfOteradUM8rkcbApakKCJqoX6THfqMBs7qL2BbCq+iLiqnbQBkt3R06x/GGNRFo5l0nyYQ+N WPdw+sxrN8ed8YVlJvbNpgvzdKRBOnmxSn3VR+FxvqEwSiI+ 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-fbdev@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-fbdev@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/video/fbdev/bw2.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/video/fbdev/bw2.c b/drivers/video/fbdev/bw2.c index 6403ae07970d..ddd45048a131 100644 --- a/drivers/video/fbdev/bw2.c +++ b/drivers/video/fbdev/bw2.c @@ -352,7 +352,7 @@ static int bw2_probe(struct platform_device *op) return err; } -static int bw2_remove(struct platform_device *op) +static void bw2_remove(struct platform_device *op) { struct fb_info *info = dev_get_drvdata(&op->dev); struct bw2_par *par = info->par; @@ -363,8 +363,6 @@ static int bw2_remove(struct platform_device *op) of_iounmap(&op->resource[0], info->screen_base, info->fix.smem_len); framebuffer_release(info); - - return 0; } static const struct of_device_id bw2_match[] = { @@ -381,7 +379,7 @@ static struct platform_driver bw2_driver = { .of_match_table = bw2_match, }, .probe = bw2_probe, - .remove = bw2_remove, + .remove_new = bw2_remove, }; static int __init bw2_init(void) From patchwork Sat Mar 18 23:53: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: 665397 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 3FD4BC761A6 for ; Sat, 18 Mar 2023 23:54:50 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229753AbjCRXyt (ORCPT ); Sat, 18 Mar 2023 19:54:49 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46990 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229579AbjCRXyq (ORCPT ); Sat, 18 Mar 2023 19:54: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 8BC7C1B2D1 for ; Sat, 18 Mar 2023 16:54: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 1pdgNm-00042X-Rs; Sun, 19 Mar 2023 00:54:42 +0100 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 1pdgNm-0056Zu-7Q; Sun, 19 Mar 2023 00:54:42 +0100 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1pdgNl-005zU0-9Y; Sun, 19 Mar 2023 00:54:41 +0100 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Helge Deller Cc: linux-fbdev@vger.kernel.org, dri-devel@lists.freedesktop.org, kernel@pengutronix.de Subject: [PATCH 07/51] video: fbdev: cg14: Convert to platform remove callback returning void Date: Sun, 19 Mar 2023 00:53:44 +0100 Message-Id: <20230318235428.272091-8-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230318235428.272091-1-u.kleine-koenig@pengutronix.de> References: <20230318235428.272091-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1662; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=X0Npv7RIU0uA2nb6KinZ087YzI071OmR2xLaSkvunQ8=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBkFk6upk/EfhFiZUCshtqXI1vfmJ+gAefNWjFGW QwRzCKoPpaJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZBZOrgAKCRCPgPtYfRL+ ThHDCAC2L8hfVXL+s7vGc1gG+mGRxwF9RkClxK2YQb+kcEuHim8TjWbIQ1F6doHpmvHYlbMGnNP DtUB7O+ZOKdJiZQJa1iYulaZOMgytliKY7EtCDtdKxJolZozJFlc+l634fW3WPWwX9mygwoLk+U 8hQSUwtKTAoJfGIfGnUs4mGlavbD0BMyS0ImYuENWLTU+qZJUmSOdIw/aH5rejDcopX5uQta9iu TivFZo78T4PbcusFTwfAg4AUsJnrgu+R88BitvSAGCi6cYiczTxJOens64qt8yrTQxg0JOgB2lv Zt41Iq0V2tBCw5pjrfeX/vUl8oxbdyiTa8vrKHJOESZ83jNs 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-fbdev@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-fbdev@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/video/fbdev/cg14.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/video/fbdev/cg14.c b/drivers/video/fbdev/cg14.c index 6a745eb46ca1..a028ede39c12 100644 --- a/drivers/video/fbdev/cg14.c +++ b/drivers/video/fbdev/cg14.c @@ -569,7 +569,7 @@ static int cg14_probe(struct platform_device *op) return err; } -static int cg14_remove(struct platform_device *op) +static void cg14_remove(struct platform_device *op) { struct fb_info *info = dev_get_drvdata(&op->dev); struct cg14_par *par = info->par; @@ -580,8 +580,6 @@ static int cg14_remove(struct platform_device *op) cg14_unmap_regs(op, info, par); framebuffer_release(info); - - return 0; } static const struct of_device_id cg14_match[] = { @@ -598,7 +596,7 @@ static struct platform_driver cg14_driver = { .of_match_table = cg14_match, }, .probe = cg14_probe, - .remove = cg14_remove, + .remove_new = cg14_remove, }; static int __init cg14_init(void) From patchwork Sat Mar 18 23:53: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: 665396 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 17B5CC7618A for ; Sat, 18 Mar 2023 23:54:53 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229764AbjCRXyv (ORCPT ); Sat, 18 Mar 2023 19:54:51 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46996 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229602AbjCRXyq (ORCPT ); Sat, 18 Mar 2023 19:54: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 616361B2C7 for ; Sat, 18 Mar 2023 16:54: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 1pdgNm-00042M-NY; Sun, 19 Mar 2023 00:54:42 +0100 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 1pdgNm-0056Zq-2p; Sun, 19 Mar 2023 00:54:42 +0100 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1pdgNl-005zU3-FR; Sun, 19 Mar 2023 00:54:41 +0100 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Helge Deller Cc: linux-fbdev@vger.kernel.org, dri-devel@lists.freedesktop.org, kernel@pengutronix.de Subject: [PATCH 08/51] video: fbdev: cg3: Convert to platform remove callback returning void Date: Sun, 19 Mar 2023 00:53:45 +0100 Message-Id: <20230318235428.272091-9-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230318235428.272091-1-u.kleine-koenig@pengutronix.de> References: <20230318235428.272091-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1682; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=5Sbma9BIO4OFhcgdG7SVgulX/iZKtvsUKh5UHCWLaYs=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBkFk6vwI32IkU1Rs+rgfK1arKQw4otCvcOwDxKJ MpCIim/4ZyJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZBZOrwAKCRCPgPtYfRL+ TsrwB/0fggol6EYx1gi6WpqJuKXRU2Laf24VpOPz0FSghMz3/Vqt8l1e18eu/boGss6heMRaZdK 0ZfKAyz3cVK9VdcRZT6H7h6hYGzC7NDgdaoP1ugIJv5PJudKLY3WYjl1zkDnZScN4qB7ulrAJiT ySzv/mPxhlsW50VWahrGbPKz39HxS8SR+PMKw5sQZz8DttoXLZ12sg/grQCUMuLJaddv5X1sMS8 2pdfmwUVgSyeNOqT6dADHJGcVgWxBCfepmEJHqS57+sUB7KH/v57074ytZ7933FrLn7xsWM3KDO Hvb1KacM5F3U3eC3cPw0GaA2IrXuEHS+7P9CLMbUUu4zf5h5 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-fbdev@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-fbdev@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/video/fbdev/cg3.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/video/fbdev/cg3.c b/drivers/video/fbdev/cg3.c index bdcc3f6ab666..77956934e00a 100644 --- a/drivers/video/fbdev/cg3.c +++ b/drivers/video/fbdev/cg3.c @@ -434,7 +434,7 @@ static int cg3_probe(struct platform_device *op) return err; } -static int cg3_remove(struct platform_device *op) +static void cg3_remove(struct platform_device *op) { struct fb_info *info = dev_get_drvdata(&op->dev); struct cg3_par *par = info->par; @@ -446,8 +446,6 @@ static int cg3_remove(struct platform_device *op) of_iounmap(&op->resource[0], info->screen_base, info->fix.smem_len); framebuffer_release(info); - - return 0; } static const struct of_device_id cg3_match[] = { @@ -467,7 +465,7 @@ static struct platform_driver cg3_driver = { .of_match_table = cg3_match, }, .probe = cg3_probe, - .remove = cg3_remove, + .remove_new = cg3_remove, }; static int __init cg3_init(void) From patchwork Sat Mar 18 23:53: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: 664850 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 CFADCC761A6 for ; Sat, 18 Mar 2023 23:54:53 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229795AbjCRXyw (ORCPT ); Sat, 18 Mar 2023 19:54:52 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47002 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229623AbjCRXyq (ORCPT ); Sat, 18 Mar 2023 19:54: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 D5E421B2E1 for ; Sat, 18 Mar 2023 16:54: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 1pdgNm-00042f-WC; Sun, 19 Mar 2023 00:54:43 +0100 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 1pdgNm-0056Zz-CE; Sun, 19 Mar 2023 00:54:42 +0100 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1pdgNl-005zU7-Lt; Sun, 19 Mar 2023 00:54:41 +0100 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Helge Deller Cc: linux-fbdev@vger.kernel.org, dri-devel@lists.freedesktop.org, kernel@pengutronix.de Subject: [PATCH 09/51] video: fbdev: cg6: Convert to platform remove callback returning void Date: Sun, 19 Mar 2023 00:53:46 +0100 Message-Id: <20230318235428.272091-10-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230318235428.272091-1-u.kleine-koenig@pengutronix.de> References: <20230318235428.272091-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1644; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=BHZSBcQSAl1nP+UQSe7IGJ85XXXdncitBc4w1Vv9EIY=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBkFk6wlHpbx5We+LSgvhGZCVCN9KxuZg3Bw/ykH wv6TbOFON+JATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZBZOsAAKCRCPgPtYfRL+ TlptB/98ytdhHuqOkw2bk8CiTJ6H9Vs0+XdLT8pkn2fJlC3BXOPrIRlrfrSF+Wa9a4qqPfFZ3bX 9zKHQXpxAbHaUTUiv72IB91VaZWUOD2WBQQeMFM3B41Ce7UBx1LG3JNKSiDlBQNQ/qj2rk6SKjV Ni/PA+OZP6BMxuLrZZ7YYra9jXyOO5ZMOwwVfvCUcpFf7RKWYKqYK5GiBugru9g2OCbgOeiRXR6 q+TL7ykki4M2yN80CKTRAi/xMswuDAOH9ZiEx4lGoMdJwcpBPot2Ujdomm8WUqIln4pZjE+7yww HHmOPpkEe7srWEJOKk6gyxyUnj7BIjB6KZSPUqGVJ5mF2yxY 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-fbdev@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-fbdev@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/video/fbdev/cg6.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/video/fbdev/cg6.c b/drivers/video/fbdev/cg6.c index 97ef43c25974..6884572efea1 100644 --- a/drivers/video/fbdev/cg6.c +++ b/drivers/video/fbdev/cg6.c @@ -828,7 +828,7 @@ static int cg6_probe(struct platform_device *op) return err; } -static int cg6_remove(struct platform_device *op) +static void cg6_remove(struct platform_device *op) { struct fb_info *info = dev_get_drvdata(&op->dev); struct cg6_par *par = info->par; @@ -839,8 +839,6 @@ static int cg6_remove(struct platform_device *op) cg6_unmap_regs(op, info, par); framebuffer_release(info); - - return 0; } static const struct of_device_id cg6_match[] = { @@ -860,7 +858,7 @@ static struct platform_driver cg6_driver = { .of_match_table = cg6_match, }, .probe = cg6_probe, - .remove = cg6_remove, + .remove_new = cg6_remove, }; static int __init cg6_init(void) From patchwork Sat Mar 18 23:53: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: 665391 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 4FD4FC76196 for ; Sat, 18 Mar 2023 23:55:00 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229876AbjCRXy6 (ORCPT ); Sat, 18 Mar 2023 19:54:58 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46996 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229724AbjCRXys (ORCPT ); Sat, 18 Mar 2023 19:54: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 2BF911C304 for ; Sat, 18 Mar 2023 16:54: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 1pdgNn-00043L-Ea; Sun, 19 Mar 2023 00:54:43 +0100 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 1pdgNm-0056a6-Pm; Sun, 19 Mar 2023 00:54:42 +0100 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1pdgNl-005zUB-SY; Sun, 19 Mar 2023 00:54:41 +0100 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Helge Deller , Alexander Shiyan , Thomas Zimmermann , Wolfram Sang Cc: linux-fbdev@vger.kernel.org, dri-devel@lists.freedesktop.org, linux-arm-kernel@lists.infradead.org, kernel@pengutronix.de Subject: [PATCH 10/51] video: fbdev: clps711x-fb: Convert to platform remove callback returning void Date: Sun, 19 Mar 2023 00:53:47 +0100 Message-Id: <20230318235428.272091-11-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230318235428.272091-1-u.kleine-koenig@pengutronix.de> References: <20230318235428.272091-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1822; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=7XciOw7u/XULFto6K0Shpj1R0GHgUS4QU77mvneAEPk=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBkFk6xSTiu3Fh1C6zLZ/LLF1EVCMkX9DsskAtCY ehiVEyB7SyJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZBZOsQAKCRCPgPtYfRL+ TsbNB/wJdTFgsFm2NXJy1LBrfF+hMAkx/3kyrU+mvQmwKRAZX5yVzzIH1IXseQXXvdmagFSLfc6 3wbcP5HkEn15LkOCAuzOAudxezca3x9dIWy8uOqBkCaMod7zFouZvtDU2oAjooLJect0SLg78Gx 5XXZ22/NFachWJ8jOeS0l4tfPaGJvPKtPPQP/aSv+8j13My1dl/7zdUZzu0U+xoU6ji1zqaYQj1 hcbY8KrmbbZYBb6vvD2n3x1+q52rh1jeyJHPBWagf/RqkKJD8j579kFix1zO1LwX9O0oMiVUk+F fUG1anRtOVfk9/Stm+a/+pEAJ+S+lgCQajcIFoIruXwJaFDr 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-fbdev@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-fbdev@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/video/fbdev/clps711x-fb.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/video/fbdev/clps711x-fb.c b/drivers/video/fbdev/clps711x-fb.c index 45c75ff01eca..51160a728566 100644 --- a/drivers/video/fbdev/clps711x-fb.c +++ b/drivers/video/fbdev/clps711x-fb.c @@ -351,7 +351,7 @@ static int clps711x_fb_probe(struct platform_device *pdev) return ret; } -static int clps711x_fb_remove(struct platform_device *pdev) +static void clps711x_fb_remove(struct platform_device *pdev) { struct fb_info *info = platform_get_drvdata(pdev); struct clps711x_fb_info *cfb = info->par; @@ -361,8 +361,6 @@ static int clps711x_fb_remove(struct platform_device *pdev) unregister_framebuffer(info); fb_dealloc_cmap(&info->cmap); framebuffer_release(info); - - return 0; } static const struct of_device_id clps711x_fb_dt_ids[] = { @@ -377,7 +375,7 @@ static struct platform_driver clps711x_fb_driver = { .of_match_table = clps711x_fb_dt_ids, }, .probe = clps711x_fb_probe, - .remove = clps711x_fb_remove, + .remove_new = clps711x_fb_remove, }; module_platform_driver(clps711x_fb_driver); From patchwork Sat Mar 18 23:53: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: 665395 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 831C5C76196 for ; Sat, 18 Mar 2023 23:54:54 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229591AbjCRXyx (ORCPT ); Sat, 18 Mar 2023 19:54:53 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47004 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229640AbjCRXyq (ORCPT ); Sat, 18 Mar 2023 19:54: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 3ED961B572 for ; Sat, 18 Mar 2023 16:54: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 1pdgNn-00043M-G0; Sun, 19 Mar 2023 00:54:43 +0100 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 1pdgNm-0056a9-Rh; Sun, 19 Mar 2023 00:54:42 +0100 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1pdgNm-005zUF-2J; Sun, 19 Mar 2023 00:54:42 +0100 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Helge Deller Cc: linux-fbdev@vger.kernel.org, dri-devel@lists.freedesktop.org, kernel@pengutronix.de Subject: [PATCH 11/51] video: fbdev: cobalt_lcdfb: Convert to platform remove callback returning void Date: Sun, 19 Mar 2023 00:53:48 +0100 Message-Id: <20230318235428.272091-12-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230318235428.272091-1-u.kleine-koenig@pengutronix.de> References: <20230318235428.272091-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1600; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=rnmRhYfricsdlIAqsZA0BgXgWKqHQwL7eWXv372yAL0=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBkFk6yakv+5kEMEpEnVXP6MlJtE8TWfIUkBWRT7 wS6LQ8g/RSJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZBZOsgAKCRCPgPtYfRL+ TiZmB/9QvSkR0jAEgRig1Ybd7NBiUJUef3Fz9JYVFKRir70DpEfa4uC9kdi4X02U/GY7RkDzmiB JzpcNrb1NyuBWVJf8leGgCWo/wUr5r/k9XTEFD2DNZUhNxgW/li7N+PuQNe1kpaegtykUi/ubz0 Zwmyc+xgjurz6RLmQqamAndQ+TkV7aatuXyG2KYBu7xDm4Ylf73FFTtLkkn/PyZPk6HaR/hxsl/ CcAb6iy9ivGMRuW1KFKICyYB6KrifjkGsNZm4pRXz1KyQBrMVanPjSS7ysqUHWCV1gQjepWSnkt KNnMzFDognC8uTl3Uyww8cYBSKovIKpT+hMzSzyRvYXT3G8y 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-fbdev@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-fbdev@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/video/fbdev/cobalt_lcdfb.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/video/fbdev/cobalt_lcdfb.c b/drivers/video/fbdev/cobalt_lcdfb.c index 5f8b6324d2e8..feeace079425 100644 --- a/drivers/video/fbdev/cobalt_lcdfb.c +++ b/drivers/video/fbdev/cobalt_lcdfb.c @@ -324,7 +324,7 @@ static int cobalt_lcdfb_probe(struct platform_device *dev) return 0; } -static int cobalt_lcdfb_remove(struct platform_device *dev) +static void cobalt_lcdfb_remove(struct platform_device *dev) { struct fb_info *info; @@ -333,13 +333,11 @@ static int cobalt_lcdfb_remove(struct platform_device *dev) unregister_framebuffer(info); framebuffer_release(info); } - - return 0; } static struct platform_driver cobalt_lcdfb_driver = { .probe = cobalt_lcdfb_probe, - .remove = cobalt_lcdfb_remove, + .remove_new = cobalt_lcdfb_remove, .driver = { .name = "cobalt-lcd", }, From patchwork Sat Mar 18 23:53: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: 665393 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 368A7C76196 for ; Sat, 18 Mar 2023 23:54:57 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229799AbjCRXy4 (ORCPT ); Sat, 18 Mar 2023 19:54:56 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47030 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229649AbjCRXyr (ORCPT ); Sat, 18 Mar 2023 19:54: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 D633A199F5 for ; Sat, 18 Mar 2023 16:54: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 1pdgNn-00043Q-LK; Sun, 19 Mar 2023 00:54:43 +0100 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 1pdgNm-0056aG-W4; Sun, 19 Mar 2023 00:54:43 +0100 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1pdgNm-005zUJ-8z; Sun, 19 Mar 2023 00:54:42 +0100 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Helge Deller , Dongliang Mu Cc: linux-fbdev@vger.kernel.org, dri-devel@lists.freedesktop.org, kernel@pengutronix.de Subject: [PATCH 12/51] video: fbdev: da8xx-fb: Convert to platform remove callback returning void Date: Sun, 19 Mar 2023 00:53:49 +0100 Message-Id: <20230318235428.272091-13-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230318235428.272091-1-u.kleine-koenig@pengutronix.de> References: <20230318235428.272091-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1729; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=+G5sgppBYTGUZBuAd8to6jnmptob1cAJh3ksjDRUT0s=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBkFk60Qqh8j0PJ2MznM0gnhKuf0JrOl1Io89SwP YktcgxOqjmJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZBZOtAAKCRCPgPtYfRL+ TllGB/4miP88ilHISck+EXIzB7rTPn3OdYHVskxXQjk1NTnmd/mX1qK8zZBVCYiPFE01vsDWPdI RjJkQbneR92JnQEPVD3nKucaCqahtgWXMwtmbCR/ozSPogz2DX1KqvAvBjW0XGsgfyDrtK9HJTq KQXLPUDH8h2EUeHdHkeQFXVwOQIEClYUvAH5Kn1QLgPcQA4rj2eBTLcd76q6xCV7Js2d1+Jj8Mc USL0/2sP+DPkkRVul1cM6PuzAVxEcqVg6jjQf3Wv2LZOCS4qkYz8ZZDp3ypfjAJSf9LCmTmBT7h MR6Ojpsn2HOP5zQqEuqk3MubQBmIvMoJKynvODyVU+s+ytYh 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-fbdev@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-fbdev@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/video/fbdev/da8xx-fb.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/video/fbdev/da8xx-fb.c b/drivers/video/fbdev/da8xx-fb.c index cd07e401b326..60cd1286370f 100644 --- a/drivers/video/fbdev/da8xx-fb.c +++ b/drivers/video/fbdev/da8xx-fb.c @@ -1064,7 +1064,7 @@ static void lcd_da8xx_cpufreq_deregister(struct da8xx_fb_par *par) } #endif -static int fb_remove(struct platform_device *dev) +static void fb_remove(struct platform_device *dev) { struct fb_info *info = platform_get_drvdata(dev); struct da8xx_fb_par *par = info->par; @@ -1091,8 +1091,6 @@ static int fb_remove(struct platform_device *dev) pm_runtime_put_sync(&dev->dev); pm_runtime_disable(&dev->dev); framebuffer_release(info); - - return 0; } /* @@ -1657,7 +1655,7 @@ static SIMPLE_DEV_PM_OPS(fb_pm_ops, fb_suspend, fb_resume); static struct platform_driver da8xx_fb_driver = { .probe = fb_probe, - .remove = fb_remove, + .remove_new = fb_remove, .driver = { .name = DRIVER_NAME, .pm = &fb_pm_ops, From patchwork Sat Mar 18 23:53: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: 665394 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 E4071C74A5B for ; Sat, 18 Mar 2023 23:54:55 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229648AbjCRXyy (ORCPT ); Sat, 18 Mar 2023 19:54:54 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46990 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229652AbjCRXys (ORCPT ); Sat, 18 Mar 2023 19:54: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 386AE1BAC4 for ; Sat, 18 Mar 2023 16:54: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 1pdgNo-00043m-09; Sun, 19 Mar 2023 00:54:44 +0100 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 1pdgNn-0056aL-6H; Sun, 19 Mar 2023 00:54:43 +0100 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1pdgNm-005zUO-Fd; Sun, 19 Mar 2023 00:54:42 +0100 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Peter Jones , Helge Deller Cc: linux-fbdev@vger.kernel.org, dri-devel@lists.freedesktop.org, kernel@pengutronix.de Subject: [PATCH 13/51] video: fbdev: efifb: Convert to platform remove callback returning void Date: Sun, 19 Mar 2023 00:53:50 +0100 Message-Id: <20230318235428.272091-14-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230318235428.272091-1-u.kleine-koenig@pengutronix.de> References: <20230318235428.272091-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=VIHoENgJQr+/TzO1wGTKACON8r8R977ccTJvqt5P9bY=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBkFk61yMu2jhPBMTpn1AgCe3qJRrJ3+Petc6RbV 1cVNbPvLHuJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZBZOtQAKCRCPgPtYfRL+ Tr59B/9mvfCIH/NOeCWvxdnnAc99kkHmTi+I1eFZe+fnL2jHtkq9WQ0UgxgG5ZOvVsnBSCbN3kX dvB9mIOLgqr4FNQiM06fNctolLo+6svqAEN6bI7qI0NtvY8dnXvzEk8VSOdVp/pLKH+8EWweZxR H9QqKmXMzh1tzwFJD2oC/swjMRSPZGC/mbnKKIhTpXyIcrjYCQ4YvQM+FMRbsubt4FsLU3P6ZgA Dr8622XlBc5dR8L8eSk+oXGut8jpLijgDRa5PKTe6A8Zg4UFW9In9l8wX3pqBd/gFXTEFr6oVoY ErmS+sVF3oIdet72Rd6U+BVceN2iPgm4MIepH94qtZ+Q7VbL 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-fbdev@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-fbdev@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/video/fbdev/efifb.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/video/fbdev/efifb.c b/drivers/video/fbdev/efifb.c index a5779fb453a2..3d7be69ab593 100644 --- a/drivers/video/fbdev/efifb.c +++ b/drivers/video/fbdev/efifb.c @@ -621,15 +621,13 @@ static int efifb_probe(struct platform_device *dev) return err; } -static int efifb_remove(struct platform_device *pdev) +static void efifb_remove(struct platform_device *pdev) { struct fb_info *info = platform_get_drvdata(pdev); /* efifb_destroy takes care of info cleanup */ unregister_framebuffer(info); sysfs_remove_groups(&pdev->dev.kobj, efifb_groups); - - return 0; } static struct platform_driver efifb_driver = { @@ -637,7 +635,7 @@ static struct platform_driver efifb_driver = { .name = "efi-framebuffer", }, .probe = efifb_probe, - .remove = efifb_remove, + .remove_new = efifb_remove, }; builtin_platform_driver(efifb_driver); From patchwork Sat Mar 18 23:53: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: 665389 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 72A71C77B60 for ; Sat, 18 Mar 2023 23:55:02 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229562AbjCRXzB (ORCPT ); Sat, 18 Mar 2023 19:55:01 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47068 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229747AbjCRXyt (ORCPT ); Sat, 18 Mar 2023 19:54: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 F11F81B2CF for ; Sat, 18 Mar 2023 16:54: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 1pdgNp-00045J-Um; Sun, 19 Mar 2023 00:54:45 +0100 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 1pdgNn-0056aP-Cp; Sun, 19 Mar 2023 00:54:43 +0100 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1pdgNm-005zUR-LQ; Sun, 19 Mar 2023 00:54:42 +0100 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Helge Deller , Gaosheng Cui Cc: linux-fbdev@vger.kernel.org, dri-devel@lists.freedesktop.org, kernel@pengutronix.de Subject: [PATCH 14/51] video: fbdev: ep93xx-fb: Convert to platform remove callback returning void Date: Sun, 19 Mar 2023 00:53:51 +0100 Message-Id: <20230318235428.272091-15-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230318235428.272091-1-u.kleine-koenig@pengutronix.de> References: <20230318235428.272091-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1610; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=FSWnvts299BKHZI7up4omJvQR3NHtI0HbWVYCbBSojM=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBkFk622CfaGoZVNlhC9mGcoliHjKXqSMpdBQrXi L8HdzQxjdOJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZBZOtgAKCRCPgPtYfRL+ Tp7fB/9/bKaj2OKFsPDnQQ1exQ3XxOr4ZCK+aysV2YKXV6W2PtR46vaRC3QKFxh+IfO804bhrH0 Kx9BUohwJNSxMWWE1sBWwa5wADHxbfPVDFHHamRFCIcrKdwXaTMHEAkex/R3z/8ptAnPr4JMgFZ ARvZBsu/VQrUpSIFRAxMEYB/lgPdoIb9+DUgqex01LQwx/HK+BDgSsWFalGqe7cn9RigyaekYtU mYOVSilOoGM3qXEeiBPjHh/ONT847M2N0TK35ZJvDYyQ1pryaxw4Xksyl8JAIpNz0zcN9RV45yJ A2cG2hwi4kTBv8J+PHvvzKneYyYhyw/WEbe0GM9nWCw9+EDd 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-fbdev@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-fbdev@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/video/fbdev/ep93xx-fb.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/video/fbdev/ep93xx-fb.c b/drivers/video/fbdev/ep93xx-fb.c index 305f1587bd89..94fe52928be2 100644 --- a/drivers/video/fbdev/ep93xx-fb.c +++ b/drivers/video/fbdev/ep93xx-fb.c @@ -573,7 +573,7 @@ static int ep93xxfb_probe(struct platform_device *pdev) return err; } -static int ep93xxfb_remove(struct platform_device *pdev) +static void ep93xxfb_remove(struct platform_device *pdev) { struct fb_info *info = platform_get_drvdata(pdev); struct ep93xx_fbi *fbi = info->par; @@ -587,13 +587,11 @@ static int ep93xxfb_remove(struct platform_device *pdev) fbi->mach_info->teardown(pdev); kfree(info); - - return 0; } static struct platform_driver ep93xxfb_driver = { .probe = ep93xxfb_probe, - .remove = ep93xxfb_remove, + .remove_new = ep93xxfb_remove, .driver = { .name = "ep93xx-fb", }, From patchwork Sat Mar 18 23:53: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: 664848 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 A738BC761A6 for ; Sat, 18 Mar 2023 23:54:56 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229652AbjCRXyz (ORCPT ); Sat, 18 Mar 2023 19:54:55 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47040 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229553AbjCRXys (ORCPT ); Sat, 18 Mar 2023 19:54: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 7F88E1BAC7 for ; Sat, 18 Mar 2023 16:54: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 1pdgNo-00046G-As; Sun, 19 Mar 2023 00:54:44 +0100 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 1pdgNn-0056aS-Fp; Sun, 19 Mar 2023 00:54:43 +0100 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1pdgNm-005zUU-RY; Sun, 19 Mar 2023 00:54:42 +0100 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Helge Deller , Wolfram Sang Cc: linux-fbdev@vger.kernel.org, dri-devel@lists.freedesktop.org, kernel@pengutronix.de Subject: [PATCH 15/51] video: fbdev: ffb: Convert to platform remove callback returning void Date: Sun, 19 Mar 2023 00:53:52 +0100 Message-Id: <20230318235428.272091-16-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230318235428.272091-1-u.kleine-koenig@pengutronix.de> References: <20230318235428.272091-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1683; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=nTkQmkVJWNdBujbrdtnDFlWOA7LXxqZAA14hjs9xq9w=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBkFk63127WC8hR7M/L+zCAkWc9Qhq8mDe3jC4UB rt3666/tmiJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZBZOtwAKCRCPgPtYfRL+ TlvKCACiZHsyxjxIEHyU/fDz4FJtRyiOIm3K4W6Z8YhMqCriP9WFrm33vRoJ3SvAjhp/BWWw+2f FQyCCuGdFbiFvrLJFA3hNckTu+9HVXH3nXw9Tx8CWgKWuzrs5FpPzjW88KUSJungwNlNGMacJpH 9oKKmFBwsjBL1ystqUlpoa2r0C3www96aQ59i8FbgTqJ9teiaFLg93OUqx3hT8Ovzkcmny4sFqW DSfoSfwz6+RkK708+XIh6V6uvZt70TbPPrT11by5Z8gK+kPphxIHovokOav+dq49wtGy9b6Tt99 6ZcuK+GaibAqt1qw+PGz0lxaRzlnvkHeztEnbYmmTVoqDwND 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-fbdev@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-fbdev@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/video/fbdev/ffb.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/video/fbdev/ffb.c b/drivers/video/fbdev/ffb.c index 7cba3969a970..c6d3111dcbb0 100644 --- a/drivers/video/fbdev/ffb.c +++ b/drivers/video/fbdev/ffb.c @@ -1023,7 +1023,7 @@ static int ffb_probe(struct platform_device *op) return err; } -static int ffb_remove(struct platform_device *op) +static void ffb_remove(struct platform_device *op) { struct fb_info *info = dev_get_drvdata(&op->dev); struct ffb_par *par = info->par; @@ -1035,8 +1035,6 @@ static int ffb_remove(struct platform_device *op) of_iounmap(&op->resource[1], par->dac, sizeof(struct ffb_dac)); framebuffer_release(info); - - return 0; } static const struct of_device_id ffb_match[] = { @@ -1056,7 +1054,7 @@ static struct platform_driver ffb_driver = { .of_match_table = ffb_match, }, .probe = ffb_probe, - .remove = ffb_remove, + .remove_new = ffb_remove, }; static int __init ffb_init(void) From patchwork Sat Mar 18 23:53: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: 664847 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 E5B73C761AF for ; Sat, 18 Mar 2023 23:54:57 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229593AbjCRXy4 (ORCPT ); Sat, 18 Mar 2023 19:54:56 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46992 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229653AbjCRXys (ORCPT ); Sat, 18 Mar 2023 19:54: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 A437E1ACE7 for ; Sat, 18 Mar 2023 16:54: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 1pdgNo-000479-IL; Sun, 19 Mar 2023 00:54:44 +0100 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 1pdgNn-0056aY-N4; Sun, 19 Mar 2023 00:54:43 +0100 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1pdgNn-005zUa-3i; Sun, 19 Mar 2023 00:54:43 +0100 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Timur Tabi , Helge Deller Cc: linux-fbdev@vger.kernel.org, dri-devel@lists.freedesktop.org, kernel@pengutronix.de Subject: [PATCH 16/51] video: fbdev: fsl-diu-fb: Convert to platform remove callback returning void Date: Sun, 19 Mar 2023 00:53:53 +0100 Message-Id: <20230318235428.272091-17-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230318235428.272091-1-u.kleine-koenig@pengutronix.de> References: <20230318235428.272091-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1676; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=742apMRN2MchqOy75ObOcpQnK0dgK75vXsYEGC2Sx3U=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBkFk64Z8ILvngUgN+3rXhk7DrPgLxeqvPFso6Vw Bzr8PmQY3aJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZBZOuAAKCRCPgPtYfRL+ TkM2CACiKrVZ6wjuuOVAOX62zj0S4xfZhwsalQGxmKEFVztqUzSwTNgTPrGVs1CeJhuN1Cv0YSF OciZ4M6aoEDn6CH/Pe7vctbZqzTmO/Vbyqg6R6TK6nbugsren/5rIBrTDGPkxeGeKVMiOP71/JD Jh0X8/tLS+Mc0NDfx7QfrXCmPE2BikAJ2XBMcHQJGMhHXJUAkgH+Ld8NQNqOS/cO1fc48AHIBOp hox652c8FFkuPtZuQw7SSlRl3sYFpuCBGI2DQvS+w/5k5vngCiT6OjUDgyn6z00U9+rTi549xRc n8fdwgJDzWBqf7FKEAniAQw/4yqXivVSvvksyhqq9scbD419 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-fbdev@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-fbdev@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/video/fbdev/fsl-diu-fb.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/video/fbdev/fsl-diu-fb.c b/drivers/video/fbdev/fsl-diu-fb.c index e332017c6af6..730a07d23fa9 100644 --- a/drivers/video/fbdev/fsl-diu-fb.c +++ b/drivers/video/fbdev/fsl-diu-fb.c @@ -1823,7 +1823,7 @@ static int fsl_diu_probe(struct platform_device *pdev) return ret; } -static int fsl_diu_remove(struct platform_device *pdev) +static void fsl_diu_remove(struct platform_device *pdev) { struct fsl_diu_data *data; int i; @@ -1837,8 +1837,6 @@ static int fsl_diu_remove(struct platform_device *pdev) uninstall_fb(&data->fsl_diu_info[i]); iounmap(data->diu_reg); - - return 0; } #ifndef MODULE @@ -1885,7 +1883,7 @@ static struct platform_driver fsl_diu_driver = { .of_match_table = fsl_diu_match, }, .probe = fsl_diu_probe, - .remove = fsl_diu_remove, + .remove_new = fsl_diu_remove, .suspend = fsl_diu_suspend, .resume = fsl_diu_resume, }; From patchwork Sat Mar 18 23:53: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: 665375 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 2E1EFC74A5B for ; Sat, 18 Mar 2023 23:55:23 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229724AbjCRXzW (ORCPT ); Sat, 18 Mar 2023 19:55:22 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47382 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229738AbjCRXzB (ORCPT ); Sat, 18 Mar 2023 19:55: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 37E8D1ACE7 for ; Sat, 18 Mar 2023 16:55: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 1pdgNu-00047f-7s; Sun, 19 Mar 2023 00:54:50 +0100 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 1pdgNo-0056ae-22; Sun, 19 Mar 2023 00:54:44 +0100 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1pdgNn-005zUe-9g; Sun, 19 Mar 2023 00:54:43 +0100 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Helge Deller , Xuezhi Zhang , Jiasheng Jiang Cc: linux-fbdev@vger.kernel.org, dri-devel@lists.freedesktop.org, kernel@pengutronix.de Subject: [PATCH 17/51] video: fbdev: gbefb: Convert to platform remove callback returning void Date: Sun, 19 Mar 2023 00:53:54 +0100 Message-Id: <20230318235428.272091-18-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230318235428.272091-1-u.kleine-koenig@pengutronix.de> References: <20230318235428.272091-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1663; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=2EBDPNo81BiYaZ42TqYb77RVHgFF+RT7fEuw4w0Dq8I=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBkFk65BM89XHpJGCVfoPMJ590nRpFRGpNM/SXg0 LsLMGoQV9SJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZBZOuQAKCRCPgPtYfRL+ TlEXCACWA4DoQEtef7fsNcI1rsdMmtezGreCAcpqC9llneaYFDBECsNisCuILSa0E6xfk3hxxyp JfheByPN5y1StGPN1vZb34P5SFyAYb7mWHVNy1m+Sf8/BZUGtkiyfpBbFtcZHPBYXfUtRsddx8f gKUo5sfLz3lhPhBTSxu0OSzMyZCyzhX+IA9jI9YwtQJuW/SbbSJ+9oVjFrZK8iE8qxpua1yMGuY yNFikHHKqhZJswW8XnQ/FXJlJTdHaaYKA7ev3E74Ufx7euk3+3belMuCNgJFc3B896PSi4Zuxzd x2OT5U5LrvScM+x/w6D4LLDpr6In6FfTCYAh9akylDCWlKL4 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-fbdev@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-fbdev@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/video/fbdev/gbefb.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/video/fbdev/gbefb.c b/drivers/video/fbdev/gbefb.c index 000b4aa44241..3f141e21b7e0 100644 --- a/drivers/video/fbdev/gbefb.c +++ b/drivers/video/fbdev/gbefb.c @@ -1233,7 +1233,7 @@ static int gbefb_probe(struct platform_device *p_dev) return ret; } -static int gbefb_remove(struct platform_device* p_dev) +static void gbefb_remove(struct platform_device* p_dev) { struct fb_info *info = platform_get_drvdata(p_dev); struct gbefb_par *par = info->par; @@ -1243,13 +1243,11 @@ static int gbefb_remove(struct platform_device* p_dev) arch_phys_wc_del(par->wc_cookie); release_mem_region(GBE_BASE, sizeof(struct sgi_gbe)); framebuffer_release(info); - - return 0; } static struct platform_driver gbefb_driver = { .probe = gbefb_probe, - .remove = gbefb_remove, + .remove_new = gbefb_remove, .driver = { .name = "gbefb", .dev_groups = gbefb_groups, From patchwork Sat Mar 18 23:53: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: 664845 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 00F93C74A5B for ; Sat, 18 Mar 2023 23:55:00 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229623AbjCRXy7 (ORCPT ); Sat, 18 Mar 2023 19:54:59 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46994 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229713AbjCRXys (ORCPT ); Sat, 18 Mar 2023 19:54: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 096CD1BAF4 for ; Sat, 18 Mar 2023 16:54: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 1pdgNp-00048b-65; Sun, 19 Mar 2023 00:54:45 +0100 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 1pdgNo-0056ak-Bp; Sun, 19 Mar 2023 00:54:44 +0100 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1pdgNn-005zUk-Fr; Sun, 19 Mar 2023 00:54:43 +0100 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Helge Deller Cc: linux-fbdev@vger.kernel.org, dri-devel@lists.freedesktop.org, kernel@pengutronix.de Subject: [PATCH 18/51] video: fbdev: goldfishfb: Convert to platform remove callback returning void Date: Sun, 19 Mar 2023 00:53:55 +0100 Message-Id: <20230318235428.272091-19-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230318235428.272091-1-u.kleine-koenig@pengutronix.de> References: <20230318235428.272091-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=BZfRo6P2tNpdJJjv/k2HgcI7tTfe5xHKoawNKRXAvyI=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBkFk66CqV9RO0I8fiyDNkz/tyQXHaS9BgZr3DrM RiDHb9vMJmJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZBZOugAKCRCPgPtYfRL+ TuYlB/9KO6pTVSrAHgWgjkmqCxA8fvShvQlohbUJfQXgj7iWhLvZa3JYw7xZUy99OPMqtflXdIm yoYHqMiMWRLYBAfkIipbZE4pdeERV+w8f4m8ZlQQq3ZCspdZAlWyQdIUYNg3lJFRCsh00W5oixs Kmql0JiQ9DWzBTOrIr5TMHTH3V9EEFdqzM9Zh719ETs3a/rEsG3oOUAkGbft1e9Cde3o91XYQLi PXsABfi6VFSxMCF2FQ6fbRvSodf6K+k8zqbCUZ/quT+11jS4REaT3NCr/ICXGZV+lMNBNa2lN36 kQEWkudbpMe25PKs/EYn66U+IWeo1TEeqLBMnmfjiH7Hl1lo 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-fbdev@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-fbdev@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/video/fbdev/goldfishfb.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/drivers/video/fbdev/goldfishfb.c b/drivers/video/fbdev/goldfishfb.c index 2b885cd046fe..6fa2108fd912 100644 --- a/drivers/video/fbdev/goldfishfb.c +++ b/drivers/video/fbdev/goldfishfb.c @@ -283,7 +283,7 @@ static int goldfish_fb_probe(struct platform_device *pdev) return ret; } -static int goldfish_fb_remove(struct platform_device *pdev) +static void goldfish_fb_remove(struct platform_device *pdev) { size_t framesize; struct goldfish_fb *fb = platform_get_drvdata(pdev); @@ -296,7 +296,6 @@ static int goldfish_fb_remove(struct platform_device *pdev) fb->fb.fix.smem_start); iounmap(fb->reg_base); kfree(fb); - return 0; } static const struct of_device_id goldfish_fb_of_match[] = { @@ -315,7 +314,7 @@ MODULE_DEVICE_TABLE(acpi, goldfish_fb_acpi_match); static struct platform_driver goldfish_fb_driver = { .probe = goldfish_fb_probe, - .remove = goldfish_fb_remove, + .remove_new = goldfish_fb_remove, .driver = { .name = "goldfish_fb", .of_match_table = goldfish_fb_of_match, From patchwork Sat Mar 18 23:53: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: 665392 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 6A408C74A5B for ; Sat, 18 Mar 2023 23:54:58 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229845AbjCRXy5 (ORCPT ); Sat, 18 Mar 2023 19:54:57 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47046 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229671AbjCRXys (ORCPT ); Sat, 18 Mar 2023 19:54: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 D6A951BAD1 for ; Sat, 18 Mar 2023 16:54: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 1pdgNp-00048o-5q; Sun, 19 Mar 2023 00:54:45 +0100 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 1pdgNo-0056al-CU; Sun, 19 Mar 2023 00:54:44 +0100 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1pdgNn-005zUo-M4; Sun, 19 Mar 2023 00:54:43 +0100 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Helge Deller Cc: linux-fbdev@vger.kernel.org, dri-devel@lists.freedesktop.org, kernel@pengutronix.de Subject: [PATCH 19/51] video: fbdev: grvga: Convert to platform remove callback returning void Date: Sun, 19 Mar 2023 00:53:56 +0100 Message-Id: <20230318235428.272091-20-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230318235428.272091-1-u.kleine-koenig@pengutronix.de> References: <20230318235428.272091-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1667; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=w3PbzBb6n2nqBuV8qZCtoHtBJv59krNA/XZ/KJwDO5o=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBkFk68IZzDWqm6ttd7b9/mkNOCsDB+EdeM2L5v5 MKeZTADV12JATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZBZOvAAKCRCPgPtYfRL+ TmGtB/0VA/sthxPkFudCxTwFIwGFs6hZ7ntBJzqtUyhX7UoYNQsX9+pJelo10q1gneCkD9IRP0G nRD8FhduwIi2qi+GhojDJA2TophuuKYDYWcPVzaqrdfBQeibNyT5ipM1xGA8DZyAJEUnMCRBu2e svj3Jqgd4diQWg/VNx7pATkiQ9gibi+6TrGRDiymjJv12Frok9kRbPSC4CgR18/0HuGUAj3QPWu q9Ed06xLJtnEnaBtP+QQcbclO+g+toGkFnO7pMT39AZhdQ3R8vnPkoazAtITRmu/MqnbNA4HN1e pfukF3gHEepnFtqYkCI/kpwBWXx5SMeCg1NijYroKmOAOoC3 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-fbdev@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-fbdev@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/video/fbdev/grvga.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/video/fbdev/grvga.c b/drivers/video/fbdev/grvga.c index 24818b276241..9aa15be29ea9 100644 --- a/drivers/video/fbdev/grvga.c +++ b/drivers/video/fbdev/grvga.c @@ -504,7 +504,7 @@ static int grvga_probe(struct platform_device *dev) return retval; } -static int grvga_remove(struct platform_device *device) +static void grvga_remove(struct platform_device *device) { struct fb_info *info = dev_get_drvdata(&device->dev); struct grvga_par *par; @@ -524,8 +524,6 @@ static int grvga_remove(struct platform_device *device) framebuffer_release(info); } - - return 0; } static struct of_device_id svgactrl_of_match[] = { @@ -545,7 +543,7 @@ static struct platform_driver grvga_driver = { .of_match_table = svgactrl_of_match, }, .probe = grvga_probe, - .remove = grvga_remove, + .remove_new = grvga_remove, }; module_platform_driver(grvga_driver); From patchwork Sat Mar 18 23:53: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: 665390 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 50C7FC761A6 for ; Sat, 18 Mar 2023 23:55:01 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229653AbjCRXzA (ORCPT ); Sat, 18 Mar 2023 19:55:00 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47054 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229738AbjCRXys (ORCPT ); Sat, 18 Mar 2023 19:54: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 AE2251C58F for ; Sat, 18 Mar 2023 16:54: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 1pdgNp-00049c-Dv; Sun, 19 Mar 2023 00:54:45 +0100 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 1pdgNo-0056au-OF; Sun, 19 Mar 2023 00:54:44 +0100 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1pdgNn-005zUs-S2; Sun, 19 Mar 2023 00:54:43 +0100 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Helge Deller , Javier Martinez Canillas , Thomas Zimmermann Cc: linux-fbdev@vger.kernel.org, dri-devel@lists.freedesktop.org, kernel@pengutronix.de Subject: [PATCH 20/51] video: fbdev: hecubafb: Convert to platform remove callback returning void Date: Sun, 19 Mar 2023 00:53:57 +0100 Message-Id: <20230318235428.272091-21-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230318235428.272091-1-u.kleine-koenig@pengutronix.de> References: <20230318235428.272091-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1576; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=OdZ3pDt714v4VNRS/xI1QELFOYfM+/Dof2avBOgjwV8=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBkFk69nbV7M8ogkAdJIngzLl676pYAjS2URcoUp HIJJymlrJOJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZBZOvQAKCRCPgPtYfRL+ TozOB/wPKBTawbIdjVWGDowkVm/ZgPvHiXMncEBYqkYK0TwXWyX+5Yatu42zRua+kk1ppSSTtsm 280vii7/ejCTQ3uUOyYP9UuQut8Hp2DxfMEdIYqjIDSBiMPZLDbbh6ZwPJNh+3/xfi/jwvh/L2I BRaWnm/BU6l2u1/aUHHmjuvEkL2HXw7+4m0LfO4tK/VnCEG3kqmMCLw9Y/1dSolqA+nP/xmbN1/ jY+TD6iDpuESNHEmr0/2YR32Pt++0Z55AZAdRXkRVma9Sj7/BqXZAY7KvLy72M30W5rqikwQ1CC QqFmrH5WoQPVi8XpMnJntkXPzA8PGSXp0ggSKtOoCm7rtvHC 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-fbdev@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-fbdev@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/video/fbdev/hecubafb.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/drivers/video/fbdev/hecubafb.c b/drivers/video/fbdev/hecubafb.c index eb1eaadc1bbb..5a149458d3b4 100644 --- a/drivers/video/fbdev/hecubafb.c +++ b/drivers/video/fbdev/hecubafb.c @@ -279,7 +279,7 @@ static int hecubafb_probe(struct platform_device *dev) return retval; } -static int hecubafb_remove(struct platform_device *dev) +static void hecubafb_remove(struct platform_device *dev) { struct fb_info *info = platform_get_drvdata(dev); @@ -293,12 +293,11 @@ static int hecubafb_remove(struct platform_device *dev) module_put(par->board->owner); framebuffer_release(info); } - return 0; } static struct platform_driver hecubafb_driver = { .probe = hecubafb_probe, - .remove = hecubafb_remove, + .remove_new = hecubafb_remove, .driver = { .name = "hecubafb", }, From patchwork Sat Mar 18 23:53: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: 665374 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 8ABD4C761A6 for ; Sat, 18 Mar 2023 23:57:00 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229541AbjCRX5A (ORCPT ); Sat, 18 Mar 2023 19:57:00 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48608 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229488AbjCRX47 (ORCPT ); Sat, 18 Mar 2023 19:56: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 7EA2A23DB8 for ; Sat, 18 Mar 2023 16:56: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 1pdgNq-00049d-6A; Sun, 19 Mar 2023 00:54:46 +0100 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 1pdgNo-0056ax-QG; Sun, 19 Mar 2023 00:54:44 +0100 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1pdgNo-005zUv-2i; Sun, 19 Mar 2023 00:54:44 +0100 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Ferenc Bakonyi , Helge Deller Cc: linux-nvidia@lists.surfsouth.com, linux-fbdev@vger.kernel.org, dri-devel@lists.freedesktop.org, kernel@pengutronix.de Subject: [PATCH 21/51] video: fbdev: hgafb: Convert to platform remove callback returning void Date: Sun, 19 Mar 2023 00:53:58 +0100 Message-Id: <20230318235428.272091-22-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230318235428.272091-1-u.kleine-koenig@pengutronix.de> References: <20230318235428.272091-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1524; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=eZDLRnCYCHs1tJmhSerH6czPGGhxyCBJVPFxfmdREKI=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBkFk6+Sn8GIhneX9f4FUvTnzrvH6+k+jeAbM5l5 cRU+3VEcSaJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZBZOvgAKCRCPgPtYfRL+ TqAxB/4uqBAqyawo+IG//gd0+thIZaI9iAjCHiaQxqom+G+7FhMVFGrpxoHPe/F0W8v0adXyUzA qWdO1fhdk5wtwTf9G/UJmM9s+D3xuduv1fZJdslgcf3fyigZ6HMXc2eyqhcInj5E4+zkyCnhgp+ +7WtItI3Mo/4fMxEwOxGaKjdWeEF1wQhqpPXwWd2/nCMCcCU4DuC8WsquqBvJeQLB0+ojElrvrD /b2yxtVkch+cIAugPF1IfdWXJqAt2G0dFqJf7erdkC3PUjphhnzRvs58oLTwHb0dioHBLsUlRgh 6uftCA5Zn01NRizIbyhin1Zauls+UFQzxZqox2hznOhp9fAz 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-fbdev@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-fbdev@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/video/fbdev/hgafb.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/video/fbdev/hgafb.c b/drivers/video/fbdev/hgafb.c index bd3d07aa4f0e..20bdab738ab7 100644 --- a/drivers/video/fbdev/hgafb.c +++ b/drivers/video/fbdev/hgafb.c @@ -595,7 +595,7 @@ static int hgafb_probe(struct platform_device *pdev) return 0; } -static int hgafb_remove(struct platform_device *pdev) +static void hgafb_remove(struct platform_device *pdev) { struct fb_info *info = platform_get_drvdata(pdev); @@ -614,13 +614,11 @@ static int hgafb_remove(struct platform_device *pdev) if (release_io_port) release_region(0x3bf, 1); - - return 0; } static struct platform_driver hgafb_driver = { .probe = hgafb_probe, - .remove = hgafb_remove, + .remove_new = hgafb_remove, .driver = { .name = "hgafb", }, From patchwork Sat Mar 18 23:53: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: 664846 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 4BE54C7618A for ; Sat, 18 Mar 2023 23:54:59 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229671AbjCRXy6 (ORCPT ); Sat, 18 Mar 2023 19:54:58 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47052 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229737AbjCRXys (ORCPT ); Sat, 18 Mar 2023 19:54: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 4E1CD1C58C for ; Sat, 18 Mar 2023 16:54: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 1pdgNp-00049i-JX; Sun, 19 Mar 2023 00:54:45 +0100 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 1pdgNo-0056b1-Tb; Sun, 19 Mar 2023 00:54:44 +0100 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1pdgNo-005zUz-8a; Sun, 19 Mar 2023 00:54:44 +0100 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Helge Deller Cc: linux-fbdev@vger.kernel.org, dri-devel@lists.freedesktop.org, kernel@pengutronix.de Subject: [PATCH 22/51] video: fbdev: hitfb: Convert to platform remove callback returning void Date: Sun, 19 Mar 2023 00:53:59 +0100 Message-Id: <20230318235428.272091-23-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230318235428.272091-1-u.kleine-koenig@pengutronix.de> References: <20230318235428.272091-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1635; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=B1BEIthHKkUU2FohTtSpJ1Cp74UkEuBDnvaDm3hAXWk=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBkFk6/M1yTePdIx3RkjpiYVyoZO8FOvG9Ppl4cr W9mYOHNWgWJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZBZOvwAKCRCPgPtYfRL+ TmGhB/9K0MoABZSO2oV/TZgaQmhf1aQsI4Mrkslg+46xpZyyVzGYT2DelA6e6eqKvAdh66wG9Q1 wNLlYyYj3g+0M7m94TthWrnbGP8vjhF2tYsUKH+FQplqDk97H6Kdu9n+ew426+lsJzxEwbKxO3e Qv/QbEQGpuzNDeHMnlcqjj4i/vsKB0klG+WFYcRzDOLNE83G3bacBjHhsZw8KbO9o5gEDP9MWIl m6SBClAURz/1TfCAJjSEkIwEIkJVYrIQAQMOq7oQjs1y1BD1Ab6NM2fOcqqnMLh9QUJNSLSyjJg MX8il/k6fdEsUVhz+iMR9KI0dV/1S/ciFmKiq39NbDk7JvfS 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-fbdev@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-fbdev@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/video/fbdev/hitfb.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/video/fbdev/hitfb.c b/drivers/video/fbdev/hitfb.c index bbb0f1d953cc..3033f5056976 100644 --- a/drivers/video/fbdev/hitfb.c +++ b/drivers/video/fbdev/hitfb.c @@ -415,15 +415,13 @@ static int hitfb_probe(struct platform_device *dev) return ret; } -static int hitfb_remove(struct platform_device *dev) +static void hitfb_remove(struct platform_device *dev) { struct fb_info *info = platform_get_drvdata(dev); unregister_framebuffer(info); fb_dealloc_cmap(&info->cmap); framebuffer_release(info); - - return 0; } static int hitfb_suspend(struct device *dev) @@ -460,7 +458,7 @@ static const struct dev_pm_ops hitfb_dev_pm_ops = { static struct platform_driver hitfb_driver = { .probe = hitfb_probe, - .remove = hitfb_remove, + .remove_new = hitfb_remove, .driver = { .name = "hitfb", .pm = &hitfb_dev_pm_ops, From patchwork Sat Mar 18 23:54: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: 665384 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 94A00C761A6 for ; Sat, 18 Mar 2023 23:55:08 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229788AbjCRXzH (ORCPT ); Sat, 18 Mar 2023 19:55:07 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47002 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229782AbjCRXyw (ORCPT ); Sat, 18 Mar 2023 19:54: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 5F86C1ACE7 for ; Sat, 18 Mar 2023 16:54: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 1pdgNq-0004Cc-FB; Sun, 19 Mar 2023 00:54:46 +0100 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 1pdgNp-0056b8-Fu; Sun, 19 Mar 2023 00:54:45 +0100 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1pdgNo-005zV2-ET; Sun, 19 Mar 2023 00:54:44 +0100 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Sascha Hauer , Helge Deller , Shawn Guo Cc: Fabio Estevam , NXP Linux Team , linux-fbdev@vger.kernel.org, linux-arm-kernel@lists.infradead.org, dri-devel@lists.freedesktop.org, kernel@pengutronix.de Subject: [PATCH 23/51] video: fbdev: imxfb: Convert to platform remove callback returning void Date: Sun, 19 Mar 2023 00:54:00 +0100 Message-Id: <20230318235428.272091-24-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230318235428.272091-1-u.kleine-koenig@pengutronix.de> References: <20230318235428.272091-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=d2UxhYplIb+y7dtlgqGR5bljlwCocj0tp5fWaYnzofc=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBkFk7AFX7lRZe3IG+TM6r9J0oHT6oxMUap03OE5 HO7g4qsf3GJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZBZOwAAKCRCPgPtYfRL+ TjtHB/9NiEUh3vulSBr8kh5lrEs6NsW1YfckgBLlFX9LXDkmOYBgjVZIc+2UWk7WcWJBdojAY9L c0ThFO6d4uvlaIF9IkZwuUOPsaO7+cu1v9/+nDn3t1/RuxQcKR1zS8RNq3D4mh/ZPE46//2jVac glaq8EYbuqR9A8Py7enMnorz+0e8dLGe2rU/G3WHwzvozL1YmC92qCR9B60ICTBLzFqDjrAvtpU YHcl1yL/Q5JCHEyW7O8vBmW3KS2EWQqYMpA+brKnQNL+6OG7Rt+6QPt/OpxlrdKjvQmNvzKdLxh /HMhLXF12d4sO84scf+ceyz/DUR2moeRsgkrHYS1PHxgC6Ct 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-fbdev@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-fbdev@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/video/fbdev/imxfb.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/video/fbdev/imxfb.c b/drivers/video/fbdev/imxfb.c index 51fde1b2a793..adf36690c342 100644 --- a/drivers/video/fbdev/imxfb.c +++ b/drivers/video/fbdev/imxfb.c @@ -1051,7 +1051,7 @@ static int imxfb_probe(struct platform_device *pdev) return ret; } -static int imxfb_remove(struct platform_device *pdev) +static void imxfb_remove(struct platform_device *pdev) { struct fb_info *info = platform_get_drvdata(pdev); struct imxfb_info *fbi = info->par; @@ -1064,8 +1064,6 @@ static int imxfb_remove(struct platform_device *pdev) fbi->map_dma); kfree(info->pseudo_palette); framebuffer_release(info); - - return 0; } static int __maybe_unused imxfb_suspend(struct device *dev) @@ -1097,7 +1095,7 @@ static struct platform_driver imxfb_driver = { .pm = &imxfb_pm_ops, }, .probe = imxfb_probe, - .remove = imxfb_remove, + .remove_new = imxfb_remove, .id_table = imxfb_devtype, }; module_platform_driver(imxfb_driver); From patchwork Sat Mar 18 23:54: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: 664844 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 C89ECC7618A for ; Sat, 18 Mar 2023 23:55:01 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229713AbjCRXzB (ORCPT ); Sat, 18 Mar 2023 19:55:01 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47002 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229562AbjCRXys (ORCPT ); Sat, 18 Mar 2023 19:54: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 BD4361C590 for ; Sat, 18 Mar 2023 16:54: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 1pdgNq-0004Cp-6F; Sun, 19 Mar 2023 00:54:46 +0100 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 1pdgNp-0056bC-Hz; Sun, 19 Mar 2023 00:54:45 +0100 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1pdgNo-005zV7-L5; Sun, 19 Mar 2023 00:54:44 +0100 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Helge Deller Cc: linux-fbdev@vger.kernel.org, dri-devel@lists.freedesktop.org, kernel@pengutronix.de Subject: [PATCH 24/51] video: fbdev: leo: Convert to platform remove callback returning void Date: Sun, 19 Mar 2023 00:54:01 +0100 Message-Id: <20230318235428.272091-25-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230318235428.272091-1-u.kleine-koenig@pengutronix.de> References: <20230318235428.272091-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1644; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=F8N/+OapS1TwpsJrOs90b5CY8V/qJ8fAE1hzfGggvEI=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBkFk7BKWQ+SA+YbFeTxJkz/hx5Lu2NE7F9gETEo qMte9pIdpOJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZBZOwQAKCRCPgPtYfRL+ TttICACoMMt6rMFG4Ga+qTHqxKif2ExJc+e2gl+fHgqfzwVSNVZcOMNfwPtjtRzLt5NaBAA6oNN F8K6J/Nq54H66QnI1HAIiogXodJ/leE88KOgrbCsFi7NIWpFu4HUiQ8IhabdugOAPn6WdwcMa8R IjhkAWdkYLou2rhfUlEdShIupAKZFquH8BRYW07ZjE7x26B7RJ7I1kz5HAilm1w9s7n2dB+csHx n0ejD49jNBnmpSnPmFbCHYGckZpQp15ZvE/a1YgNg/B3u3SrdtsKDa3mLjHZo3IZ7pdaGMtPEbU 65Xjb9dJsts42Jfg/Ki/4roZB3hw4gt1ZKollnScFp7EkTsG 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-fbdev@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-fbdev@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/video/fbdev/leo.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/video/fbdev/leo.c b/drivers/video/fbdev/leo.c index 3eb0f3583f4f..3ffc0a725f89 100644 --- a/drivers/video/fbdev/leo.c +++ b/drivers/video/fbdev/leo.c @@ -637,7 +637,7 @@ static int leo_probe(struct platform_device *op) return err; } -static int leo_remove(struct platform_device *op) +static void leo_remove(struct platform_device *op) { struct fb_info *info = dev_get_drvdata(&op->dev); struct leo_par *par = info->par; @@ -648,8 +648,6 @@ static int leo_remove(struct platform_device *op) leo_unmap_regs(op, info, par); framebuffer_release(info); - - return 0; } static const struct of_device_id leo_match[] = { @@ -666,7 +664,7 @@ static struct platform_driver leo_driver = { .of_match_table = leo_match, }, .probe = leo_probe, - .remove = leo_remove, + .remove_new = leo_remove, }; static int __init leo_init(void) From patchwork Sat Mar 18 23:54: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: 664842 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 0BC71C74A5B for ; Sat, 18 Mar 2023 23:55:04 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229579AbjCRXzD (ORCPT ); Sat, 18 Mar 2023 19:55:03 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47030 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229762AbjCRXyu (ORCPT ); Sat, 18 Mar 2023 19:54: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 1F5AE1B2E1 for ; Sat, 18 Mar 2023 16:54: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 1pdgNq-0004Cu-H6; Sun, 19 Mar 2023 00:54:46 +0100 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 1pdgNp-0056bE-J5; Sun, 19 Mar 2023 00:54:45 +0100 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1pdgNo-005zVB-Rl; Sun, 19 Mar 2023 00:54:44 +0100 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Helge Deller , Christophe Leroy , Javier Martinez Canillas , Thomas Zimmermann Cc: linux-fbdev@vger.kernel.org, dri-devel@lists.freedesktop.org, kernel@pengutronix.de Subject: [PATCH 25/51] video: fbdev: mb862xx: Convert to platform remove callback returning void Date: Sun, 19 Mar 2023 00:54:02 +0100 Message-Id: <20230318235428.272091-26-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230318235428.272091-1-u.kleine-koenig@pengutronix.de> References: <20230318235428.272091-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=n0tjhuJrFGcP2NM1FYKiwu0flb4gjoOOgN8yfE1fLf8=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBkFk7CzzJlOFhDIAbO9bMcxIi4HWcjmrLMbH4w+ TDRHhDAZ8yJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZBZOwgAKCRCPgPtYfRL+ TkDBCACIQx58+/h0Da9NaC6Idqt25R71OosMjeqa0annzR+Ar5g4w9iRWo6CxWhi4EkEL/9UBq0 7GsrQiQtItYvFfvQ5pzx48gIhz1VOorvNjISqM4SjpzEI9Nmyr3wk3YJ8iA01PvnRdOuSmmvwQB xlM+21v2Aj1i4Q+UH4FDGSKnaOYrxawNCvRuLpAPV1S3zxr5twb9vZnqkiHmE5XvpjQfxRfdSsP /EImaire8hQ8VAh4UZfliYFUSI1XnpaYraK6an4W521CGHuIGaW2H/FGQk6qjZh2uvCqKQQIC7t AbQCWObdZKeuIJr6IrLsVRDQs5TfQttkeeDjkv1A1BoqZP6U 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-fbdev@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-fbdev@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/video/fbdev/mb862xx/mb862xxfbdrv.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/drivers/video/fbdev/mb862xx/mb862xxfbdrv.c b/drivers/video/fbdev/mb862xx/mb862xxfbdrv.c index a236fc910148..b5c8fcab9940 100644 --- a/drivers/video/fbdev/mb862xx/mb862xxfbdrv.c +++ b/drivers/video/fbdev/mb862xx/mb862xxfbdrv.c @@ -784,7 +784,7 @@ static int of_platform_mb862xx_probe(struct platform_device *ofdev) return ret; } -static int of_platform_mb862xx_remove(struct platform_device *ofdev) +static void of_platform_mb862xx_remove(struct platform_device *ofdev) { struct fb_info *fbi = dev_get_drvdata(&ofdev->dev); struct mb862xxfb_par *par = fbi->par; @@ -814,7 +814,6 @@ static int of_platform_mb862xx_remove(struct platform_device *ofdev) release_mem_region(par->res->start, res_size); framebuffer_release(fbi); - return 0; } /* @@ -838,7 +837,7 @@ static struct platform_driver of_platform_mb862xxfb_driver = { .of_match_table = of_platform_mb862xx_tbl, }, .probe = of_platform_mb862xx_probe, - .remove = of_platform_mb862xx_remove, + .remove_new = of_platform_mb862xx_remove, }; #endif From patchwork Sat Mar 18 23:54: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: 664843 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 E6C95C761AF for ; Sat, 18 Mar 2023 23:55:02 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229862AbjCRXzC (ORCPT ); Sat, 18 Mar 2023 19:55:02 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46988 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229756AbjCRXyt (ORCPT ); Sat, 18 Mar 2023 19:54: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 3BA8D1B2D1 for ; Sat, 18 Mar 2023 16:54: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 1pdgNq-0004Cx-A1; Sun, 19 Mar 2023 00:54:46 +0100 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 1pdgNp-0056bK-Mr; Sun, 19 Mar 2023 00:54:45 +0100 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1pdgNp-005zVG-40; Sun, 19 Mar 2023 00:54:45 +0100 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Helge Deller , Thomas Zimmermann , Javier Martinez Canillas Cc: linux-fbdev@vger.kernel.org, dri-devel@lists.freedesktop.org, kernel@pengutronix.de Subject: [PATCH 26/51] video: fbdev: metronomefb: Convert to platform remove callback returning void Date: Sun, 19 Mar 2023 00:54:03 +0100 Message-Id: <20230318235428.272091-27-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230318235428.272091-1-u.kleine-koenig@pengutronix.de> References: <20230318235428.272091-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1628; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=uvijOtEYTz9wJpcGd8vhuNLjoD+pwsiRbl1kBrYLVAM=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBkFk7EGYbM5itBa5puQAEeVIM7VoardxL72XpAm 4bwquxd+dGJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZBZOxAAKCRCPgPtYfRL+ TtWzB/0QyHUQPXtvJJ07xP+Cn+iIF7ye2UGjEUeV973hDvnbU1+/41KxPsYq29uC+dmDRg16Fkv uE0m/Hkm+Mo/g8ApgUcUMk0WFPX7FSCqoJAkbena/6pJV0mlDxt5pFnG2qYfSsQkRMOSTQAvXIh juwqe3+Bl7Us3UYVSv77xzbI9J5UxQ0YnMKXBu9/J4ACd1z+M1ApReTKf4x7FS7DEx9BMXno5+G HWhWBS2FHjOcjxrSiPBxls28ERO1Ofp0F9Gq2xInuJ003qnN4Sy/c6NInB6W9R0EMKtMsSKzzqG Eh1TUaXARFu6LPGsEMbJtKQPS0EKK07EE1VHsvcjYxaycWmr 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-fbdev@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-fbdev@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/video/fbdev/metronomefb.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/drivers/video/fbdev/metronomefb.c b/drivers/video/fbdev/metronomefb.c index 9fd4bb85d735..bbdbf463f0c8 100644 --- a/drivers/video/fbdev/metronomefb.c +++ b/drivers/video/fbdev/metronomefb.c @@ -744,7 +744,7 @@ static int metronomefb_probe(struct platform_device *dev) return retval; } -static int metronomefb_remove(struct platform_device *dev) +static void metronomefb_remove(struct platform_device *dev) { struct fb_info *info = platform_get_drvdata(dev); @@ -761,12 +761,11 @@ static int metronomefb_remove(struct platform_device *dev) dev_dbg(&dev->dev, "calling release\n"); framebuffer_release(info); } - return 0; } static struct platform_driver metronomefb_driver = { .probe = metronomefb_probe, - .remove = metronomefb_remove, + .remove_new = metronomefb_remove, .driver = { .name = "metronomefb", }, From patchwork Sat Mar 18 23:54: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: 664833 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 A4238C74A5B for ; Sat, 18 Mar 2023 23:55:16 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229837AbjCRXzP (ORCPT ); Sat, 18 Mar 2023 19:55:15 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47278 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229649AbjCRXy5 (ORCPT ); Sat, 18 Mar 2023 19:54: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 5A683E3B3 for ; Sat, 18 Mar 2023 16:54: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 1pdgNr-0004Dn-Jy; Sun, 19 Mar 2023 00:54:47 +0100 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 1pdgNq-0056bQ-5g; Sun, 19 Mar 2023 00:54:46 +0100 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1pdgNp-005zVJ-9i; Sun, 19 Mar 2023 00:54:45 +0100 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Helge Deller , Stephen Kitt , Daniel Thompson , Mark Brown , Sascha Hauer Cc: linux-fbdev@vger.kernel.org, dri-devel@lists.freedesktop.org, kernel@pengutronix.de Subject: [PATCH 27/51] video: fbdev: mx3fb: Convert to platform remove callback returning void Date: Sun, 19 Mar 2023 00:54:04 +0100 Message-Id: <20230318235428.272091-28-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230318235428.272091-1-u.kleine-koenig@pengutronix.de> References: <20230318235428.272091-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=VAiN0q9BdY506j8Egb/7ZXsMaPZm1ET63G9PkCRVWiY=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBkFk7FMr+/uTsn1VaSiHfPUyoJyvRdmeAXGshQL Kw84kRM78CJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZBZOxQAKCRCPgPtYfRL+ TsWrB/0d/lND4TC643e1BOkT5wiQ2M1NPjmKHTWN441R2GG32/dNvEZgoe7hs91yXRdLYtdTjMN 6GBxL6CURV72mFKDuocuKoafAilKZ8lVWBccpVEaH2Ibm8l5XdFW9w4nlXpok1NIJqim7dce6Fv H5ULG1x5irz5nHZQci6+bCkB97meenjEhm9LZTEtinx+Fk+kj5EyxaZNj4ecAv6CLfwy8QMspfh 0viPm1zutlEB9cKULMnhhtZ7zYgwzRqohJyNBwiNpRPi/NvnLxoeeVsBgGyxlDBxvavwBOaFR3w 5EzgChp1GLtkdT+dbAZXChRS1CC1nIXtBU8pIikGi5KUKLQW 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-fbdev@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-fbdev@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/video/fbdev/mx3fb.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/drivers/video/fbdev/mx3fb.c b/drivers/video/fbdev/mx3fb.c index 76771e126d0a..63c186e0364a 100644 --- a/drivers/video/fbdev/mx3fb.c +++ b/drivers/video/fbdev/mx3fb.c @@ -1616,7 +1616,7 @@ static int mx3fb_probe(struct platform_device *pdev) return ret; } -static int mx3fb_remove(struct platform_device *dev) +static void mx3fb_remove(struct platform_device *dev) { struct mx3fb_data *mx3fb = platform_get_drvdata(dev); struct fb_info *fbi = mx3fb->fbi; @@ -1632,7 +1632,6 @@ static int mx3fb_remove(struct platform_device *dev) dmaengine_put(); iounmap(mx3fb->reg_base); - return 0; } static struct platform_driver mx3fb_driver = { @@ -1640,7 +1639,7 @@ static struct platform_driver mx3fb_driver = { .name = MX3FB_NAME, }, .probe = mx3fb_probe, - .remove = mx3fb_remove, + .remove_new = mx3fb_remove, .suspend = mx3fb_suspend, .resume = mx3fb_resume, }; From patchwork Sat Mar 18 23:54: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: 665388 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 687CFC76196 for ; Sat, 18 Mar 2023 23:55:03 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229747AbjCRXzC (ORCPT ); Sat, 18 Mar 2023 19:55:02 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47004 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229579AbjCRXyt (ORCPT ); Sat, 18 Mar 2023 19:54: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 81B491C5A9 for ; Sat, 18 Mar 2023 16:54: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 1pdgNq-0004E1-TW; Sun, 19 Mar 2023 00:54:46 +0100 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 1pdgNq-0056bU-93; Sun, 19 Mar 2023 00:54:46 +0100 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1pdgNp-005zVM-GU; Sun, 19 Mar 2023 00:54:45 +0100 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Helge Deller Cc: linux-fbdev@vger.kernel.org, dri-devel@lists.freedesktop.org, kernel@pengutronix.de Subject: [PATCH 28/51] video: fbdev: ocfb: Convert to platform remove callback returning void Date: Sun, 19 Mar 2023 00:54:05 +0100 Message-Id: <20230318235428.272091-29-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230318235428.272091-1-u.kleine-koenig@pengutronix.de> References: <20230318235428.272091-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1679; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=4FMjJwr1rPhKgf5SBBUb9HyDGJHmP5Y5G10UeekMO5M=; b=owGbwMvMwMXY3/A7olbonx/jabUkhhQxv2Pz/jN/5Ww9xG7+yKyO3+nBha2eTheLlZfF5z/0n Kj34rtcJ6MxCwMjF4OsmCKLfeOaTKsqucjOtf8uwwxiZQKZwsDFKQATqfDkYJgx2b54Grt/p3O4 Wp7duikF4Q9/zQzhXR9sXufgGVIROHPh+ltP/5XwWxwSibr7/Zhlyswgh8TkotlLJFY3fOIKDpO wWFxzy/pq4uM2J8VvIdYdjZK567+ZHpoeI5OqLMRQYOJ3scl2c+XzAtP0DbNn2d/LTL/0yu/pvE dnn3S9tbjW+Z81aso/T6/S2EzbWCsdNYUq8YKUXbPOR3ku0KvqO+RpOmXz+t6W9fkObwrnTpoYv Xwui+mqD2l8Zb/mrzLliLN4tm9txis1Eamkq3nvV/58uDqzocPVbVXD4zJjhqebyhu7VSMvsZ7I PMSQHH+mR1t6Td3j9SoN0dpMdQksGesqr8+f1Dt5wvUaAA== 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-fbdev@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-fbdev@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/video/fbdev/ocfb.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/video/fbdev/ocfb.c b/drivers/video/fbdev/ocfb.c index da7e1457e58f..7ebe794583e1 100644 --- a/drivers/video/fbdev/ocfb.c +++ b/drivers/video/fbdev/ocfb.c @@ -370,7 +370,7 @@ static int ocfb_probe(struct platform_device *pdev) return ret; } -static int ocfb_remove(struct platform_device *pdev) +static void ocfb_remove(struct platform_device *pdev) { struct ocfb_dev *fbdev = platform_get_drvdata(pdev); @@ -383,8 +383,6 @@ static int ocfb_remove(struct platform_device *pdev) ocfb_writereg(fbdev, OCFB_CTRL, 0); platform_set_drvdata(pdev, NULL); - - return 0; } static const struct of_device_id ocfb_match[] = { @@ -395,7 +393,7 @@ MODULE_DEVICE_TABLE(of, ocfb_match); static struct platform_driver ocfb_driver = { .probe = ocfb_probe, - .remove = ocfb_remove, + .remove_new = ocfb_remove, .driver = { .name = "ocfb_fb", .of_match_table = ocfb_match, From patchwork Sat Mar 18 23:54: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: 665382 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 C35DEC74A5B for ; Sat, 18 Mar 2023 23:55:10 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229823AbjCRXzK (ORCPT ); Sat, 18 Mar 2023 19:55:10 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47052 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229828AbjCRXyy (ORCPT ); Sat, 18 Mar 2023 19:54: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 2E7511B572 for ; Sat, 18 Mar 2023 16:54: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 1pdgNr-0004EY-7d; Sun, 19 Mar 2023 00:54:47 +0100 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 1pdgNq-0056bc-Ii; Sun, 19 Mar 2023 00:54:46 +0100 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1pdgNp-005zVS-ND; Sun, 19 Mar 2023 00:54:45 +0100 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Helge Deller , Javier Martinez Canillas , Thomas Zimmermann , Rob Herring , Christophe Leroy Cc: linux-fbdev@vger.kernel.org, dri-devel@lists.freedesktop.org, kernel@pengutronix.de Subject: [PATCH 29/51] video: fbdev: offb: Convert to platform remove callback returning void Date: Sun, 19 Mar 2023 00:54:06 +0100 Message-Id: <20230318235428.272091-30-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230318235428.272091-1-u.kleine-koenig@pengutronix.de> References: <20230318235428.272091-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1890; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=lM7DJP3rqO/O01i5ldb/xVqYOdKBmxyQQSGfKw8fSgI=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBkFk7HbDG7Kr2qUU0J+qizBK+pgPQ7KcH2TsMhp osbez4uY/+JATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZBZOxwAKCRCPgPtYfRL+ TrnuB/9MnlaJ4CugSGFM5+KI4NSWMpbbM1hGCK6nwSZq2iHg5Wz+mrvUX5z75U3AF5MHUoLgsV6 7nadWePX8NRqxoRFtMgYqyXbYWIg6fH4FqEY/XIU6BN5gYrJioGJ2P6dHIWVv1bNQDyxlDsoUH3 owpoYXQTk4D2J//pfyEA5Ap7fbGHEDjOEWEJWzO5hU4hqLOForp54j/dLWrXR/gW3q3vv3Bh+dY xApG0gkLEv0o4ZYJ8sejtKbLaCPZ6xrRlE0xoLbZMji09u8M4Sv+nMUTydU739H8F3whNcdN0ru pdjYCCC6SrBtUNtNs0Xgg6qPz4LIIMQANjkpXKCf+J7jJEXK 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-fbdev@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-fbdev@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/video/fbdev/offb.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/drivers/video/fbdev/offb.c b/drivers/video/fbdev/offb.c index f7ad6bc9d02d..b18d8c851918 100644 --- a/drivers/video/fbdev/offb.c +++ b/drivers/video/fbdev/offb.c @@ -658,14 +658,12 @@ static void offb_init_nodriver(struct platform_device *parent, struct device_nod } } -static int offb_remove(struct platform_device *pdev) +static void offb_remove(struct platform_device *pdev) { struct fb_info *info = platform_get_drvdata(pdev); if (info) unregister_framebuffer(info); - - return 0; } static int offb_probe_bootx_noscreen(struct platform_device *pdev) @@ -680,7 +678,7 @@ static struct platform_driver offb_driver_bootx_noscreen = { .name = "bootx-noscreen", }, .probe = offb_probe_bootx_noscreen, - .remove = offb_remove, + .remove_new = offb_remove, }; static int offb_probe_display(struct platform_device *pdev) @@ -702,7 +700,7 @@ static struct platform_driver offb_driver_display = { .of_match_table = offb_of_match_display, }, .probe = offb_probe_display, - .remove = offb_remove, + .remove_new = offb_remove, }; static int __init offb_init(void) From patchwork Sat Mar 18 23:54: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: 664829 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 F30C0C77B60 for ; Sat, 18 Mar 2023 23:55:23 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229759AbjCRXzX (ORCPT ); Sat, 18 Mar 2023 19:55:23 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47644 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229838AbjCRXzN (ORCPT ); Sat, 18 Mar 2023 19:55: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 27EBB21948 for ; Sat, 18 Mar 2023 16:55:12 -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 1pdgNw-0004Eo-40; Sun, 19 Mar 2023 00:54:52 +0100 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 1pdgNq-0056bh-R5; Sun, 19 Mar 2023 00:54:46 +0100 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1pdgNp-005zVW-VN; Sun, 19 Mar 2023 00:54:45 +0100 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Helge Deller , Bartlomiej Zolnierkiewicz , Arnd Bergmann , Tony Lindgren , Jiapeng Chong , Yu Zhe , Xu Panda , Zhang Qilong , Wolfram Sang Cc: linux-fbdev@vger.kernel.org, linux-omap@vger.kernel.org, dri-devel@lists.freedesktop.org, kernel@pengutronix.de Subject: [PATCH 30/51] video: fbdev: omapfb: Convert to platform remove callback returning void Date: Sun, 19 Mar 2023 00:54:07 +0100 Message-Id: <20230318235428.272091-31-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230318235428.272091-1-u.kleine-koenig@pengutronix.de> References: <20230318235428.272091-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=11405; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=EDo1aKr//a6fSQeLgJmtFuaS5zNte07XgYOIvfwCNuE=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBkFk7If3DWRwK0CgL/5etvBVaf95/C4zJtGKLr5 c4+YmguNRCJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZBZOyAAKCRCPgPtYfRL+ Tin+B/9zMPO7MOHCK7GgHr1I396v1t6o2mfmOsIBQkwZdfGNwI/TNKQyYtQk+4Q3SzVyR4Hh7JM hX5nL7E7GXHr89gR0Dqq4+kqHuiqXklN5I7kAUoVwIM86+euJevzMqnT0e3zGct97OcN9UZqaNM QoJYWQn9K+rTuzrJyeb13dKNoYTjFXfahDu5rxovjGrciqpTD+ZH7kSK7TsPhQEf8ECHJJOp6Om 3LTfB3Pp0DltlBy1VF0UyNNMDVfMJq8I2wC15wdjv+FAUTWQL5/KCFzlst9lZe4pWxxxfKm7eMM ToTjIvJOVBlprWjuHg2dfWKg8VjvDWcpAkObAXw2iU2mKJaN 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-fbdev@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-fbdev@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/video/fbdev/omap/omapfb_main.c | 6 ++---- drivers/video/fbdev/omap2/omapfb/dss/core.c | 6 ++---- drivers/video/fbdev/omap2/omapfb/dss/dispc.c | 5 ++--- drivers/video/fbdev/omap2/omapfb/dss/dpi.c | 5 ++--- drivers/video/fbdev/omap2/omapfb/dss/dsi.c | 5 ++--- drivers/video/fbdev/omap2/omapfb/dss/dss.c | 5 ++--- drivers/video/fbdev/omap2/omapfb/dss/hdmi4.c | 5 ++--- drivers/video/fbdev/omap2/omapfb/dss/hdmi5.c | 5 ++--- drivers/video/fbdev/omap2/omapfb/dss/sdi.c | 5 ++--- drivers/video/fbdev/omap2/omapfb/dss/venc.c | 5 ++--- drivers/video/fbdev/omap2/omapfb/omapfb-main.c | 6 ++---- 11 files changed, 22 insertions(+), 36 deletions(-) diff --git a/drivers/video/fbdev/omap/omapfb_main.c b/drivers/video/fbdev/omap/omapfb_main.c index 1f3df2055ff0..764058f40341 100644 --- a/drivers/video/fbdev/omap/omapfb_main.c +++ b/drivers/video/fbdev/omap/omapfb_main.c @@ -1793,7 +1793,7 @@ void omapfb_register_panel(struct lcd_panel *panel) EXPORT_SYMBOL_GPL(omapfb_register_panel); /* Called when the device is being detached from the driver */ -static int omapfb_remove(struct platform_device *pdev) +static void omapfb_remove(struct platform_device *pdev) { struct omapfb_device *fbdev = platform_get_drvdata(pdev); enum omapfb_state saved_state = fbdev->state; @@ -1805,8 +1805,6 @@ static int omapfb_remove(struct platform_device *pdev) platform_device_unregister(&omapdss_device); fbdev->dssdev = NULL; - - return 0; } /* PM suspend */ @@ -1831,7 +1829,7 @@ static int omapfb_resume(struct platform_device *pdev) static struct platform_driver omapfb_driver = { .probe = omapfb_probe, - .remove = omapfb_remove, + .remove_new = omapfb_remove, .suspend = omapfb_suspend, .resume = omapfb_resume, .driver = { diff --git a/drivers/video/fbdev/omap2/omapfb/dss/core.c b/drivers/video/fbdev/omap2/omapfb/dss/core.c index 37858be8be83..5fbd8885bad8 100644 --- a/drivers/video/fbdev/omap2/omapfb/dss/core.c +++ b/drivers/video/fbdev/omap2/omapfb/dss/core.c @@ -171,13 +171,11 @@ static int __init omap_dss_probe(struct platform_device *pdev) return 0; } -static int omap_dss_remove(struct platform_device *pdev) +static void omap_dss_remove(struct platform_device *pdev) { unregister_pm_notifier(&omap_dss_pm_notif_block); dss_uninitialize_debugfs(); - - return 0; } static void omap_dss_shutdown(struct platform_device *pdev) @@ -187,7 +185,7 @@ static void omap_dss_shutdown(struct platform_device *pdev) } static struct platform_driver omap_dss_driver = { - .remove = omap_dss_remove, + .remove_new = omap_dss_remove, .shutdown = omap_dss_shutdown, .driver = { .name = "omapdss", diff --git a/drivers/video/fbdev/omap2/omapfb/dss/dispc.c b/drivers/video/fbdev/omap2/omapfb/dss/dispc.c index 92fb6b7e1f68..21fef9db90d2 100644 --- a/drivers/video/fbdev/omap2/omapfb/dss/dispc.c +++ b/drivers/video/fbdev/omap2/omapfb/dss/dispc.c @@ -4017,10 +4017,9 @@ static int dispc_probe(struct platform_device *pdev) return component_add(&pdev->dev, &dispc_component_ops); } -static int dispc_remove(struct platform_device *pdev) +static void dispc_remove(struct platform_device *pdev) { component_del(&pdev->dev, &dispc_component_ops); - return 0; } static int dispc_runtime_suspend(struct device *dev) @@ -4073,7 +4072,7 @@ static const struct of_device_id dispc_of_match[] = { static struct platform_driver omap_dispchw_driver = { .probe = dispc_probe, - .remove = dispc_remove, + .remove_new = dispc_remove, .driver = { .name = "omapdss_dispc", .pm = &dispc_pm_ops, diff --git a/drivers/video/fbdev/omap2/omapfb/dss/dpi.c b/drivers/video/fbdev/omap2/omapfb/dss/dpi.c index 99ce6e955a46..7c1b7d89389a 100644 --- a/drivers/video/fbdev/omap2/omapfb/dss/dpi.c +++ b/drivers/video/fbdev/omap2/omapfb/dss/dpi.c @@ -810,15 +810,14 @@ static int dpi_probe(struct platform_device *pdev) return component_add(&pdev->dev, &dpi_component_ops); } -static int dpi_remove(struct platform_device *pdev) +static void dpi_remove(struct platform_device *pdev) { component_del(&pdev->dev, &dpi_component_ops); - return 0; } static struct platform_driver omap_dpi_driver = { .probe = dpi_probe, - .remove = dpi_remove, + .remove_new = dpi_remove, .driver = { .name = "omapdss_dpi", .suppress_bind_attrs = true, diff --git a/drivers/video/fbdev/omap2/omapfb/dss/dsi.c b/drivers/video/fbdev/omap2/omapfb/dss/dsi.c index 7cddb7b8ae34..b7eb17a16ec4 100644 --- a/drivers/video/fbdev/omap2/omapfb/dss/dsi.c +++ b/drivers/video/fbdev/omap2/omapfb/dss/dsi.c @@ -5495,10 +5495,9 @@ static int dsi_probe(struct platform_device *pdev) return component_add(&pdev->dev, &dsi_component_ops); } -static int dsi_remove(struct platform_device *pdev) +static void dsi_remove(struct platform_device *pdev) { component_del(&pdev->dev, &dsi_component_ops); - return 0; } static int dsi_runtime_suspend(struct device *dev) @@ -5565,7 +5564,7 @@ static const struct of_device_id dsi_of_match[] = { static struct platform_driver omap_dsihw_driver = { .probe = dsi_probe, - .remove = dsi_remove, + .remove_new = dsi_remove, .driver = { .name = "omapdss_dsi", .pm = &dsi_pm_ops, diff --git a/drivers/video/fbdev/omap2/omapfb/dss/dss.c b/drivers/video/fbdev/omap2/omapfb/dss/dss.c index 335e0af4eec1..d814e4baa4b3 100644 --- a/drivers/video/fbdev/omap2/omapfb/dss/dss.c +++ b/drivers/video/fbdev/omap2/omapfb/dss/dss.c @@ -1224,10 +1224,9 @@ static int dss_probe(struct platform_device *pdev) return 0; } -static int dss_remove(struct platform_device *pdev) +static void dss_remove(struct platform_device *pdev) { component_master_del(&pdev->dev, &dss_component_ops); - return 0; } static int dss_runtime_suspend(struct device *dev) @@ -1279,7 +1278,7 @@ MODULE_DEVICE_TABLE(of, dss_of_match); static struct platform_driver omap_dsshw_driver = { .probe = dss_probe, - .remove = dss_remove, + .remove_new = dss_remove, .driver = { .name = "omapdss_dss", .pm = &dss_pm_ops, diff --git a/drivers/video/fbdev/omap2/omapfb/dss/hdmi4.c b/drivers/video/fbdev/omap2/omapfb/dss/hdmi4.c index 0f39612e002e..f05b4e35a842 100644 --- a/drivers/video/fbdev/omap2/omapfb/dss/hdmi4.c +++ b/drivers/video/fbdev/omap2/omapfb/dss/hdmi4.c @@ -756,10 +756,9 @@ static int hdmi4_probe(struct platform_device *pdev) return component_add(&pdev->dev, &hdmi4_component_ops); } -static int hdmi4_remove(struct platform_device *pdev) +static void hdmi4_remove(struct platform_device *pdev) { component_del(&pdev->dev, &hdmi4_component_ops); - return 0; } static int hdmi_runtime_suspend(struct device *dev) @@ -792,7 +791,7 @@ static const struct of_device_id hdmi_of_match[] = { static struct platform_driver omapdss_hdmihw_driver = { .probe = hdmi4_probe, - .remove = hdmi4_remove, + .remove_new = hdmi4_remove, .driver = { .name = "omapdss_hdmi", .pm = &hdmi_pm_ops, diff --git a/drivers/video/fbdev/omap2/omapfb/dss/hdmi5.c b/drivers/video/fbdev/omap2/omapfb/dss/hdmi5.c index bfccc2cb917a..03292945b1d4 100644 --- a/drivers/video/fbdev/omap2/omapfb/dss/hdmi5.c +++ b/drivers/video/fbdev/omap2/omapfb/dss/hdmi5.c @@ -797,10 +797,9 @@ static int hdmi5_probe(struct platform_device *pdev) return component_add(&pdev->dev, &hdmi5_component_ops); } -static int hdmi5_remove(struct platform_device *pdev) +static void hdmi5_remove(struct platform_device *pdev) { component_del(&pdev->dev, &hdmi5_component_ops); - return 0; } static int hdmi_runtime_suspend(struct device *dev) @@ -834,7 +833,7 @@ static const struct of_device_id hdmi_of_match[] = { static struct platform_driver omapdss_hdmihw_driver = { .probe = hdmi5_probe, - .remove = hdmi5_remove, + .remove_new = hdmi5_remove, .driver = { .name = "omapdss_hdmi5", .pm = &hdmi_pm_ops, diff --git a/drivers/video/fbdev/omap2/omapfb/dss/sdi.c b/drivers/video/fbdev/omap2/omapfb/dss/sdi.c index 002f07f5480f..d527931b2b16 100644 --- a/drivers/video/fbdev/omap2/omapfb/dss/sdi.c +++ b/drivers/video/fbdev/omap2/omapfb/dss/sdi.c @@ -375,15 +375,14 @@ static int sdi_probe(struct platform_device *pdev) return component_add(&pdev->dev, &sdi_component_ops); } -static int sdi_remove(struct platform_device *pdev) +static void sdi_remove(struct platform_device *pdev) { component_del(&pdev->dev, &sdi_component_ops); - return 0; } static struct platform_driver omap_sdi_driver = { .probe = sdi_probe, - .remove = sdi_remove, + .remove_new = sdi_remove, .driver = { .name = "omapdss_sdi", .suppress_bind_attrs = true, diff --git a/drivers/video/fbdev/omap2/omapfb/dss/venc.c b/drivers/video/fbdev/omap2/omapfb/dss/venc.c index 78a7309d25dd..c9d40e28a06f 100644 --- a/drivers/video/fbdev/omap2/omapfb/dss/venc.c +++ b/drivers/video/fbdev/omap2/omapfb/dss/venc.c @@ -880,10 +880,9 @@ static int venc_probe(struct platform_device *pdev) return component_add(&pdev->dev, &venc_component_ops); } -static int venc_remove(struct platform_device *pdev) +static void venc_remove(struct platform_device *pdev) { component_del(&pdev->dev, &venc_component_ops); - return 0; } static int venc_runtime_suspend(struct device *dev) @@ -922,7 +921,7 @@ static const struct of_device_id venc_of_match[] = { static struct platform_driver omap_venchw_driver = { .probe = venc_probe, - .remove = venc_remove, + .remove_new = venc_remove, .driver = { .name = "omapdss_venc", .pm = &venc_pm_ops, diff --git a/drivers/video/fbdev/omap2/omapfb/omapfb-main.c b/drivers/video/fbdev/omap2/omapfb/omapfb-main.c index 5ccddcfce722..c0538069eb48 100644 --- a/drivers/video/fbdev/omap2/omapfb/omapfb-main.c +++ b/drivers/video/fbdev/omap2/omapfb/omapfb-main.c @@ -2599,7 +2599,7 @@ static int omapfb_probe(struct platform_device *pdev) return r; } -static int omapfb_remove(struct platform_device *pdev) +static void omapfb_remove(struct platform_device *pdev) { struct omapfb2_device *fbdev = platform_get_drvdata(pdev); @@ -2610,13 +2610,11 @@ static int omapfb_remove(struct platform_device *pdev) omapfb_free_resources(fbdev); omapdss_compat_uninit(); - - return 0; } static struct platform_driver omapfb_driver = { .probe = omapfb_probe, - .remove = omapfb_remove, + .remove_new = omapfb_remove, .driver = { .name = "omapfb", }, From patchwork Sat Mar 18 23:54: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: 665387 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 8BE48C7619A for ; Sat, 18 Mar 2023 23:55:04 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229737AbjCRXzD (ORCPT ); Sat, 18 Mar 2023 19:55:03 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47040 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229759AbjCRXyu (ORCPT ); Sat, 18 Mar 2023 19:54: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 3F6C819699 for ; Sat, 18 Mar 2023 16:54: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 1pdgNr-0004F6-Ky; Sun, 19 Mar 2023 00:54:47 +0100 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 1pdgNr-0056bm-0a; Sun, 19 Mar 2023 00:54:47 +0100 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1pdgNq-005zVZ-6L; Sun, 19 Mar 2023 00:54:46 +0100 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Helge Deller Cc: linux-fbdev@vger.kernel.org, dri-devel@lists.freedesktop.org, kernel@pengutronix.de Subject: [PATCH 31/51] video: fbdev: p9100: Convert to platform remove callback returning void Date: Sun, 19 Mar 2023 00:54:08 +0100 Message-Id: <20230318235428.272091-32-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230318235428.272091-1-u.kleine-koenig@pengutronix.de> References: <20230318235428.272091-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1716; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=7EdLunVGr5suPqaCLWBHwHgA+gHggLCAuloDzn875wE=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBkFk7Jl48h8/QTTCSlYMrUz2Lr/uz4SJyzle+/y cVqLZNDkAOJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZBZOyQAKCRCPgPtYfRL+ ToszCAC0FcFwFs1f9zShRUugPSqc+zWnA55zr7ys+GouolParjElJVQvUjQnyh4ttY9PKJyq3WP 1rG6WayfHFviSERmgGr3g4TOWEoA5myu4yRo+LCdOsa+EnEdJuYsCN6hQm16dInqliCvYfC1hsG zcdwPQBk0ZD8i8tYj5HsCbOr8sbVwAg6Tnst8v1cWli6qrgWXDpstAOA2OK/kLahJRM+aGyZuyX 4H46KfchGHb6i13hNana2+VvOcwayrGJMMLjXuCIi0g8oIJNPq9Mr9Gswi4poJ491CDQtoUdv+2 Mg2vVChGPH3GmDc2OlbSYAjk7c40bfOQ13xBAxqaZFFItIPX 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-fbdev@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-fbdev@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/video/fbdev/p9100.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/video/fbdev/p9100.c b/drivers/video/fbdev/p9100.c index 4e88a0a195ad..3e44f9516318 100644 --- a/drivers/video/fbdev/p9100.c +++ b/drivers/video/fbdev/p9100.c @@ -327,7 +327,7 @@ static int p9100_probe(struct platform_device *op) return err; } -static int p9100_remove(struct platform_device *op) +static void p9100_remove(struct platform_device *op) { struct fb_info *info = dev_get_drvdata(&op->dev); struct p9100_par *par = info->par; @@ -339,8 +339,6 @@ static int p9100_remove(struct platform_device *op) of_iounmap(&op->resource[2], info->screen_base, info->fix.smem_len); framebuffer_release(info); - - return 0; } static const struct of_device_id p9100_match[] = { @@ -357,7 +355,7 @@ static struct platform_driver p9100_driver = { .of_match_table = p9100_match, }, .probe = p9100_probe, - .remove = p9100_remove, + .remove_new = p9100_remove, }; static int __init p9100_init(void) From patchwork Sat Mar 18 23:54: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: 665385 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 76EA4C76196 for ; Sat, 18 Mar 2023 23:55:07 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229787AbjCRXzG (ORCPT ); Sat, 18 Mar 2023 19:55:06 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47052 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229778AbjCRXyv (ORCPT ); Sat, 18 Mar 2023 19:54: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 A5AB31BAC4 for ; Sat, 18 Mar 2023 16:54: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 1pdgNr-0004F7-Mi; Sun, 19 Mar 2023 00:54:47 +0100 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 1pdgNr-0056bn-1O; Sun, 19 Mar 2023 00:54:47 +0100 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1pdgNq-005zVe-CQ; Sun, 19 Mar 2023 00:54:46 +0100 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Helge Deller , Christophe Leroy Cc: linux-fbdev@vger.kernel.org, dri-devel@lists.freedesktop.org, kernel@pengutronix.de Subject: [PATCH 32/51] video: fbdev: platinumfb: Convert to platform remove callback returning void Date: Sun, 19 Mar 2023 00:54:09 +0100 Message-Id: <20230318235428.272091-33-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230318235428.272091-1-u.kleine-koenig@pengutronix.de> References: <20230318235428.272091-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=xFs5j5oNwR8r6LB6Q6rIPEbRd/V5idvpJaUsiVGpD20=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBkFk7PI//j29r32MMag4edxndVYtM7Hlw86Sj8d clfODFJg8OJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZBZOzwAKCRCPgPtYfRL+ Tj3kCACI9XpnWB+SkLfh7/eIl+cd6D7d19iIDK2U0c5VX2QkilyhYly50TMF4aCHIu1T7H3rvXN BapztLINn9j7cOPe7IzOZ5Mp4oqGT9x36UY2FXZeXKxgvscvlK7NiKLXyk5mza6upXBvqBrMGbj Fz/fAv3yjGGcXse5kdQND68PIaxoApVN/fAXjp9eJu11SSnajbksLYq1+IQrYfRqQ4kGSaR8j4c BsaR1oBlVWz2xCkfJs6xOJhOqM8R3t3nM6SYMkTg17Y9wrmOZNC3WNmU7hTUhzVf7svd8KJqG5q XN6+idxn+hnzm7/dwkOW6y0oGuwHwMFgHUmHkWqAvAT/Qw7g 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-fbdev@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-fbdev@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/video/fbdev/platinumfb.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/video/fbdev/platinumfb.c b/drivers/video/fbdev/platinumfb.c index 5b9e26ea6449..82f019f0a0d6 100644 --- a/drivers/video/fbdev/platinumfb.c +++ b/drivers/video/fbdev/platinumfb.c @@ -636,7 +636,7 @@ static int platinumfb_probe(struct platform_device* odev) return rc; } -static int platinumfb_remove(struct platform_device* odev) +static void platinumfb_remove(struct platform_device* odev) { struct fb_info *info = dev_get_drvdata(&odev->dev); struct fb_info_platinum *pinfo = info->par; @@ -654,8 +654,6 @@ static int platinumfb_remove(struct platform_device* odev) release_mem_region(pinfo->cmap_regs_phys, 0x1000); framebuffer_release(info); - - return 0; } static struct of_device_id platinumfb_match[] = @@ -673,7 +671,7 @@ static struct platform_driver platinum_driver = .of_match_table = platinumfb_match, }, .probe = platinumfb_probe, - .remove = platinumfb_remove, + .remove_new = platinumfb_remove, }; static int __init platinumfb_init(void) From patchwork Sat Mar 18 23:54: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: 665386 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 9026FC761AF for ; Sat, 18 Mar 2023 23:55:06 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229602AbjCRXzF (ORCPT ); Sat, 18 Mar 2023 19:55:05 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46996 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229774AbjCRXyv (ORCPT ); Sat, 18 Mar 2023 19:54: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 08D1D1F497 for ; Sat, 18 Mar 2023 16:54: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 1pdgNr-0004FO-VP; Sun, 19 Mar 2023 00:54:48 +0100 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 1pdgNr-0056bv-Bq; Sun, 19 Mar 2023 00:54:47 +0100 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1pdgNq-005zVh-Iy; Sun, 19 Mar 2023 00:54:46 +0100 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Helge Deller , Wolfram Sang Cc: linux-fbdev@vger.kernel.org, dri-devel@lists.freedesktop.org, kernel@pengutronix.de Subject: [PATCH 33/51] video: fbdev: pxa168fb: Convert to platform remove callback returning void Date: Sun, 19 Mar 2023 00:54:10 +0100 Message-Id: <20230318235428.272091-34-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230318235428.272091-1-u.kleine-koenig@pengutronix.de> References: <20230318235428.272091-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1868; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=vtff1YefPu16NIx7dfVejF36q3zG5SnLBInX8ldImOs=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBkFk7RiHQCL/mfO4Uhk1pOkAIxroI93+mC9yGuy SjBmF+Qet+JATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZBZO0QAKCRCPgPtYfRL+ Tm/dCACSmTtjFVNGYLu1dxuifhRFrfB7RHjDelFsTf20alfmilPv5NMOEW0RZsoByVMSAIstNF4 1HwMhnDY2wc2mqMWMoXSj5sGLpxj0jmRJC1eg+xTFywtykNB+d9HCiyIvg9Tb2t3yEkZGAkJWPX 1uftjc+DeDu+/E/BJK1eGIVNGyYAXz12QyEdQe5HYKcHafICzBwlTLvbNnatDhRx84AXCgyf4/C QuqBT2dQQM1fo0rBA+bdLTMw6X34da+PoZhqL+QQg2MRSUXdqf3gZ/R7l+XjJGEhLaGpz3+yeJg YYtdzCcHYTsG9lDquN+GDJclNnagJaQhBQozyLEnSY4jK5cA 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-fbdev@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-fbdev@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/video/fbdev/pxa168fb.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/drivers/video/fbdev/pxa168fb.c b/drivers/video/fbdev/pxa168fb.c index d5d0bbd39213..79f338463092 100644 --- a/drivers/video/fbdev/pxa168fb.c +++ b/drivers/video/fbdev/pxa168fb.c @@ -765,14 +765,14 @@ static int pxa168fb_probe(struct platform_device *pdev) return ret; } -static int pxa168fb_remove(struct platform_device *pdev) +static void pxa168fb_remove(struct platform_device *pdev) { struct pxa168fb_info *fbi = platform_get_drvdata(pdev); struct fb_info *info; unsigned int data; if (!fbi) - return 0; + return; /* disable DMA transfer */ data = readl(fbi->reg_base + LCD_SPU_DMA_CTRL0); @@ -794,8 +794,6 @@ static int pxa168fb_remove(struct platform_device *pdev) clk_disable_unprepare(fbi->clk); framebuffer_release(info); - - return 0; } static struct platform_driver pxa168fb_driver = { @@ -803,7 +801,7 @@ static struct platform_driver pxa168fb_driver = { .name = "pxa168-fb", }, .probe = pxa168fb_probe, - .remove = pxa168fb_remove, + .remove_new = pxa168fb_remove, }; module_platform_driver(pxa168fb_driver); From patchwork Sat Mar 18 23:54: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: 664839 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 B9B3AC77B61 for ; Sat, 18 Mar 2023 23:55:07 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229756AbjCRXzH (ORCPT ); Sat, 18 Mar 2023 19:55:07 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47068 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229788AbjCRXyw (ORCPT ); Sat, 18 Mar 2023 19:54: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 5F93920563 for ; Sat, 18 Mar 2023 16:54: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 1pdgNs-0004Fq-4J; Sun, 19 Mar 2023 00:54:48 +0100 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 1pdgNr-0056bz-Gh; Sun, 19 Mar 2023 00:54:47 +0100 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1pdgNq-005zVl-PM; Sun, 19 Mar 2023 00:54:46 +0100 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Helge Deller , Hyunwoo Kim , Yang Yingliang Cc: linux-fbdev@vger.kernel.org, dri-devel@lists.freedesktop.org, kernel@pengutronix.de Subject: [PATCH 34/51] video: fbdev: pxa3xx-gcu: Convert to platform remove callback returning void Date: Sun, 19 Mar 2023 00:54:11 +0100 Message-Id: <20230318235428.272091-35-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230318235428.272091-1-u.kleine-koenig@pengutronix.de> References: <20230318235428.272091-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1870; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=JKZ6IR3L4a2OLi88lDwQKr+g94Zq3ULQOY7FNOxmM6k=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBkFk7SqKxd9OSiw2r2mgOM6kB6pXEOTBKefwZFB qJ0blCG4DGJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZBZO0gAKCRCPgPtYfRL+ TuKYB/sHCEAh6G/pHcfbnMaftJih/j0NrF+Qlm2SELDE0dmuJYOKfLvYYPwPnQaTYXhOcWKmBZZ ce5A1BBZ23ECINY+hDxCu9H5o8PmgHmUVOTjOoBfHPNZ4fAJ3dcX/sL4+cQkxEkr5fELFXgHjP9 xvTy8TcF65wMMzE4iYhBIuDv1qwlXjItNK9iiGbSaYLZB6FHnfvXO1K65ZTYw7ANRs2IExI/J1R 4NW+fC2JTtKXxGj/f6BOVHdGA1p5//OR+srn7V2oDoY/BzhRXIoSsSe95lfYR5UWa8qYWahm0KO mTJgrq87pdtSTwBVv9hdf8ITak/s0fpDcenjF/eVuoWy18AQ 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-fbdev@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-fbdev@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/video/fbdev/pxa3xx-gcu.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/video/fbdev/pxa3xx-gcu.c b/drivers/video/fbdev/pxa3xx-gcu.c index c3cd1e1cc01b..2b6ec8c66074 100644 --- a/drivers/video/fbdev/pxa3xx-gcu.c +++ b/drivers/video/fbdev/pxa3xx-gcu.c @@ -676,7 +676,7 @@ static int pxa3xx_gcu_probe(struct platform_device *pdev) return ret; } -static int pxa3xx_gcu_remove(struct platform_device *pdev) +static void pxa3xx_gcu_remove(struct platform_device *pdev) { struct pxa3xx_gcu_priv *priv = platform_get_drvdata(pdev); struct device *dev = &pdev->dev; @@ -686,8 +686,6 @@ static int pxa3xx_gcu_remove(struct platform_device *pdev) dma_free_coherent(dev, SHARED_SIZE, priv->shared, priv->shared_phys); clk_disable_unprepare(priv->clk); pxa3xx_gcu_free_buffers(dev, priv); - - return 0; } #ifdef CONFIG_OF @@ -700,7 +698,7 @@ MODULE_DEVICE_TABLE(of, pxa3xx_gcu_of_match); static struct platform_driver pxa3xx_gcu_driver = { .probe = pxa3xx_gcu_probe, - .remove = pxa3xx_gcu_remove, + .remove_new = pxa3xx_gcu_remove, .driver = { .name = DRV_NAME, .of_match_table = of_match_ptr(pxa3xx_gcu_of_match), From patchwork Sat Mar 18 23:54: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: 664830 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 7EFCCC761AF for ; Sat, 18 Mar 2023 23:55:23 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229738AbjCRXzW (ORCPT ); Sat, 18 Mar 2023 19:55:22 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47446 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229759AbjCRXzE (ORCPT ); Sat, 18 Mar 2023 19:55: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 886C0E3B3 for ; Sat, 18 Mar 2023 16:55: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 1pdgNu-0004G2-Tv; Sun, 19 Mar 2023 00:54:50 +0100 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 1pdgNr-0056c1-IR; Sun, 19 Mar 2023 00:54:47 +0100 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1pdgNq-005zVp-Va; Sun, 19 Mar 2023 00:54:46 +0100 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Helge Deller , Arnd Bergmann , Robert Jarzmik , Bartlomiej Zolnierkiewicz , Ulf Hansson , "wangkailong@jari.cn" , Wang Qing , Wolfram Sang Cc: linux-fbdev@vger.kernel.org, dri-devel@lists.freedesktop.org, kernel@pengutronix.de Subject: [PATCH 35/51] video: fbdev: pxafb: Convert to platform remove callback returning void Date: Sun, 19 Mar 2023 00:54:12 +0100 Message-Id: <20230318235428.272091-36-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230318235428.272091-1-u.kleine-koenig@pengutronix.de> References: <20230318235428.272091-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=ToKPvkcSVf7gwcqVnlkd+MPP/Yk+TeDi0dFi139xI6U=; b=owGbwMvMwMXY3/A7olbonx/jabUkhhQxvxsMbdG9e5gmVZmvC7oTXjC/IPDFhgPR8dcPHsn/p pXMnrahk9GYhYGRi0FWTJHFvnFNplWVXGTn2n+XYQaxMoFN4eIUgImo/2b/K3jx9YrlXfE7Dri3 lD6sKtzXdaYh9Y931Oail4Im/kf3zWGWD7kU2e4Y2XGJ4eblx0FvAg4zreewF93uUX/zR9bldd/ 3tultFr/ZL7OnbuItlpjiu7rHlHe8fKAevmFipZBFQ5eGpbzBgQbOYuP02P365edMvZteb/NJmX f9yb1eC4aUvpuMm9gML3g72Predd/cURL3QWbrLKMMFr17WknBEccU5eMfzFWcavwhNmTX+e7d5 pZ5z19/3hcxuWf/1qRrh1gni3reNpM3qK1jENfW4PiY/nSJhpXof6clly4dO5N19bQAy3PTIztX vJ4YU3h9g0eZib3kuwb1uxfe2kYHy910KlM3ene5Tt0RAA== 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-fbdev@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-fbdev@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/video/fbdev/pxafb.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/drivers/video/fbdev/pxafb.c b/drivers/video/fbdev/pxafb.c index c46ed78298ae..2a8b1dea3a67 100644 --- a/drivers/video/fbdev/pxafb.c +++ b/drivers/video/fbdev/pxafb.c @@ -2396,13 +2396,13 @@ static int pxafb_probe(struct platform_device *dev) return ret; } -static int pxafb_remove(struct platform_device *dev) +static void pxafb_remove(struct platform_device *dev) { struct pxafb_info *fbi = platform_get_drvdata(dev); struct fb_info *info; if (!fbi) - return 0; + return; info = &fbi->fb; @@ -2418,8 +2418,6 @@ static int pxafb_remove(struct platform_device *dev) dma_free_coherent(&dev->dev, fbi->dma_buff_size, fbi->dma_buff, fbi->dma_buff_phys); - - return 0; } static const struct of_device_id pxafb_of_dev_id[] = { @@ -2432,7 +2430,7 @@ MODULE_DEVICE_TABLE(of, pxafb_of_dev_id); static struct platform_driver pxafb_driver = { .probe = pxafb_probe, - .remove = pxafb_remove, + .remove_new = pxafb_remove, .driver = { .name = "pxa2xx-fb", .of_match_table = pxafb_of_dev_id, From patchwork Sat Mar 18 23:54: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: 664841 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 7948FC7618A for ; Sat, 18 Mar 2023 23:55:05 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229762AbjCRXzE (ORCPT ); Sat, 18 Mar 2023 19:55:04 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46988 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229602AbjCRXyw (ORCPT ); Sat, 18 Mar 2023 19:54: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 5F9D520575 for ; Sat, 18 Mar 2023 16:54: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 1pdgNs-0004GN-Ed; Sun, 19 Mar 2023 00:54:48 +0100 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 1pdgNr-0056c9-RV; Sun, 19 Mar 2023 00:54:47 +0100 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1pdgNr-005zVu-7c; Sun, 19 Mar 2023 00:54:47 +0100 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Kristoffer Ericson , Helge Deller Cc: linux-fbdev@vger.kernel.org, dri-devel@lists.freedesktop.org, kernel@pengutronix.de Subject: [PATCH 36/51] video: fbdev: s1d13xxxfb: Convert to platform remove callback returning void Date: Sun, 19 Mar 2023 00:54:13 +0100 Message-Id: <20230318235428.272091-37-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230318235428.272091-1-u.kleine-koenig@pengutronix.de> References: <20230318235428.272091-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1734; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=n0I3VdLYw621CybXUzty9yTbWQ3cM5Ojb62GtHF+q98=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBkFk7e52rtSyMCY3ySsXTK4eetEMWnq0tEqG9hd p3dHIL/ACeJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZBZO3gAKCRCPgPtYfRL+ Tn5gCACbK+2dXtVykxEI781AggALjrZgp7oHHYaWL/JCtdR5zYS+3bHfyi+WED9jIEbIdqDGVSq 0E9ZxvjUCvjKz8UCmmFBu+UQNWSL1kk4n5JtzwyGIHwwPyRR4iGBkrB6TeRzvWPg/65yBGhInb6 EhRiouSUbZzdf/VRD4x0QgsIvdRzZ6LjQUhemawfpcxVyx+QTU/YvbsMztIG7TKROHMZbHy8m9v HLQ64wqnWP43djxaoEViFVi2iQWeCtBoD9rWe83oplAz0SzvMk3E8C8GF4jS79b2A5Ufkby4a4H HeHeG1mcu9PvApj6/ir+9ZWmVhUg+eUboTuzhIJOGuiTGZeB 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-fbdev@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-fbdev@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/video/fbdev/s1d13xxxfb.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/drivers/video/fbdev/s1d13xxxfb.c b/drivers/video/fbdev/s1d13xxxfb.c index d1b5f965bc96..8f2edccdba46 100644 --- a/drivers/video/fbdev/s1d13xxxfb.c +++ b/drivers/video/fbdev/s1d13xxxfb.c @@ -748,13 +748,12 @@ static void __s1d13xxxfb_remove(struct platform_device *pdev) resource_size(&pdev->resource[1])); } -static int s1d13xxxfb_remove(struct platform_device *pdev) +static void s1d13xxxfb_remove(struct platform_device *pdev) { struct fb_info *info = platform_get_drvdata(pdev); unregister_framebuffer(info); __s1d13xxxfb_remove(pdev); - return 0; } static int s1d13xxxfb_probe(struct platform_device *pdev) @@ -995,7 +994,7 @@ static int s1d13xxxfb_resume(struct platform_device *dev) static struct platform_driver s1d13xxxfb_driver = { .probe = s1d13xxxfb_probe, - .remove = s1d13xxxfb_remove, + .remove_new = s1d13xxxfb_remove, #ifdef CONFIG_PM .suspend = s1d13xxxfb_suspend, .resume = s1d13xxxfb_resume, From patchwork Sat Mar 18 23:54: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: 664840 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 DD4F6C74A5B for ; Sat, 18 Mar 2023 23:55:06 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229774AbjCRXzF (ORCPT ); Sat, 18 Mar 2023 19:55:05 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47004 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229787AbjCRXyw (ORCPT ); Sat, 18 Mar 2023 19:54: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 16D5D1BAF4 for ; Sat, 18 Mar 2023 16:54: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 1pdgNs-0004Gl-Nl; Sun, 19 Mar 2023 00:54:48 +0100 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 1pdgNs-0056cE-2Z; Sun, 19 Mar 2023 00:54:48 +0100 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1pdgNr-005zVx-Dc; Sun, 19 Mar 2023 00:54:47 +0100 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Jingoo Han , Helge Deller Cc: linux-fbdev@vger.kernel.org, dri-devel@lists.freedesktop.org, kernel@pengutronix.de Subject: [PATCH 37/51] video: fbdev: s3c-fb: Convert to platform remove callback returning void Date: Sun, 19 Mar 2023 00:54:14 +0100 Message-Id: <20230318235428.272091-38-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230318235428.272091-1-u.kleine-koenig@pengutronix.de> References: <20230318235428.272091-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=L29246n3Jv2SuX2z1AMDhD3Eew8ijD0WfJx2GUf1uHk=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBkFk7kEVe42SWQ6pTwjfT2XzZJl8GEkCQFWI7Yl IIhvbdy0iCJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZBZO5AAKCRCPgPtYfRL+ TrhKCACChKccrVvH1X9xLQ+FDXoGOlAbGpPcngyPnhDHAR4QonhjZmxaJ5a9f2sjrQjtZ/pnwHQ 5qwNyhyIenHpiqkvxt9TzpZscdSBq1eSnV0tB6II9aLYcJLwJsa7EMZikYGwIT04PqmKFkI6yog xM+iyrCr2nyfAbda4EokiTso3U+J0fzjXxohbITqUujyKcUba68NjqvLvO/3cL4LQ2sTst1oZfm kAp4u2e0hyrtJkIatElodHD3Lq/uYvtLqGupUHuI+jvlJN5Fe63rokNpX+8UqZSXoWNM9XHtD9w yD+fH6sCd3Peo+iZkIpUElthjjURtACwlNSxVn50ibeeD14m 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-fbdev@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-fbdev@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/video/fbdev/s3c-fb.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/video/fbdev/s3c-fb.c b/drivers/video/fbdev/s3c-fb.c index 3abbc5737c3b..1ce707e4cfd0 100644 --- a/drivers/video/fbdev/s3c-fb.c +++ b/drivers/video/fbdev/s3c-fb.c @@ -1507,7 +1507,7 @@ static int s3c_fb_probe(struct platform_device *pdev) * Shutdown and then release all the resources that the driver allocated * on initialisation. */ -static int s3c_fb_remove(struct platform_device *pdev) +static void s3c_fb_remove(struct platform_device *pdev) { struct s3c_fb *sfb = platform_get_drvdata(pdev); int win; @@ -1525,8 +1525,6 @@ static int s3c_fb_remove(struct platform_device *pdev) pm_runtime_put_sync(sfb->dev); pm_runtime_disable(sfb->dev); - - return 0; } #ifdef CONFIG_PM_SLEEP @@ -1794,7 +1792,7 @@ static const struct dev_pm_ops s3cfb_pm_ops = { static struct platform_driver s3c_fb_driver = { .probe = s3c_fb_probe, - .remove = s3c_fb_remove, + .remove_new = s3c_fb_remove, .id_table = s3c_fb_driver_ids, .driver = { .name = "s3c-fb", From patchwork Sat Mar 18 23:54: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: 664838 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 160D5C7618A for ; Sat, 18 Mar 2023 23:55:09 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229778AbjCRXzI (ORCPT ); Sat, 18 Mar 2023 19:55:08 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47040 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229808AbjCRXyx (ORCPT ); Sat, 18 Mar 2023 19:54: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 179041C304 for ; Sat, 18 Mar 2023 16:54: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 1pdgNt-0004H7-3T; Sun, 19 Mar 2023 00:54:49 +0100 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 1pdgNs-0056cK-El; Sun, 19 Mar 2023 00:54:48 +0100 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1pdgNr-005zW2-K5; Sun, 19 Mar 2023 00:54:47 +0100 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Helge Deller Cc: linux-fbdev@vger.kernel.org, dri-devel@lists.freedesktop.org, kernel@pengutronix.de Subject: [PATCH 38/51] video: fbdev: sh7760fb: Convert to platform remove callback returning void Date: Sun, 19 Mar 2023 00:54:15 +0100 Message-Id: <20230318235428.272091-39-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230318235428.272091-1-u.kleine-koenig@pengutronix.de> References: <20230318235428.272091-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1793; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=XznMwAdgwwk+HnRVAZt9IgzfQjXJQ2pDe2f7YYLAumY=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBkFk7qUqUstzWfc26Xmtt+3hAjCmUp0ta8LtRb9 WV5iaCLUDaJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZBZO6gAKCRCPgPtYfRL+ TiR3B/wKrldHvDlKHRwCTsPLTLqcG9kTUxwbVIs8v0unagjU7VW/oxcCMb24dhkGmQjAYusWgqt JEvkyyv1QAJgzRlF+pKNLRi3cXaH4ku0NTlr8u2UY90u8UnGotnjYU2QthgfXZCrdefgWKvOzmY t7xBVJ3r8CUGSQlSw/94XYoUQmQXhwpju4tISK4ZUQe9B5q+WEQMPytq+iY8JfD1+QTKh2nE1Zl TkV+84HJl7f85oPNYCCKWVjWzwqIHjbKqCO3Ij8oR1HTdA09UROgCcp45hrFexAMmc99YNks3zM gsJd+wTpdhvPmzqLKdKc4A6TA8MNpul+3n+IOHrMvsXRPUKi 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-fbdev@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-fbdev@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/video/fbdev/sh7760fb.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/video/fbdev/sh7760fb.c b/drivers/video/fbdev/sh7760fb.c index 5978a8921232..768011bdb430 100644 --- a/drivers/video/fbdev/sh7760fb.c +++ b/drivers/video/fbdev/sh7760fb.c @@ -554,7 +554,7 @@ static int sh7760fb_probe(struct platform_device *pdev) return ret; } -static int sh7760fb_remove(struct platform_device *dev) +static void sh7760fb_remove(struct platform_device *dev) { struct fb_info *info = platform_get_drvdata(dev); struct sh7760fb_par *par = info->par; @@ -568,8 +568,6 @@ static int sh7760fb_remove(struct platform_device *dev) iounmap(par->base); release_mem_region(par->ioarea->start, resource_size(par->ioarea)); framebuffer_release(info); - - return 0; } static struct platform_driver sh7760_lcdc_driver = { @@ -577,7 +575,7 @@ static struct platform_driver sh7760_lcdc_driver = { .name = "sh7760-lcdc", }, .probe = sh7760fb_probe, - .remove = sh7760fb_remove, + .remove_new = sh7760fb_remove, }; module_platform_driver(sh7760_lcdc_driver); From patchwork Sat Mar 18 23:54: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: 664831 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 43673C7618A for ; Sat, 18 Mar 2023 23:55:22 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229504AbjCRXzV (ORCPT ); Sat, 18 Mar 2023 19:55:21 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47374 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229724AbjCRXzB (ORCPT ); Sat, 18 Mar 2023 19:55: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 01890199F5 for ; Sat, 18 Mar 2023 16:55: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 1pdgNw-0004ID-Cz; Sun, 19 Mar 2023 00:54:52 +0100 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 1pdgNs-0056cV-Vp; Sun, 19 Mar 2023 00:54:48 +0100 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1pdgNr-005zW6-Pl; Sun, 19 Mar 2023 00:54:47 +0100 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Helge Deller , Thomas Zimmermann , Javier Martinez Canillas , ye xingchen , Geert Uytterhoeven Cc: linux-fbdev@vger.kernel.org, dri-devel@lists.freedesktop.org, kernel@pengutronix.de Subject: [PATCH 39/51] video: fbdev: sh_mobile_lcdcfb: Convert to platform remove callback returning void Date: Sun, 19 Mar 2023 00:54:16 +0100 Message-Id: <20230318235428.272091-40-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230318235428.272091-1-u.kleine-koenig@pengutronix.de> References: <20230318235428.272091-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1877; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=Uk8zrXZDmXbzyStZ+kshHTWd8FUKrWiM95JoTdmi+3w=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBkFk7wBBp/HH8fg17lt1aisI/hsfE5tcfPKhfc4 T3o+1XlrRuJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZBZO8AAKCRCPgPtYfRL+ TpdVB/95m2SaljzaQ78AbBFywolqhGgc3kJolLHJRtqdzcIAZQIzFoKxddpWb2ZxUrodDTm9jwv SKfFtQtQDttaGJAkq1OyRdbjAvbyzZcqOxM1SglGE2rt9tXt9jN0JslGj+EEdKzq5L/0Ot0vIPF 511xBTFfoyhXvluU9G1Ypid999/jQknMiiObBNGJkL4j4EPWAXu3KpWUuXXOHNZieXYdNUj704f y4QwAj+dPKFDVcnf2pjLEJ3eRKDI/OmIrM3tkmux6fAykLIHqbDt7QZ0u+hRTXusDcdab1hbqOi LDrKNkHoOBb1Y0via0CpZRjN0lG9KdQRGoPqil7vAlhzmL8f 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-fbdev@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-fbdev@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/video/fbdev/sh_mobile_lcdcfb.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/drivers/video/fbdev/sh_mobile_lcdcfb.c b/drivers/video/fbdev/sh_mobile_lcdcfb.c index ad9323ed8e2e..093f035d1246 100644 --- a/drivers/video/fbdev/sh_mobile_lcdcfb.c +++ b/drivers/video/fbdev/sh_mobile_lcdcfb.c @@ -2249,7 +2249,7 @@ static const struct fb_videomode default_720p = { .sync = FB_SYNC_VERT_HIGH_ACT | FB_SYNC_HOR_HIGH_ACT, }; -static int sh_mobile_lcdc_remove(struct platform_device *pdev) +static void sh_mobile_lcdc_remove(struct platform_device *pdev) { struct sh_mobile_lcdc_priv *priv = platform_get_drvdata(pdev); unsigned int i; @@ -2305,7 +2305,6 @@ static int sh_mobile_lcdc_remove(struct platform_device *pdev) if (priv->irq) free_irq(priv->irq, priv); kfree(priv); - return 0; } static int sh_mobile_lcdc_check_interface(struct sh_mobile_lcdc_chan *ch) @@ -2656,7 +2655,7 @@ static struct platform_driver sh_mobile_lcdc_driver = { .pm = &sh_mobile_lcdc_dev_pm_ops, }, .probe = sh_mobile_lcdc_probe, - .remove = sh_mobile_lcdc_remove, + .remove_new = sh_mobile_lcdc_remove, }; module_platform_driver(sh_mobile_lcdc_driver); From patchwork Sat Mar 18 23:54: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: 665383 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 95E11C761AF for ; Sat, 18 Mar 2023 23:55:09 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229782AbjCRXzJ (ORCPT ); Sat, 18 Mar 2023 19:55:09 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46992 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229816AbjCRXyx (ORCPT ); Sat, 18 Mar 2023 19:54: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 8B5A31B2D1 for ; Sat, 18 Mar 2023 16:54: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 1pdgNt-0004I0-D9; Sun, 19 Mar 2023 00:54:49 +0100 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 1pdgNs-0056cQ-PI; Sun, 19 Mar 2023 00:54:48 +0100 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1pdgNs-005zWB-0D; Sun, 19 Mar 2023 00:54:48 +0100 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Hans de Goede , Helge Deller Cc: linux-fbdev@vger.kernel.org, dri-devel@lists.freedesktop.org, kernel@pengutronix.de Subject: [PATCH 40/51] video: fbdev: simplefb: Convert to platform remove callback returning void Date: Sun, 19 Mar 2023 00:54:17 +0100 Message-Id: <20230318235428.272091-41-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230318235428.272091-1-u.kleine-koenig@pengutronix.de> References: <20230318235428.272091-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1650; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=b4b607FxowyUjUELxWtsjxaitDLIUEa06hb9gkP9mSc=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBkFk73LG2ivyBvUeI2TvBAPWqclWkuHiP0FKaha +PCXHaV0mOJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZBZO9wAKCRCPgPtYfRL+ Tr4RB/4kuWaOWK8zWzpwc1wWDQyXDpl5AXJv4IVIPon5Cx/RIfusbmTZNsEe9l6H6+sH0zMcvjl 73SoDz42U7bEwhJk1A2EGlYzXbbUpViaEZeXJMmB1+3MyZv6Jn8wcOmgtBh7KIX1l2tTjE0vnX3 B38YGR37Q0E0Noe5Hp5EdYh2GI+p3in8R1OnItxsT769rhCZqL07fDH/kT6o3SAG4j9m238jddq 6Ew3lwjr7jyo9CBuGKvhN8WcjYf2GmavccPTih7sRPvaXzGDFe21xo8CsobuqAFuZiXPKpAIGNP he9t/CEadssTabS21ncaw4Q/6mca5HlhOuhkeCuEyYEKaFhY 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-fbdev@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-fbdev@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/video/fbdev/simplefb.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/video/fbdev/simplefb.c b/drivers/video/fbdev/simplefb.c index 10d71879d340..e4a13871bca6 100644 --- a/drivers/video/fbdev/simplefb.c +++ b/drivers/video/fbdev/simplefb.c @@ -538,14 +538,12 @@ static int simplefb_probe(struct platform_device *pdev) return ret; } -static int simplefb_remove(struct platform_device *pdev) +static void simplefb_remove(struct platform_device *pdev) { struct fb_info *info = platform_get_drvdata(pdev); /* simplefb_destroy takes care of info cleanup */ unregister_framebuffer(info); - - return 0; } static const struct of_device_id simplefb_of_match[] = { @@ -560,7 +558,7 @@ static struct platform_driver simplefb_driver = { .of_match_table = simplefb_of_match, }, .probe = simplefb_probe, - .remove = simplefb_remove, + .remove_new = simplefb_remove, }; module_platform_driver(simplefb_driver); From patchwork Sat Mar 18 23:54: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: 664837 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 610FEC76196 for ; Sat, 18 Mar 2023 23:55:10 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229808AbjCRXzJ (ORCPT ); Sat, 18 Mar 2023 19:55:09 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47004 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229823AbjCRXyx (ORCPT ); Sat, 18 Mar 2023 19:54: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 D163A19699 for ; Sat, 18 Mar 2023 16:54: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 1pdgNt-0004Ie-SC; Sun, 19 Mar 2023 00:54:49 +0100 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 1pdgNt-0056ca-75; Sun, 19 Mar 2023 00:54:49 +0100 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1pdgNs-005zWF-8K; Sun, 19 Mar 2023 00:54:48 +0100 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Helge Deller , Wolfram Sang , Xuezhi Zhang Cc: linux-fbdev@vger.kernel.org, dri-devel@lists.freedesktop.org, kernel@pengutronix.de Subject: [PATCH 41/51] video: fbdev: sm501fb: Convert to platform remove callback returning void Date: Sun, 19 Mar 2023 00:54:18 +0100 Message-Id: <20230318235428.272091-42-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230318235428.272091-1-u.kleine-koenig@pengutronix.de> References: <20230318235428.272091-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=pDC/vxi7M1WVeJfw3LTq5g2jhyRxYY/G5blZT2oqmX8=; b=owGbwMvMwMXY3/A7olbonx/jabUkhhQxv79y5syMy5wkpDy5/SbLRulwpW04NWeTzc6/hv4u9 5aYFzh3MhqzMDByMciKKbLYN67JtKqSi+xc++8yzCBWJpApDFycAjCRXTrs/0ynBstZPLH4bRkx ydC6JytxMidPpaNY24rs/MSpX+ds1kndN/eL8nNuW9FJ6g2WySqpv9t+2S2Jdlz2POPpj2uMLE7 pjVEbzj4rPb1tqcoluV2xy1gfa21TWnb/mUT74oxt/1xaEyU5O6r1HNmXJMcn7jxQe7BoQcbXN7 HWcz48mRF4hX9vYyFXyufAh4vPn7V7Jplm9T4kkaHVdNd5u4gs39AfP83ObuOZXSEXNP1YstZ/T QffJ+5XzI7cOVnL12B3tDL91RFhX/OruxLCxP/f22osxqToqVJ1YHbWIn3uydtO2ydvzLe+fqRP 43z+Io+gNPczFrH7N7OafdaX/r2pc6Vn/DNxRsmrer1TAA== 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-fbdev@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-fbdev@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/video/fbdev/sm501fb.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/video/fbdev/sm501fb.c b/drivers/video/fbdev/sm501fb.c index f743bfbde2a6..9a95c21203ce 100644 --- a/drivers/video/fbdev/sm501fb.c +++ b/drivers/video/fbdev/sm501fb.c @@ -2045,7 +2045,7 @@ static int sm501fb_probe(struct platform_device *pdev) /* * Cleanup */ -static int sm501fb_remove(struct platform_device *pdev) +static void sm501fb_remove(struct platform_device *pdev) { struct sm501fb_info *info = platform_get_drvdata(pdev); struct fb_info *fbinfo_crt = info->fb[0]; @@ -2064,8 +2064,6 @@ static int sm501fb_remove(struct platform_device *pdev) framebuffer_release(fbinfo_pnl); framebuffer_release(fbinfo_crt); - - return 0; } #ifdef CONFIG_PM @@ -2209,7 +2207,7 @@ static int sm501fb_resume(struct platform_device *pdev) static struct platform_driver sm501fb_driver = { .probe = sm501fb_probe, - .remove = sm501fb_remove, + .remove_new = sm501fb_remove, .suspend = sm501fb_suspend, .resume = sm501fb_resume, .driver = { From patchwork Sat Mar 18 23:54: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: 664836 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 99556C761A6 for ; Sat, 18 Mar 2023 23:55:11 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229524AbjCRXzK (ORCPT ); Sat, 18 Mar 2023 19:55:10 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47068 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229832AbjCRXyy (ORCPT ); Sat, 18 Mar 2023 19:54: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 3BF321BAC4 for ; Sat, 18 Mar 2023 16:54: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 1pdgNu-0004KH-FZ; Sun, 19 Mar 2023 00:54:50 +0100 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 1pdgNt-0056cj-Hf; Sun, 19 Mar 2023 00:54:49 +0100 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1pdgNs-005zWI-EN; Sun, 19 Mar 2023 00:54:48 +0100 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Helge Deller , Wolfram Sang Cc: linux-fbdev@vger.kernel.org, dri-devel@lists.freedesktop.org, kernel@pengutronix.de Subject: [PATCH 42/51] video: fbdev: tcx: Convert to platform remove callback returning void Date: Sun, 19 Mar 2023 00:54:19 +0100 Message-Id: <20230318235428.272091-43-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230318235428.272091-1-u.kleine-koenig@pengutronix.de> References: <20230318235428.272091-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1644; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=5xWiQY/5bER2ZivM6AFLT96N4ugAZFFWdMFQKD74Y+A=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBkFk8DernaueoXw+RlfEYV8ABQTWbofG44K/Qwt BuE2CUawjqJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZBZPAwAKCRCPgPtYfRL+ TqkmB/9y+S/tGTseOiuL7qnohW3hsm2KXw4nu/0t57OK6r/bhdqQAyadXqjsujYgyUfQHkcsVGn OI5OGRrYRZnwSaT4pKBjMSPdsny+z+JsXWSVZbnLHAsIhp/GutpRPEfUWoBZqoJM32ntzjv8ssn cjInotIFnVrjl75h2LeLexqY7+M7CZ9+etb6Zzns6F2VGyCGMPqT3AR26C0Wv31BKmqHUS5M6Xb jHjrMsosBPRuR7AsL2mj6QHLxgw4Zn/lMU3Oc52+KKJYW/vl78KusG2gDg7i0NLUSTcAyJpJMib awjAw9BV/3fBgZVh8Z62Gjeco79D8+5x8lHL2IPOWjqW8r2k 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-fbdev@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-fbdev@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/video/fbdev/tcx.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/video/fbdev/tcx.c b/drivers/video/fbdev/tcx.c index 01d87f53324d..30a460b6f204 100644 --- a/drivers/video/fbdev/tcx.c +++ b/drivers/video/fbdev/tcx.c @@ -487,7 +487,7 @@ static int tcx_probe(struct platform_device *op) return err; } -static int tcx_remove(struct platform_device *op) +static void tcx_remove(struct platform_device *op) { struct fb_info *info = dev_get_drvdata(&op->dev); struct tcx_par *par = info->par; @@ -498,8 +498,6 @@ static int tcx_remove(struct platform_device *op) tcx_unmap_regs(op, info, par); framebuffer_release(info); - - return 0; } static const struct of_device_id tcx_match[] = { @@ -516,7 +514,7 @@ static struct platform_driver tcx_driver = { .of_match_table = tcx_match, }, .probe = tcx_probe, - .remove = tcx_remove, + .remove_new = tcx_remove, }; static int __init tcx_init(void) From patchwork Sat Mar 18 23:54: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: 665381 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 6F9B7C761AF for ; Sat, 18 Mar 2023 23:55:12 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229832AbjCRXzL (ORCPT ); Sat, 18 Mar 2023 19:55:11 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47040 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229838AbjCRXyy (ORCPT ); Sat, 18 Mar 2023 19:54: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 008741BAC7 for ; Sat, 18 Mar 2023 16:54: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 1pdgNu-0004If-OY; Sun, 19 Mar 2023 00:54:50 +0100 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 1pdgNt-0056cb-8D; Sun, 19 Mar 2023 00:54:49 +0100 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1pdgNs-005zWM-K7; Sun, 19 Mar 2023 00:54:48 +0100 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Michal Januszewski , Helge Deller Cc: linux-fbdev@vger.kernel.org, dri-devel@lists.freedesktop.org, kernel@pengutronix.de Subject: [PATCH 43/51] video: fbdev: uvesafb: Convert to platform remove callback returning void Date: Sun, 19 Mar 2023 00:54:20 +0100 Message-Id: <20230318235428.272091-44-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230318235428.272091-1-u.kleine-koenig@pengutronix.de> References: <20230318235428.272091-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1599; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=/fLFBzkAaiu0PzIJRtRRRm4J+lexLWPrvq9b01Yxx3o=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBkFk8EiUoCpB0Hk/noFZqh1RHH0S7OVUdSeiiVp wgfb0ILEHOJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZBZPBAAKCRCPgPtYfRL+ Tr4KCACNZxyp+iUfljCFWIG58bReqp/R87DarrTQM20pIS2a+ntHKPXK33fJCuaHlyBXjHurkV6 Hrurzw+6Knw8bwoL0hFJa23UVfByx/DRlPCz1ciyhkKyI9fJtjKog6WZa99ooTgGfXKo1EljQHn imPu4GtDEuCVjy9ns+7i27FGDTZbLVFDzuu9y0iQaQl9vduvC4eieLlZoH0HfpE+8Vi8Oxce8It qGJAYFJLIodgQWp3OGXLmm2+shDewQXvtmWTYiMRP1XvCM6kdUufro7iFyiyOUwc+TNI6As3Myr X0zDRwfMpwlKX7l+FZvFUYujIVrhG1QH4rwQ4J6qr37Fo3jQ 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-fbdev@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-fbdev@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/video/fbdev/uvesafb.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/video/fbdev/uvesafb.c b/drivers/video/fbdev/uvesafb.c index f09f483c219b..78d85dae8ec8 100644 --- a/drivers/video/fbdev/uvesafb.c +++ b/drivers/video/fbdev/uvesafb.c @@ -1774,7 +1774,7 @@ static int uvesafb_probe(struct platform_device *dev) return err; } -static int uvesafb_remove(struct platform_device *dev) +static void uvesafb_remove(struct platform_device *dev) { struct fb_info *info = platform_get_drvdata(dev); struct uvesafb_par *par = info->par; @@ -1793,13 +1793,11 @@ static int uvesafb_remove(struct platform_device *dev) kfree(par->vbe_state_saved); framebuffer_release(info); - - return 0; } static struct platform_driver uvesafb_driver = { .probe = uvesafb_probe, - .remove = uvesafb_remove, + .remove_new = uvesafb_remove, .driver = { .name = "uvesafb", }, From patchwork Sat Mar 18 23:54: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: 664834 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 BC3AEC7619A for ; Sat, 18 Mar 2023 23:55:14 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229553AbjCRXzN (ORCPT ); Sat, 18 Mar 2023 19:55:13 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47276 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229817AbjCRXy5 (ORCPT ); Sat, 18 Mar 2023 19:54: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 EF9CA1C58F for ; Sat, 18 Mar 2023 16:54: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 1pdgNu-0004K8-Kg; Sun, 19 Mar 2023 00:54:50 +0100 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 1pdgNt-0056ci-HV; Sun, 19 Mar 2023 00:54:49 +0100 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1pdgNs-005zWP-QF; Sun, 19 Mar 2023 00:54:48 +0100 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Helge Deller , Javier Martinez Canillas , Thomas Zimmermann , Daniel Vetter Cc: linux-fbdev@vger.kernel.org, dri-devel@lists.freedesktop.org, kernel@pengutronix.de Subject: [PATCH 44/51] video: fbdev: vesafb: Convert to platform remove callback returning void Date: Sun, 19 Mar 2023 00:54:21 +0100 Message-Id: <20230318235428.272091-45-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230318235428.272091-1-u.kleine-koenig@pengutronix.de> References: <20230318235428.272091-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=2YxmySy91ABWHjFRtQioTwZYeyy9CkaQ8uG3B7FOamA=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBkFk8MNsm1+puUlb3RzHBTGQ5gRsjxn4iCmMr0O eNGM/MmW4iJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZBZPDAAKCRCPgPtYfRL+ TnFAB/wKpd5Krj6VTB02/OhweQqT49m/XmdOBf8czRTWnYZsMPctVl5PMIE3dtEQMGLCAyfsfPi /ipv0fElcO33FUR3mRUwANzYVvUSzGtE6UeMFWKddm220jCWhM+43uuXDSsdL6OJkznlDmPLRIm 1VAW/hnsB0qp6YTuG81o6AmVX/0dhyysOmlVlBSBu48GZkfUCfVw/i0ORtRPpYmhejcd40lFFbC iKYiThDejuo8mbs4TzIbrCAbMO3v85mwnxCZG9iI3uvabjrBYKS3jM583ieGAMvrJQw1mbKEud0 o3vNPcWYit/2eCy41GhRwgH7QDvNGTVosijE1Uh2AHvNFU4c 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-fbdev@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-fbdev@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/video/fbdev/vesafb.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/video/fbdev/vesafb.c b/drivers/video/fbdev/vesafb.c index 3f8bdfcf51f0..7451c607dc50 100644 --- a/drivers/video/fbdev/vesafb.c +++ b/drivers/video/fbdev/vesafb.c @@ -485,7 +485,7 @@ static int vesafb_probe(struct platform_device *dev) return err; } -static int vesafb_remove(struct platform_device *pdev) +static void vesafb_remove(struct platform_device *pdev) { struct fb_info *info = platform_get_drvdata(pdev); @@ -494,8 +494,6 @@ static int vesafb_remove(struct platform_device *pdev) /* vesafb_destroy takes care of info cleanup */ unregister_framebuffer(info); - - return 0; } static struct platform_driver vesafb_driver = { @@ -503,7 +501,7 @@ static struct platform_driver vesafb_driver = { .name = "vesa-framebuffer", }, .probe = vesafb_probe, - .remove = vesafb_remove, + .remove_new = vesafb_remove, }; module_platform_driver(vesafb_driver); From patchwork Sat Mar 18 23:54: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: 664835 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 D7E0CC7618A for ; Sat, 18 Mar 2023 23:55:12 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229878AbjCRXzL (ORCPT ); Sat, 18 Mar 2023 19:55:11 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46992 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229553AbjCRXyz (ORCPT ); Sat, 18 Mar 2023 19:54: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 E43A61B2CF for ; Sat, 18 Mar 2023 16:54: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 1pdgNv-0004Oi-QK; Sun, 19 Mar 2023 00:54:51 +0100 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 1pdgNu-0056cw-4o; Sun, 19 Mar 2023 00:54:50 +0100 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1pdgNt-005zWU-4L; Sun, 19 Mar 2023 00:54:49 +0100 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Helge Deller Cc: linux-fbdev@vger.kernel.org, dri-devel@lists.freedesktop.org, kernel@pengutronix.de Subject: [PATCH 45/51] video: fbdev: vfb: Convert to platform remove callback returning void Date: Sun, 19 Mar 2023 00:54:22 +0100 Message-Id: <20230318235428.272091-46-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230318235428.272091-1-u.kleine-koenig@pengutronix.de> References: <20230318235428.272091-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1505; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=J3g2K4GMb81lpfP0l/rZbwcFlTXYkFbJI8iSz7+fgko=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBkFk8QQQyh90Gn9MCfsNvSK2H/urQWL0MtmPpl9 Qu3fEKUsIuJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZBZPEAAKCRCPgPtYfRL+ TpbZB/4hMYWp7j35SdnRXPioguUdSxW7csS8ccr2l/XryI5c9EQldOebbYsWJkt7hTLIegnBdcN yCw+8axg3P8FhztvGuaZJKvHr9D4tEu86qSEqAwxoTWmnhTlFMencFte3EVl01m4TgoypckM48S 0GehJHcSiXrZKCp7ixP4ckk7ltRKz7rP6TdV54QmwZOcXH4nVTVD4cJwKVpnXzDRHzmJ443yp1p OO7nWXd92pobHR18aPZvTTcLHjeynI9e0ri1KKVEbwhlv0OaVXGyC67NL0Mq6f7cdGjwLFCFaHm Z4dXMf2Oji3UJxgm9HFWiP5TEtjJ8x3wM+lg6zFnQrEQCpRV 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-fbdev@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-fbdev@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/video/fbdev/vfb.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/drivers/video/fbdev/vfb.c b/drivers/video/fbdev/vfb.c index 95d3c59867d0..1a2514d564fc 100644 --- a/drivers/video/fbdev/vfb.c +++ b/drivers/video/fbdev/vfb.c @@ -479,7 +479,7 @@ static int vfb_probe(struct platform_device *dev) return retval; } -static int vfb_remove(struct platform_device *dev) +static void vfb_remove(struct platform_device *dev) { struct fb_info *info = platform_get_drvdata(dev); @@ -489,12 +489,11 @@ static int vfb_remove(struct platform_device *dev) fb_dealloc_cmap(&info->cmap); framebuffer_release(info); } - return 0; } static struct platform_driver vfb_driver = { .probe = vfb_probe, - .remove = vfb_remove, + .remove_new = vfb_remove, .driver = { .name = "vfb", }, From patchwork Sat Mar 18 23:54: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: 664832 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 E9192C761A6 for ; Sat, 18 Mar 2023 23:55:17 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229843AbjCRXzQ (ORCPT ); Sat, 18 Mar 2023 19:55:16 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47330 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229866AbjCRXy6 (ORCPT ); Sat, 18 Mar 2023 19:54: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 4A89920A36 for ; Sat, 18 Mar 2023 16:54: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 1pdgNv-0004Nz-Ku; Sun, 19 Mar 2023 00:54:51 +0100 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 1pdgNu-0056cs-21; Sun, 19 Mar 2023 00:54:50 +0100 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1pdgNt-005zWY-AG; Sun, 19 Mar 2023 00:54:49 +0100 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Helge Deller , Javier Martinez Canillas , Thomas Zimmermann , Zeng Heng Cc: linux-fbdev@vger.kernel.org, dri-devel@lists.freedesktop.org, kernel@pengutronix.de Subject: [PATCH 46/51] video: fbdev: vga16fb: Convert to platform remove callback returning void Date: Sun, 19 Mar 2023 00:54:23 +0100 Message-Id: <20230318235428.272091-47-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230318235428.272091-1-u.kleine-koenig@pengutronix.de> References: <20230318235428.272091-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=NDWxNtLKMb/W8u1lA3dwx7HDkHYJMkkrIqsYtk5LsZY=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBkFk8TwTYWAQDSge5HLioHHeUgw5G+y5GXn9L5p NCKuV4jHaGJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZBZPEwAKCRCPgPtYfRL+ TnUtB/9X/QYz3TTEv633i5lVt7G56CXma7eu1gRY/irjZk5VAoOdmynjbP5bsxzJFOKAqaPjmAZ /a2V2Y9ra5Qc9b6AA2gjAbQuxLtrrV21BcFlO4SuXAKtAS6nTsvYVdKEu6yW2POIt26ROOiuYKz IzCYRtvc+t9wtqMsTy2RLlJuuC+JWCJZ5h3D/mUZFNre0qW0On6IhvU6TRfjZ6ax0tJzKPgKjIM Okgch3eGoTcbBYbpgnbKRK9Iv8hG9vdY+bsqJ9fBxXxHpWul4Wgd99ql/gk0luli2X71M8hUSe5 WjjY7MGJxfMwiwHGlERNNsjvg/IxpcGzvuIbOLOHPlVpcOk3 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-fbdev@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-fbdev@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/video/fbdev/vga16fb.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/video/fbdev/vga16fb.c b/drivers/video/fbdev/vga16fb.c index 1a8ffdb2be26..34d00347ad58 100644 --- a/drivers/video/fbdev/vga16fb.c +++ b/drivers/video/fbdev/vga16fb.c @@ -1401,14 +1401,12 @@ static int vga16fb_probe(struct platform_device *dev) return ret; } -static int vga16fb_remove(struct platform_device *dev) +static void vga16fb_remove(struct platform_device *dev) { struct fb_info *info = platform_get_drvdata(dev); if (info) unregister_framebuffer(info); - - return 0; } static const struct platform_device_id vga16fb_driver_id_table[] = { @@ -1420,7 +1418,7 @@ MODULE_DEVICE_TABLE(platform, vga16fb_driver_id_table); static struct platform_driver vga16fb_driver = { .probe = vga16fb_probe, - .remove = vga16fb_remove, + .remove_new = vga16fb_remove, .driver = { .name = "vga16fb", }, From patchwork Sat Mar 18 23:54: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: 665379 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 B8DCEC7618A for ; Sat, 18 Mar 2023 23:55:15 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229817AbjCRXzN (ORCPT ); Sat, 18 Mar 2023 19:55:13 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47280 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229841AbjCRXy5 (ORCPT ); Sat, 18 Mar 2023 19:54: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 6E46E1C590 for ; Sat, 18 Mar 2023 16:54: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 1pdgNv-0004Os-Rl; Sun, 19 Mar 2023 00:54:51 +0100 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 1pdgNu-0056cx-68; Sun, 19 Mar 2023 00:54:50 +0100 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1pdgNt-005zWc-GQ; Sun, 19 Mar 2023 00:54:49 +0100 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Florian Tobias Schandinat , Helge Deller Cc: linux-fbdev@vger.kernel.org, dri-devel@lists.freedesktop.org, kernel@pengutronix.de Subject: [PATCH 47/51] video: fbdev: via: Convert to platform remove callback returning void Date: Sun, 19 Mar 2023 00:54:24 +0100 Message-Id: <20230318235428.272091-48-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230318235428.272091-1-u.kleine-koenig@pengutronix.de> References: <20230318235428.272091-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=2742; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=nRUKepkuc8birmSosnSrBVBu9UYDmgMqTl2f4T6Kqnc=; b=owEBbAGT/pANAwAKAY+A+1h9Ev5OAcsmYgBkFk8W+mD/goTxhMKQhsX6uNUduvd/DJ8rGfj93 aowx3o5vJ2JATIEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZBZPFgAKCRCPgPtYfRL+ Tt+HB/jMmttqsZvPBjzv/AIh/Zila4Q6jU2ev/DakReXx8OsuM7SDnlNjMWA280x+sJvDPgzy7X Lvy8+1FTMBt6KWIBBLC7fb7mUZp+dt6IFY0bxIoaHKvBc1xbfM/JpAIEi50iIEPbD7e1x7omlgp 0+LOkqsIBstyL+h+7rnuSpYUgoqEMstmDsbbyUyhpAUv3AsPWnFrbbtWVpaBwn0vwVPNeWyugYo 9bJYodWUg9944GzT0ch8cETXIZNQ9rd+bGpVyQVl/SEoXDjZUGgPLYHYcPjEsXmh6KQ+BofuDEa aVmkjYjfK/p5sf0C9GjzIcD6/1l2KU9OUCgC9brdfSioj7w= 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-fbdev@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-fbdev@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/video/fbdev/via/via-gpio.c | 5 ++--- drivers/video/fbdev/via/via_i2c.c | 5 ++--- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/drivers/video/fbdev/via/via-gpio.c b/drivers/video/fbdev/via/via-gpio.c index febb2aadd822..f1b670397c02 100644 --- a/drivers/video/fbdev/via/via-gpio.c +++ b/drivers/video/fbdev/via/via-gpio.c @@ -262,7 +262,7 @@ static int viafb_gpio_probe(struct platform_device *platdev) } -static int viafb_gpio_remove(struct platform_device *platdev) +static void viafb_gpio_remove(struct platform_device *platdev) { unsigned long flags; int i; @@ -285,7 +285,6 @@ static int viafb_gpio_remove(struct platform_device *platdev) viafb_gpio_disable(viafb_gpio_config.active_gpios[i]); viafb_gpio_config.gpio_chip.ngpio = 0; spin_unlock_irqrestore(&viafb_gpio_config.vdev->reg_lock, flags); - return 0; } static struct platform_driver via_gpio_driver = { @@ -293,7 +292,7 @@ static struct platform_driver via_gpio_driver = { .name = "viafb-gpio", }, .probe = viafb_gpio_probe, - .remove = viafb_gpio_remove, + .remove_new = viafb_gpio_remove, }; int viafb_gpio_init(void) diff --git a/drivers/video/fbdev/via/via_i2c.c b/drivers/video/fbdev/via/via_i2c.c index c7e63ab47c39..c35e530e0ec9 100644 --- a/drivers/video/fbdev/via/via_i2c.c +++ b/drivers/video/fbdev/via/via_i2c.c @@ -246,7 +246,7 @@ static int viafb_i2c_probe(struct platform_device *platdev) return 0; } -static int viafb_i2c_remove(struct platform_device *platdev) +static void viafb_i2c_remove(struct platform_device *platdev) { int i; @@ -259,7 +259,6 @@ static int viafb_i2c_remove(struct platform_device *platdev) if (i2c_stuff->is_active) i2c_del_adapter(&i2c_stuff->adapter); } - return 0; } static struct platform_driver via_i2c_driver = { @@ -267,7 +266,7 @@ static struct platform_driver via_i2c_driver = { .name = "viafb-i2c", }, .probe = viafb_i2c_probe, - .remove = viafb_i2c_remove, + .remove_new = viafb_i2c_remove, }; int viafb_i2c_init(void) From patchwork Sat Mar 18 23:54: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: 665380 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 4DED4C74A5B for ; Sat, 18 Mar 2023 23:55:13 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229816AbjCRXzM (ORCPT ); Sat, 18 Mar 2023 19:55:12 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47282 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229837AbjCRXy5 (ORCPT ); Sat, 18 Mar 2023 19:54: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 D893B1C5A9 for ; Sat, 18 Mar 2023 16:54: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 1pdgNw-0004Rb-F2; Sun, 19 Mar 2023 00:54:52 +0100 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 1pdgNu-0056d6-JK; Sun, 19 Mar 2023 00:54:50 +0100 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1pdgNt-005zWh-MT; Sun, 19 Mar 2023 00:54:49 +0100 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Helge Deller Cc: linux-arm-kernel@lists.infradead.org, linux-fbdev@vger.kernel.org, dri-devel@lists.freedesktop.org, kernel@pengutronix.de Subject: [PATCH 48/51] video: fbdev: vt8500lcdfb: Convert to platform remove callback returning void Date: Sun, 19 Mar 2023 00:54:25 +0100 Message-Id: <20230318235428.272091-49-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230318235428.272091-1-u.kleine-koenig@pengutronix.de> References: <20230318235428.272091-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1848; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=2FdpVHFGu+rqUO3b3048pcZ9lVd42tPkiAFw8A7/TEY=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBkFk8a6GzzepW0HGR7t+ZcYoIgmJFdz1TRptOmf +dUuutk0gKJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZBZPGgAKCRCPgPtYfRL+ TmYRCAC4/CTu/Eo/pubXMwIqK9nbi7HpjXF5gvvh8z+eXZyClvg1KV3Uodl+4KI/OxMfRq32jNx daz0+qo8QhcmhsnwKq4vrwhUq68aW+0YLVX2vfdx1Rj+UQ6xwXbpD96mu8LHmUpFbLK2gUKzN1g mURmXyWpxORkQnIhLPow4g70IhI02JknOEAU4/zCQObLof7mCx3EOPGd1cn7+Kvf8G2xhIuMzm/ oEwnBXEPbnPppbi0JVEjyfMCFXRe1c2fnen6IVy+BxFYOxRWUSuR59jhKoDDtNUNzxL7Ixzh91p iJrxRavc6OvJwqz2uSD6+/tiD7u/++auyzXoINLyAWILzuJ8 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-fbdev@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-fbdev@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/video/fbdev/vt8500lcdfb.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/video/fbdev/vt8500lcdfb.c b/drivers/video/fbdev/vt8500lcdfb.c index c61476247ba8..31d4e85b220c 100644 --- a/drivers/video/fbdev/vt8500lcdfb.c +++ b/drivers/video/fbdev/vt8500lcdfb.c @@ -439,7 +439,7 @@ static int vt8500lcd_probe(struct platform_device *pdev) return ret; } -static int vt8500lcd_remove(struct platform_device *pdev) +static void vt8500lcd_remove(struct platform_device *pdev) { struct vt8500lcd_info *fbi = platform_get_drvdata(pdev); struct resource *res; @@ -462,8 +462,6 @@ static int vt8500lcd_remove(struct platform_device *pdev) res = platform_get_resource(pdev, IORESOURCE_MEM, 0); release_mem_region(res->start, resource_size(res)); - - return 0; } static const struct of_device_id via_dt_ids[] = { @@ -473,7 +471,7 @@ static const struct of_device_id via_dt_ids[] = { static struct platform_driver vt8500lcd_driver = { .probe = vt8500lcd_probe, - .remove = vt8500lcd_remove, + .remove_new = vt8500lcd_remove, .driver = { .name = "vt8500-lcd", .of_match_table = of_match_ptr(via_dt_ids), From patchwork Sat Mar 18 23:54: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: 665378 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 546D8C7619A for ; Sat, 18 Mar 2023 23:55:17 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229649AbjCRXzQ (ORCPT ); Sat, 18 Mar 2023 19:55:16 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47284 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229843AbjCRXy5 (ORCPT ); Sat, 18 Mar 2023 19:54: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 43F811B572 for ; Sat, 18 Mar 2023 16:54: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 1pdgNw-0004Rf-Fr; Sun, 19 Mar 2023 00:54:52 +0100 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 1pdgNu-0056d7-JL; Sun, 19 Mar 2023 00:54:50 +0100 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1pdgNt-005zWk-SU; Sun, 19 Mar 2023 00:54:49 +0100 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Helge Deller Cc: linux-arm-kernel@lists.infradead.org, linux-fbdev@vger.kernel.org, dri-devel@lists.freedesktop.org, kernel@pengutronix.de Subject: [PATCH 49/51] video: fbdev: wm8505fb: Convert to platform remove callback returning void Date: Sun, 19 Mar 2023 00:54:26 +0100 Message-Id: <20230318235428.272091-50-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230318235428.272091-1-u.kleine-koenig@pengutronix.de> References: <20230318235428.272091-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1734; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=B7n0rWq6GxbW5rJ5Dqd2jXn+/vWBf6udLaZCZyY1GYc=; b=owGbwMvMwMXY3/A7olbonx/jabUkhhQxf5nFX9Ve9Gy5Gz29V7Zb/sYW/8l5tzSnSk9eqhLb+ fJsx/1/nYzGLAyMXAyyYoos9o1rMq2q5CI71/67DDOIlQlkCgMXpwBM5FwW+/94NSXOl/GFXY3v H3GVTBadJltutFL34ZZktXUNCorCh2pWqJ19emaWP2vsH7bZOtx//q3lvyY6qXbm15lq6Qzu2wz L7t38zK/Xf3Zpb1mT9P0Ajq4P8g7Waw5fyXnXtmr13VoxhuwrEj6cLx/cMQvoFfAL9rrRKiJ8XZ n/i9OZRwWLjiq0KH3227A1yrx85S+JVUG1D9wbtOt+shj7Pcn+xhp7MzHlza1vrO4z99rHFAvYn zPRnde25Ne5Kr5dMxin7NQNW2fHWBfI5qr2/altYpeoPGMKp7K/+6yUQ7Z7iy8c8voc8Yw7ViFp 4hGr41Znjkt4Zlu0z036xb/d20+I+fYqwaowrVnBMSsSAQ== 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-fbdev@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-fbdev@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/video/fbdev/wm8505fb.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/video/fbdev/wm8505fb.c b/drivers/video/fbdev/wm8505fb.c index 8f4d674fa0d0..cf0ac6c2d4c7 100644 --- a/drivers/video/fbdev/wm8505fb.c +++ b/drivers/video/fbdev/wm8505fb.c @@ -374,7 +374,7 @@ static int wm8505fb_probe(struct platform_device *pdev) return 0; } -static int wm8505fb_remove(struct platform_device *pdev) +static void wm8505fb_remove(struct platform_device *pdev) { struct wm8505fb_info *fbi = platform_get_drvdata(pdev); @@ -384,8 +384,6 @@ static int wm8505fb_remove(struct platform_device *pdev) if (fbi->fb.cmap.len) fb_dealloc_cmap(&fbi->fb.cmap); - - return 0; } static const struct of_device_id wmt_dt_ids[] = { @@ -395,7 +393,7 @@ static const struct of_device_id wmt_dt_ids[] = { static struct platform_driver wm8505fb_driver = { .probe = wm8505fb_probe, - .remove = wm8505fb_remove, + .remove_new = wm8505fb_remove, .driver = { .name = DRIVER_NAME, .of_match_table = wmt_dt_ids, From patchwork Sat Mar 18 23:54: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: 665376 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 EF80AC76196 for ; Sat, 18 Mar 2023 23:55:21 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229841AbjCRXzS (ORCPT ); Sat, 18 Mar 2023 19:55:18 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47068 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229850AbjCRXy5 (ORCPT ); Sat, 18 Mar 2023 19:54: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 5A67220555 for ; Sat, 18 Mar 2023 16:54: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 1pdgNw-0004U6-M4; Sun, 19 Mar 2023 00:54:52 +0100 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 1pdgNv-0056dI-3P; Sun, 19 Mar 2023 00:54:51 +0100 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1pdgNu-005zWn-2s; Sun, 19 Mar 2023 00:54:50 +0100 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Helge Deller Cc: linux-arm-kernel@lists.infradead.org, linux-fbdev@vger.kernel.org, dri-devel@lists.freedesktop.org, kernel@pengutronix.de Subject: [PATCH 50/51] video: fbdev: wmt_ge_rops: Convert to platform remove callback returning void Date: Sun, 19 Mar 2023 00:54:27 +0100 Message-Id: <20230318235428.272091-51-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230318235428.272091-1-u.kleine-koenig@pengutronix.de> References: <20230318235428.272091-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1586; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=tt1v6ExXKFa6WnHThNDqW4BNRPbPsXa4C5cw5RgOKpg=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBkFk8fItxiS0oUIuvBJeeljfSj+XNcO/SN+d3VS OAlE4hIVXqJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZBZPHwAKCRCPgPtYfRL+ TgYzB/9iwlhlvr87LTOA3sXPA7rruz9J68CyQv6K+qWjSS+MneTbH7GZptsHICuGpC0T95N0yFx 9wVAJ5/GTfVOTHrxsWRbPyOnOz1+7UFyVqfYY6izt6Szdefde7l2xcXFCqjhFOOE0NLrHAt9Yq6 5t56AIMD6L3CLGjhrgsG66atpMnttNar1xPWTvtkzevFWKZASvh5S6kDIjm4JwnSZvP1imyBpa7 yaAqv515ekPYXoE+UczVCptIkcnXI2QMZ9c8Ns6jCitEJQApxGOq/b+II3pIqAYYj42QfAXEYi0 AHlN2a1cggZNiIIAby2Ajjv8RJtUrBZhoK0HhModON9EK6cn 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-fbdev@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-fbdev@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/video/fbdev/wmt_ge_rops.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/drivers/video/fbdev/wmt_ge_rops.c b/drivers/video/fbdev/wmt_ge_rops.c index 42255d27a1db..6196b9a6c44d 100644 --- a/drivers/video/fbdev/wmt_ge_rops.c +++ b/drivers/video/fbdev/wmt_ge_rops.c @@ -145,10 +145,9 @@ static int wmt_ge_rops_probe(struct platform_device *pdev) return 0; } -static int wmt_ge_rops_remove(struct platform_device *pdev) +static void wmt_ge_rops_remove(struct platform_device *pdev) { iounmap(regbase); - return 0; } static const struct of_device_id wmt_dt_ids[] = { @@ -158,7 +157,7 @@ static const struct of_device_id wmt_dt_ids[] = { static struct platform_driver wmt_ge_rops_driver = { .probe = wmt_ge_rops_probe, - .remove = wmt_ge_rops_remove, + .remove_new = wmt_ge_rops_remove, .driver = { .name = "wmt_ge_rops", .of_match_table = wmt_dt_ids, From patchwork Sat Mar 18 23:54: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: 665377 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 62A6DC7618A for ; Sat, 18 Mar 2023 23:55:19 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229828AbjCRXzS (ORCPT ); Sat, 18 Mar 2023 19:55:18 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47030 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229504AbjCRXy5 (ORCPT ); Sat, 18 Mar 2023 19:54: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 D06121BAC7 for ; Sat, 18 Mar 2023 16:54: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 1pdgNw-0004TX-R9; Sun, 19 Mar 2023 00:54:52 +0100 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 1pdgNu-0056dE-Vf; Sun, 19 Mar 2023 00:54:50 +0100 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1pdgNu-005zWt-9i; Sun, 19 Mar 2023 00:54:50 +0100 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Helge Deller , Michal Simek Cc: linux-fbdev@vger.kernel.org, dri-devel@lists.freedesktop.org, linux-arm-kernel@lists.infradead.org, kernel@pengutronix.de Subject: [PATCH 51/51] video: fbdev: xilinxfb: Convert to platform remove callback returning void Date: Sun, 19 Mar 2023 00:54:28 +0100 Message-Id: <20230318235428.272091-52-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230318235428.272091-1-u.kleine-koenig@pengutronix.de> References: <20230318235428.272091-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1606; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=Dl/6zgd8+L0yBXWOI+uig7Ijl6aILn0Iyon1WoU7m5A=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBkFk8jmzU9uwGzi8BtpTJLCRViAD6Y6SqBed1m0 PQ8htw9t0iJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZBZPIwAKCRCPgPtYfRL+ TqKZB/4/AKNbmiQPwz/0Ml98yLh4xd+PER5MPql4CSnmrWdhvK46emp3l3AfwrmOs3W5TXTl3SP lmBsCXxmxtgCrR01JSDqGQFQEYTXUTJsByIEt/5zqnq1lN3qqAozpxSNeLrk70uRD0fl3F4AhHe 04YCxXZi8+xe/DFkqAdOuod7dxLfm+4GK5PPjQjeawmVi4Wu0ImnTEtobgkj2hpGvB3lAPeAzf2 Ol68lVT6Q8bBNKozMIM6bpMY9S7BMKk8TCNiXusdgRElYYBsbLjGP7hXAFMQ5TYN19Myaqr3rN3 Moaa2Fcthi6G/ahdDdFVAqlmjLTW1steAOejFyfHLaBmGtAw 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-fbdev@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-fbdev@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/video/fbdev/xilinxfb.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/video/fbdev/xilinxfb.c b/drivers/video/fbdev/xilinxfb.c index 1ac83900a21c..90c2939971a2 100644 --- a/drivers/video/fbdev/xilinxfb.c +++ b/drivers/video/fbdev/xilinxfb.c @@ -476,11 +476,9 @@ static int xilinxfb_of_probe(struct platform_device *pdev) return xilinxfb_assign(pdev, drvdata, &pdata); } -static int xilinxfb_of_remove(struct platform_device *op) +static void xilinxfb_of_remove(struct platform_device *op) { xilinxfb_release(&op->dev); - - return 0; } /* Match table for of_platform binding */ @@ -496,7 +494,7 @@ MODULE_DEVICE_TABLE(of, xilinxfb_of_match); static struct platform_driver xilinxfb_of_driver = { .probe = xilinxfb_of_probe, - .remove = xilinxfb_of_remove, + .remove_new = xilinxfb_of_remove, .driver = { .name = DRIVER_NAME, .of_match_table = xilinxfb_of_match,