From patchwork Tue Nov 7 09:17: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: 742113 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 F0446C04E83 for ; Tue, 7 Nov 2023 09:20:34 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233817AbjKGJUf (ORCPT ); Tue, 7 Nov 2023 04:20:35 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36848 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233822AbjKGJUb (ORCPT ); Tue, 7 Nov 2023 04:20:31 -0500 Received: from metis.whiteo.stw.pengutronix.de (metis.whiteo.stw.pengutronix.de [IPv6:2a0a:edc0:2:b01:1d::104]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1116A106 for ; Tue, 7 Nov 2023 01:20:28 -0800 (PST) Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.whiteo.stw.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1r0IG1-0000IZ-7N; Tue, 07 Nov 2023 10:20:25 +0100 Received: from [2a0a:edc0:0:900:1d::77] (helo=ptz.office.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1r0IG0-007FlL-Ap; Tue, 07 Nov 2023 10:20:24 +0100 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1r0IG0-00ENW7-1c; Tue, 07 Nov 2023 10:20:24 +0100 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Helge Deller Cc: Thomas Zimmermann , Sam Ravnborg , Atul Raut , linux-fbdev@vger.kernel.org, dri-devel@lists.freedesktop.org, kernel@pengutronix.de Subject: [PATCH 01/22] fb: amifb: Stop using platform_driver_probe() Date: Tue, 7 Nov 2023 10:17:42 +0100 Message-ID: <20231107091740.3924258-2-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.42.0.586.gbc5204569f7d.dirty In-Reply-To: <20231107091740.3924258-1-u.kleine-koenig@pengutronix.de> References: <20231107091740.3924258-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=2258; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=oG9a0u8ePiuLkRlvrucgb/21kgy596LDbVG/7UHObeY=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBlSgC1g6l8kfiGZf6ynAygClDXnAjXuiMZglr7D 301DDl/mpuJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZUoAtQAKCRCPgPtYfRL+ TmqUB/wK6QlmNM5mlXhL8RKtrnCHxGYe0CQuYyJnA1GDGHLA5/LyyVw0Csuu9SdZT3jdPqdglPp Fb/K6ywolgkCzdfaGWUatEjvAmoc1fSbL+7cAQuZ96RivUKoQyFBPLMYfD3XY9hCXqogjRTf1WE BzcQ/YKDbFoHuVqE4SGRyV5ovVirgZmQrDPWIydy/nFglqlQRIEbwqhEfGnC1gjEuBvTYV0bPAl jXQhFIRu39qDNiaJOC1GsbtEhugprWuTAgPjp/UPxoIoUWDDU4oSRbNzPIdFfJIlGVRfkte2TyA 9Zo6dID5j4LjKqo7nXTlwIQOmTGhiaOa0UfpvVWIf6jpWBKn 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.whiteo.stw.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 On today's platforms the benefit of platform_driver_probe() isn't that relevant any more. It allows to drop some code after booting (or module loading) for .probe() and discard the .remove() function completely if the driver is built-in. This typically saves a few 100k. The downside of platform_driver_probe() is that the driver cannot be bound and unbound at runtime which is ancient and also slightly complicates testing. There are also thoughts to deprecate platform_driver_probe() because it adds some complexity in the driver core for little gain. Also many drivers don't use it correctly. This driver for example misses to mark the driver struct with __refdata which is needed to suppress a (W=1) modpost warning: WARNING: modpost: drivers/video/fbdev/amifb: section mismatch in reference: amifb_driver+0x4 (section: .data) -> amifb_remove (section: .exit.text) Signed-off-by: Uwe Kleine-König --- drivers/video/fbdev/amifb.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/drivers/video/fbdev/amifb.c b/drivers/video/fbdev/amifb.c index b18c6b4f129a..85da43034166 100644 --- a/drivers/video/fbdev/amifb.c +++ b/drivers/video/fbdev/amifb.c @@ -3530,7 +3530,7 @@ static inline void chipfree(void) * Initialisation */ -static int __init amifb_probe(struct platform_device *pdev) +static int amifb_probe(struct platform_device *pdev) { struct fb_info *info; int tag, i, err = 0; @@ -3752,7 +3752,7 @@ static int __init amifb_probe(struct platform_device *pdev) } -static int __exit amifb_remove(struct platform_device *pdev) +static int amifb_remove(struct platform_device *pdev) { struct fb_info *info = platform_get_drvdata(pdev); @@ -3769,13 +3769,13 @@ static int __exit amifb_remove(struct platform_device *pdev) } static struct platform_driver amifb_driver = { - .remove = __exit_p(amifb_remove), - .driver = { + .probe = amifb_probe, + .remove = amifb_remove, + .driver = { .name = "amiga-video", }, }; - -module_platform_driver_probe(amifb_driver, amifb_probe); +module_platform_driver(amifb_driver); MODULE_LICENSE("GPL"); MODULE_ALIAS("platform:amiga-video"); From patchwork Tue Nov 7 09:17: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: 742114 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 B092DC0018C for ; Tue, 7 Nov 2023 09:20:33 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233932AbjKGJUe (ORCPT ); Tue, 7 Nov 2023 04:20:34 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37324 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233251AbjKGJUa (ORCPT ); Tue, 7 Nov 2023 04:20:30 -0500 Received: from metis.whiteo.stw.pengutronix.de (metis.whiteo.stw.pengutronix.de [IPv6:2a0a:edc0:2:b01:1d::104]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6166812A for ; Tue, 7 Nov 2023 01:20:27 -0800 (PST) Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.whiteo.stw.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1r0IG1-0000Ic-Cn; Tue, 07 Nov 2023 10:20:25 +0100 Received: from [2a0a:edc0:0:900:1d::77] (helo=ptz.office.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1r0IG1-007FlU-04; Tue, 07 Nov 2023 10:20:25 +0100 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1r0IG0-00ENWO-NI; Tue, 07 Nov 2023 10:20:24 +0100 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Helge Deller Cc: Dmitry Torokhov , linux-omap@vger.kernel.org, linux-fbdev@vger.kernel.org, dri-devel@lists.freedesktop.org, kernel@pengutronix.de Subject: [PATCH 04/22] fb: omapfb/dpi: Don't put .remove() in .exit.text and drop suppress_bind_attrs Date: Tue, 7 Nov 2023 10:17:45 +0100 Message-ID: <20231107091740.3924258-5-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.42.0.586.gbc5204569f7d.dirty In-Reply-To: <20231107091740.3924258-1-u.kleine-koenig@pengutronix.de> References: <20231107091740.3924258-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1888; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=VXZGv6DiRezgIbSA2hrnDeJsC/7yBZ6B6Rjc67D/wns=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBlSgC5y588bVgd75MR5gtCz0hrUgFRyuMmYnJ82 clDFCI/R6aJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZUoAuQAKCRCPgPtYfRL+ Tg3xB/94UX/tX6EyWuPnfn7aGSCUOpwOPMlenoetLdAwpF8rsQ8V89D1Bz5nskFFVlDNqqxUj88 /ukRkNpzb/9JyQf/Fma92UdA9NdR9Xe184gRFZfx7a5M8+SaWTR84Asm0W9UhSokGqXyXNRcWFd b9oP5xNSPyeUJWjMVhxdglpVs4+A2pc0ZVTAfe6ZWsykF8zaabQ7TV9V6F7xDZJ516GnJF2Az5E IJdAqQ9s4qtcRfD4P4ixyRpawzlQa7/vGKBnEFP8tz/qW3WB54L3aKXDIwmsETp5T0htTv9HhYm xizeEueeh9OaeRThzRGAPCLYL9Vl2Vm/BkEPc3KAC1AIO5wl 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.whiteo.stw.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 On today's platforms the memory savings of putting the remove function in .exit isn't that relevant any more. It only matters for built-in drivers and typically saves a few 100k. The downside is that the driver cannot be unbound at runtime which is ancient and also slightly complicates testing. Also it requires to mark the driver struct with __refdata which is needed to suppress a (W=1) modpost warning: WARNING: modpost: drivers/video/fbdev/omap2/omapfb/displays/panel-dpi: section mismatch in reference: panel_dpi_driver+0x4 (section: .data) -> panel_dpi_remove (section: .exit.text) To simplify matters, move the remove callback to .text and drop .suppress_bind_attrs = true. Signed-off-by: Uwe Kleine-König --- drivers/video/fbdev/omap2/omapfb/displays/panel-dpi.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/drivers/video/fbdev/omap2/omapfb/displays/panel-dpi.c b/drivers/video/fbdev/omap2/omapfb/displays/panel-dpi.c index 9790053c5877..aa6faa5ba158 100644 --- a/drivers/video/fbdev/omap2/omapfb/displays/panel-dpi.c +++ b/drivers/video/fbdev/omap2/omapfb/displays/panel-dpi.c @@ -211,7 +211,7 @@ static int panel_dpi_probe(struct platform_device *pdev) return r; } -static int __exit panel_dpi_remove(struct platform_device *pdev) +static int panel_dpi_remove(struct platform_device *pdev) { struct panel_drv_data *ddata = platform_get_drvdata(pdev); struct omap_dss_device *dssdev = &ddata->dssdev; @@ -236,11 +236,10 @@ MODULE_DEVICE_TABLE(of, panel_dpi_of_match); static struct platform_driver panel_dpi_driver = { .probe = panel_dpi_probe, - .remove = __exit_p(panel_dpi_remove), + .remove = panel_dpi_remove, .driver = { .name = "panel-dpi", .of_match_table = panel_dpi_of_match, - .suppress_bind_attrs = true, }, }; From patchwork Tue Nov 7 09:17: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: 742112 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 3255AC04E85 for ; Tue, 7 Nov 2023 09:20:35 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233822AbjKGJUg (ORCPT ); Tue, 7 Nov 2023 04:20:36 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37150 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233823AbjKGJUb (ORCPT ); Tue, 7 Nov 2023 04:20:31 -0500 Received: from metis.whiteo.stw.pengutronix.de (metis.whiteo.stw.pengutronix.de [IPv6:2a0a:edc0:2:b01:1d::104]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5F5C7134 for ; Tue, 7 Nov 2023 01:20:28 -0800 (PST) Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.whiteo.stw.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1r0IG2-0000L5-3P; Tue, 07 Nov 2023 10:20:26 +0100 Received: from [2a0a:edc0:0:900:1d::77] (helo=ptz.office.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1r0IG1-007Flh-Ji; Tue, 07 Nov 2023 10:20:25 +0100 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1r0IG1-00ENWa-AM; Tue, 07 Nov 2023 10:20:25 +0100 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Helge Deller Cc: Dmitry Torokhov , linux-omap@vger.kernel.org, linux-fbdev@vger.kernel.org, dri-devel@lists.freedesktop.org, kernel@pengutronix.de Subject: [PATCH 07/22] fb: omapfb/hdmi: Don't put .remove() in .exit.text and drop suppress_bind_attrs Date: Tue, 7 Nov 2023 10:17:48 +0100 Message-ID: <20231107091740.3924258-8-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.42.0.586.gbc5204569f7d.dirty In-Reply-To: <20231107091740.3924258-1-u.kleine-koenig@pengutronix.de> References: <20231107091740.3924258-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1897; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=+LBfarFgNGdEdR70HZX7xtdnkE1ct/ibDew+mdn4KA0=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBlSgC8iDxb61wLOUfHEpT5dSVR67spN6fZOrjkp A8+5QDYU7OJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZUoAvAAKCRCPgPtYfRL+ TtZ4B/9NrljLu04GA6KgqnBZTDmDdY4BqbBDkfbej5X/WaXXpMX0OqVvsezLy01IVcNfm4o5BRd OSTtCxSO8z/inY8gBh4nVcreYi++SuAqVOk7Aiu3Sl2B9/ZeuwzqRIoMmbg2TqTeRd4WsDyrnfo /JYJvw9C2TB9g+1Kyjw5CRTpN2Jh9ipJ3OnVHE9c1HwyVWZ5uVhx/CdAPnbzi8axwoNHMh/jN75 Qh/FE6Ng5CgHRAUVeMMGe4CGKwVK6Jxo/JFaNYR/Ot5Vrcm+qhfHNLb633OddboUMFnpJZb1d+s RGJOe2U1v5Vlppct8k425pSGfK4Yydmp8l8xJwziamBCbLK1 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.whiteo.stw.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 On today's platforms the memory savings of putting the remove function in .exit isn't that relevant any more. It only matters for built-in drivers and typically saves a few 100k. The downside is that the driver cannot be unbound at runtime which is ancient and also slightly complicates testing. Also it requires to mark the driver struct with __refdata which is needed to suppress a (W=1) modpost warning: WARNING: modpost: drivers/video/fbdev/omap2/omapfb/displays/connector-hdmi: section mismatch in reference: hdmi_connector_driver+0x4 (section: .data) -> hdmic_remove (section: .exit.text) To simplify matters, move the remove callback to .text and drop .suppress_bind_attrs = true. Signed-off-by: Uwe Kleine-König --- drivers/video/fbdev/omap2/omapfb/displays/connector-hdmi.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/drivers/video/fbdev/omap2/omapfb/displays/connector-hdmi.c b/drivers/video/fbdev/omap2/omapfb/displays/connector-hdmi.c index 8f9ff9fb4ca4..f76664c69481 100644 --- a/drivers/video/fbdev/omap2/omapfb/displays/connector-hdmi.c +++ b/drivers/video/fbdev/omap2/omapfb/displays/connector-hdmi.c @@ -249,7 +249,7 @@ static int hdmic_probe(struct platform_device *pdev) return r; } -static int __exit hdmic_remove(struct platform_device *pdev) +static int hdmic_remove(struct platform_device *pdev) { struct panel_drv_data *ddata = platform_get_drvdata(pdev); struct omap_dss_device *dssdev = &ddata->dssdev; @@ -274,11 +274,10 @@ MODULE_DEVICE_TABLE(of, hdmic_of_match); static struct platform_driver hdmi_connector_driver = { .probe = hdmic_probe, - .remove = __exit_p(hdmic_remove), + .remove = hdmic_remove, .driver = { .name = "connector-hdmi", .of_match_table = hdmic_of_match, - .suppress_bind_attrs = true, }, }; From patchwork Tue Nov 7 09:17: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: 742111 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 D550CC05031 for ; Tue, 7 Nov 2023 09:20:36 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233836AbjKGJUh (ORCPT ); Tue, 7 Nov 2023 04:20:37 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36896 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233843AbjKGJUb (ORCPT ); Tue, 7 Nov 2023 04:20:31 -0500 Received: from metis.whiteo.stw.pengutronix.de (metis.whiteo.stw.pengutronix.de [IPv6:2a0a:edc0:2:b01:1d::104]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E5577D57 for ; Tue, 7 Nov 2023 01:20:28 -0800 (PST) Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.whiteo.stw.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1r0IG2-0000O8-Tq; Tue, 07 Nov 2023 10:20:26 +0100 Received: from [2a0a:edc0:0:900:1d::77] (helo=ptz.office.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1r0IG2-007FmC-BZ; Tue, 07 Nov 2023 10:20:26 +0100 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1r0IG2-00ENWq-2a; Tue, 07 Nov 2023 10:20:26 +0100 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Helge Deller Cc: linux-omap@vger.kernel.org, linux-fbdev@vger.kernel.org, dri-devel@lists.freedesktop.org, kernel@pengutronix.de Subject: [PATCH 11/22] fb: omapfb/tpd12s015: Don't put .remove() in .exit.text and drop suppress_bind_attrs Date: Tue, 7 Nov 2023 10:17:52 +0100 Message-ID: <20231107091740.3924258-12-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.42.0.586.gbc5204569f7d.dirty In-Reply-To: <20231107091740.3924258-1-u.kleine-koenig@pengutronix.de> References: <20231107091740.3924258-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1869; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=+EqOB+/Jr7h5U7Lf9U9AqsgTpbQoAHyE7ipebXePpMw=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBlSgDBXNYBzZzZMgAUhBXZszcuvtFuF3bJ8Twlq xoTsCP9hJeJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZUoAwQAKCRCPgPtYfRL+ Ts2kB/4nTfcOnjK8NG8JMU/RLTsa/XKMju3pu+bijBv4mdQ6X5zQaSyZwfZ5vYHvMCVt3S6vxi/ AXTO8HXVoEZ3tj945p9A3/QGmLRfLe4iKYcyaCRSjS3IYIH+6alnAZEaiTOvOiRbPrlIlCl+JRb T41fKFiWv5VqxW46ZbGgUE+UicEgeBjzRuquxqQUsDVt+hNDTDKLTT+LcbnMoz3sLo7BGOMiHw7 H5PUSM2s9tGC9qSbt9T6js4lW0+5J6WFxpHvJNbqvCNmYitK9b284VphkoLLwYOlytoXGkRxfjR gHQH0Jg2hzAC4WjebqIRIe+z+wTffxkDVceDO+T7IZ6eiP02 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.whiteo.stw.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 On today's platforms the memory savings of putting the remove function in .exit isn't that relevant any more. It only matters for built-in drivers and typically saves a few 100k. The downside is that the driver cannot be unbound at runtime which is ancient and also slightly complicates testing. Also it requires to mark the driver struct with __refdata which is needed to suppress a (W=1) modpost warning: WARNING: modpost: drivers/video/fbdev/omap2/omapfb/displays/encoder-tpd12s015: section mismatch in reference: tpd_driver+0x4 (section: .data) -> tpd_remove (section: .exit.text) To simplify matters, move the remove callback to .text and drop .suppress_bind_attrs = true. Signed-off-by: Uwe Kleine-König --- .../video/fbdev/omap2/omapfb/displays/encoder-tpd12s015.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/drivers/video/fbdev/omap2/omapfb/displays/encoder-tpd12s015.c b/drivers/video/fbdev/omap2/omapfb/displays/encoder-tpd12s015.c index 67f0c9250e9e..0bdedc0f6527 100644 --- a/drivers/video/fbdev/omap2/omapfb/displays/encoder-tpd12s015.c +++ b/drivers/video/fbdev/omap2/omapfb/displays/encoder-tpd12s015.c @@ -283,7 +283,7 @@ static int tpd_probe(struct platform_device *pdev) return r; } -static int __exit tpd_remove(struct platform_device *pdev) +static int tpd_remove(struct platform_device *pdev) { struct panel_drv_data *ddata = platform_get_drvdata(pdev); struct omap_dss_device *dssdev = &ddata->dssdev; @@ -313,11 +313,10 @@ MODULE_DEVICE_TABLE(of, tpd_of_match); static struct platform_driver tpd_driver = { .probe = tpd_probe, - .remove = __exit_p(tpd_remove), + .remove = tpd_remove, .driver = { .name = "tpd12s015", .of_match_table = tpd_of_match, - .suppress_bind_attrs = true, }, }; From patchwork Tue Nov 7 09:17: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: 742109 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 96864C04A92 for ; Tue, 7 Nov 2023 09:20:40 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233862AbjKGJUl (ORCPT ); Tue, 7 Nov 2023 04:20:41 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36534 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233886AbjKGJUc (ORCPT ); Tue, 7 Nov 2023 04:20:32 -0500 Received: from metis.whiteo.stw.pengutronix.de (metis.whiteo.stw.pengutronix.de [IPv6:2a0a:edc0:2:b01:1d::104]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 236D5D7D for ; Tue, 7 Nov 2023 01:20:30 -0800 (PST) Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.whiteo.stw.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1r0IG3-0000Or-3K; Tue, 07 Nov 2023 10:20:27 +0100 Received: from [2a0a:edc0:0:900:1d::77] (helo=ptz.office.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1r0IG2-007FmG-IT; Tue, 07 Nov 2023 10:20:26 +0100 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1r0IG2-00ENWu-9L; Tue, 07 Nov 2023 10:20:26 +0100 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Helge Deller Cc: Thomas Zimmermann , Sam Ravnborg , Atul Raut , Javier Martinez Canillas , linux-fbdev@vger.kernel.org, dri-devel@lists.freedesktop.org, kernel@pengutronix.de Subject: [PATCH 12/22] fb: amifb: Convert to platform remove callback returning void Date: Tue, 7 Nov 2023 10:17:53 +0100 Message-ID: <20231107091740.3924258-13-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.42.0.586.gbc5204569f7d.dirty In-Reply-To: <20231107091740.3924258-1-u.kleine-koenig@pengutronix.de> References: <20231107091740.3924258-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1645; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=LBrHk7l/sRzpT17sNdGsTjRIKe97lngNxP0AN4wUMRA=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBlSgDCS2rN+KI+7vqLW4uiMwg40fkTfk87P0Luv v4WpuAz2HqJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZUoAwgAKCRCPgPtYfRL+ TteCB/kBUZQ4MTFblNL0O0JCsu+Tau4uDAI/yiUtqy71MQYA8Tb892NzRk9ubqkq4NwgtV3jx/Z lskA5802bwg/5ZoEeUMS/ursiDR7LPmyQPgAC71Dpy3CC7xjv6LM9u5mrJfI9bCGT5GtwiYUIdF 6bSx60oTcHlSMXvvy3Knmw0au3ir7LBIiReAN4PNOCIVg12XneKq2S1DCgvKjHzyBn0uHobBv7n KQR+zvZ/aLJuEFWQvthihfHhLmPJ6CCgl/mxoNK02RM+apJYCqJEmL0ZcHt6+wRFv6o7I/BvoHX VUrZsVMYLCSKsZXIoFVKKzTBzPiDg90L4aqd34nHgwNTrFWd 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.whiteo.stw.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 ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new(), which already returns void. Eventually after all drivers are converted, .remove_new() will be renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König --- drivers/video/fbdev/amifb.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/drivers/video/fbdev/amifb.c b/drivers/video/fbdev/amifb.c index 85da43034166..8ff5d0e0b6e9 100644 --- a/drivers/video/fbdev/amifb.c +++ b/drivers/video/fbdev/amifb.c @@ -3752,7 +3752,7 @@ static int amifb_probe(struct platform_device *pdev) } -static int amifb_remove(struct platform_device *pdev) +static void amifb_remove(struct platform_device *pdev) { struct fb_info *info = platform_get_drvdata(pdev); @@ -3765,12 +3765,11 @@ static int amifb_remove(struct platform_device *pdev) chipfree(); framebuffer_release(info); amifb_video_off(); - return 0; } static struct platform_driver amifb_driver = { .probe = amifb_probe, - .remove = amifb_remove, + .remove_new = amifb_remove, .driver = { .name = "amiga-video", }, From patchwork Tue Nov 7 09:17: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: 742110 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 BDC08C064F9 for ; Tue, 7 Nov 2023 09:20:37 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233840AbjKGJUi (ORCPT ); Tue, 7 Nov 2023 04:20:38 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36908 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233856AbjKGJUc (ORCPT ); Tue, 7 Nov 2023 04:20:32 -0500 Received: from metis.whiteo.stw.pengutronix.de (metis.whiteo.stw.pengutronix.de [IPv6:2a0a:edc0:2:b01:1d::104]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 912B4D76 for ; Tue, 7 Nov 2023 01:20:29 -0800 (PST) Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.whiteo.stw.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1r0IG3-0000Pa-DK; Tue, 07 Nov 2023 10:20:27 +0100 Received: from [2a0a:edc0:0:900:1d::77] (helo=ptz.office.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1r0IG2-007FmO-Vu; Tue, 07 Nov 2023 10:20:26 +0100 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1r0IG2-00ENX2-Ms; Tue, 07 Nov 2023 10:20:26 +0100 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Helge Deller Cc: Dmitry Torokhov , linux-omap@vger.kernel.org, linux-fbdev@vger.kernel.org, dri-devel@lists.freedesktop.org, kernel@pengutronix.de Subject: [PATCH 14/22] fb: omapfb/analog-tv: Convert to platform remove callback returning void Date: Tue, 7 Nov 2023 10:17:55 +0100 Message-ID: <20231107091740.3924258-15-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.42.0.586.gbc5204569f7d.dirty In-Reply-To: <20231107091740.3924258-1-u.kleine-koenig@pengutronix.de> References: <20231107091740.3924258-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=2026; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=dB2WKH713zLP8NUARnGfLjCRIuWrBLPZZmrZZr0SFn0=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBlSgDEDREJ/PM5MOq54IEhGUjg/3af7FQx6t0i+ 0RzAScm84uJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZUoAxAAKCRCPgPtYfRL+ TgQVB/0VOx5/61K2bSaTayyX+M5DBql1gcFG5SmSftRim9kWoUgXaQN2kAawRjcIpUW6a4e+ugx OWelAbvuzoDGYP1IPNs+188MqNePjg0KqQ6zLbZ+1V/giL1oUZObf4o3cTNN2JpOMsa/Egy9EjC MI4ff/6tQAOsSLr2bchMFFqZNNlSRp+kxXBJ3cUDThk27gBA0Hf1kiSmDSZgjxx+cqlhgdKQmRh H4wiLdhKTslTVMWPy9nsl5dJG+I9k+X4RvKSq1Vpxme9cHL6JbHIjgFWLIqWUqbAUrsv8S1Y+0R dBYFZBBM+yL27K0BZJo9vDbha3+ahhXvtHdywkY1Te2ZYRd3 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.whiteo.stw.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 ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new(), which already returns void. Eventually after all drivers are converted, .remove_new() will be renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König --- .../video/fbdev/omap2/omapfb/displays/connector-analog-tv.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/video/fbdev/omap2/omapfb/displays/connector-analog-tv.c b/drivers/video/fbdev/omap2/omapfb/displays/connector-analog-tv.c index 85fa58f48a81..c6786726a1af 100644 --- a/drivers/video/fbdev/omap2/omapfb/displays/connector-analog-tv.c +++ b/drivers/video/fbdev/omap2/omapfb/displays/connector-analog-tv.c @@ -221,7 +221,7 @@ static int tvc_probe(struct platform_device *pdev) return r; } -static int tvc_remove(struct platform_device *pdev) +static void tvc_remove(struct platform_device *pdev) { struct panel_drv_data *ddata = platform_get_drvdata(pdev); struct omap_dss_device *dssdev = &ddata->dssdev; @@ -233,8 +233,6 @@ static int tvc_remove(struct platform_device *pdev) tvc_disconnect(dssdev); omap_dss_put_device(in); - - return 0; } static const struct of_device_id tvc_of_match[] = { @@ -247,7 +245,7 @@ MODULE_DEVICE_TABLE(of, tvc_of_match); static struct platform_driver tvc_connector_driver = { .probe = tvc_probe, - .remove = tvc_remove, + .remove_new = tvc_remove, .driver = { .name = "connector-analog-tv", .of_match_table = tvc_of_match, From patchwork Tue Nov 7 09:17: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: 742104 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 BFE74C05021 for ; Tue, 7 Nov 2023 09:20:46 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233924AbjKGJUr (ORCPT ); Tue, 7 Nov 2023 04:20:47 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53908 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233949AbjKGJUm (ORCPT ); Tue, 7 Nov 2023 04:20:42 -0500 Received: from metis.whiteo.stw.pengutronix.de (metis.whiteo.stw.pengutronix.de [IPv6:2a0a:edc0:2:b01:1d::104]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A7E7510A for ; Tue, 7 Nov 2023 01:20:39 -0800 (PST) Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.whiteo.stw.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1r0IG3-0000Qc-Rw; Tue, 07 Nov 2023 10:20:27 +0100 Received: from [2a0a:edc0:0:900:1d::77] (helo=ptz.office.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1r0IG3-007FmX-Di; Tue, 07 Nov 2023 10:20:27 +0100 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1r0IG3-00ENXA-4R; Tue, 07 Nov 2023 10:20:27 +0100 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Helge Deller Cc: Thomas Zimmermann , Rob Herring , Daniel Thompson , Stephen Kitt , Dmitry Torokhov , linux-omap@vger.kernel.org, linux-fbdev@vger.kernel.org, dri-devel@lists.freedesktop.org, kernel@pengutronix.de Subject: [PATCH 16/22] fb: omapfb/dsi-cm: Convert to platform remove callback returning void Date: Tue, 7 Nov 2023 10:17:57 +0100 Message-ID: <20231107091740.3924258-17-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.42.0.586.gbc5204569f7d.dirty In-Reply-To: <20231107091740.3924258-1-u.kleine-koenig@pengutronix.de> References: <20231107091740.3924258-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=2039; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=e0Qp8Mzev9tJy80jW14t6QgdBEilj1ekKxboi794jkg=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBlSgDHOc1KmUnvtjV9FhR3XDKSohtWCpS9PjSQC hPlo3MceJ2JATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZUoAxwAKCRCPgPtYfRL+ ThpcCACTmKhjY5Y8PQxqZBu96y/4++7lyx+lo3zY60Q2EScViWqTM2ulaZE6yKPvQqZpQBVzsqg MPYTdbTBwRhjOD6HpcTvQFjBzyynl6FqRWrG69ryeY5S1VPfFS/LOhXf7iucfpVHxtwbqLBZgy5 9Jetk5R1BLl6GCNJ4AK08GGGqgbJBUTpn1DAC0MqiJKtDDSqq1EMfNxBXAI8nJ43pkIn8aGLd3p PJH17b7joZUBp8GAdM6eqILg4kyeJKD0VjEJxm479Mr3yYdJcUk4cFvpxiEwWpgmm7sjnew3y4E os25MTUKJ/ZyzvIEZrBoOeoLKpoZZXmzbOFMXwEIGlPWfHWs 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.whiteo.stw.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 ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new(), which already returns void. Eventually after all drivers are converted, .remove_new() will be renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König --- drivers/video/fbdev/omap2/omapfb/displays/panel-dsi-cm.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/video/fbdev/omap2/omapfb/displays/panel-dsi-cm.c b/drivers/video/fbdev/omap2/omapfb/displays/panel-dsi-cm.c index 3d0978167144..adb8881bac28 100644 --- a/drivers/video/fbdev/omap2/omapfb/displays/panel-dsi-cm.c +++ b/drivers/video/fbdev/omap2/omapfb/displays/panel-dsi-cm.c @@ -1241,7 +1241,7 @@ static int dsicm_probe(struct platform_device *pdev) return r; } -static int dsicm_remove(struct platform_device *pdev) +static void dsicm_remove(struct platform_device *pdev) { struct panel_drv_data *ddata = platform_get_drvdata(pdev); struct omap_dss_device *dssdev = &ddata->dssdev; @@ -1269,8 +1269,6 @@ static int dsicm_remove(struct platform_device *pdev) /* reset, to be sure that the panel is in a valid state */ dsicm_hw_reset(ddata); - - return 0; } static const struct of_device_id dsicm_of_match[] = { @@ -1282,7 +1280,7 @@ MODULE_DEVICE_TABLE(of, dsicm_of_match); static struct platform_driver dsicm_driver = { .probe = dsicm_probe, - .remove = dsicm_remove, + .remove_new = dsicm_remove, .driver = { .name = "panel-dsi-cm", .of_match_table = dsicm_of_match, From patchwork Tue Nov 7 09:17: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: 742108 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 3D21FC04A95 for ; Tue, 7 Nov 2023 09:20:42 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233892AbjKGJUn (ORCPT ); Tue, 7 Nov 2023 04:20:43 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37392 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233873AbjKGJUc (ORCPT ); Tue, 7 Nov 2023 04:20:32 -0500 Received: from metis.whiteo.stw.pengutronix.de (metis.whiteo.stw.pengutronix.de [IPv6:2a0a:edc0:2:b01:1d::104]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 588E610C1 for ; Tue, 7 Nov 2023 01:20:30 -0800 (PST) Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.whiteo.stw.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1r0IG4-0000Ss-8B; Tue, 07 Nov 2023 10:20:28 +0100 Received: from [2a0a:edc0:0:900:1d::77] (helo=ptz.office.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1r0IG3-007Fmf-RF; Tue, 07 Nov 2023 10:20:27 +0100 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1r0IG3-00ENXI-I9; Tue, 07 Nov 2023 10:20:27 +0100 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Helge Deller Cc: Dmitry Torokhov , linux-omap@vger.kernel.org, linux-fbdev@vger.kernel.org, dri-devel@lists.freedesktop.org, kernel@pengutronix.de Subject: [PATCH 18/22] fb: omapfb/hdmi: Convert to platform remove callback returning void Date: Tue, 7 Nov 2023 10:17:59 +0100 Message-ID: <20231107091740.3924258-19-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.42.0.586.gbc5204569f7d.dirty In-Reply-To: <20231107091740.3924258-1-u.kleine-koenig@pengutronix.de> References: <20231107091740.3924258-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=2023; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=xWbGIn+BzZqEtH7/bA8op5YgNyNIlQGBx+Rz6eesPWY=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBlSgDJGCKv77wwzS97/yWuJ2zcnnNtRXoiTXA4R BSD6BzpCXCJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZUoAyQAKCRCPgPtYfRL+ TvCzB/0YqUTNHVj8AZjj7ytJ0MsANp3wXVcTnsnKqrxJmMZXtEkqFe55RIao2D3pU62JMQj64ID x2EH8Oj750FmnzxFhzk9ZDsSBqdans3FeOQuWsIw/BqtJhWQeYsdI8ECl964s/R8rQW/Sx8gzZJ kpkdoFCoj3Ri1UVcuTYEpjDeQMf59qCoZZJWi5PnkiyZYjwM5iHnrbIJEgh6rCppsNIaoHDyJdR JE/+h/KaTNQ4fWsZjj297E0lWSKoWd0pJjdCPF3JFHkMXWTkRi06h+V8orgGFWC9E4HAJgPscEH SSYRfqvNlfb4fBkO7ImWXApN/JCm8GLUjMndfUSOWAtRmnkB 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.whiteo.stw.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 ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new(), which already returns void. Eventually after all drivers are converted, .remove_new() will be renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König --- drivers/video/fbdev/omap2/omapfb/displays/connector-hdmi.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/video/fbdev/omap2/omapfb/displays/connector-hdmi.c b/drivers/video/fbdev/omap2/omapfb/displays/connector-hdmi.c index f76664c69481..b862a32670ae 100644 --- a/drivers/video/fbdev/omap2/omapfb/displays/connector-hdmi.c +++ b/drivers/video/fbdev/omap2/omapfb/displays/connector-hdmi.c @@ -249,7 +249,7 @@ static int hdmic_probe(struct platform_device *pdev) return r; } -static int hdmic_remove(struct platform_device *pdev) +static void hdmic_remove(struct platform_device *pdev) { struct panel_drv_data *ddata = platform_get_drvdata(pdev); struct omap_dss_device *dssdev = &ddata->dssdev; @@ -261,8 +261,6 @@ static int hdmic_remove(struct platform_device *pdev) hdmic_disconnect(dssdev); omap_dss_put_device(in); - - return 0; } static const struct of_device_id hdmic_of_match[] = { @@ -274,7 +272,7 @@ MODULE_DEVICE_TABLE(of, hdmic_of_match); static struct platform_driver hdmi_connector_driver = { .probe = hdmic_probe, - .remove = hdmic_remove, + .remove_new = hdmic_remove, .driver = { .name = "connector-hdmi", .of_match_table = hdmic_of_match, From patchwork Tue Nov 7 09:18: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: 742107 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 985EAC4167B for ; Tue, 7 Nov 2023 09:20:43 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233890AbjKGJUo (ORCPT ); Tue, 7 Nov 2023 04:20:44 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36942 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233897AbjKGJUd (ORCPT ); Tue, 7 Nov 2023 04:20:33 -0500 Received: from metis.whiteo.stw.pengutronix.de (metis.whiteo.stw.pengutronix.de [IPv6:2a0a:edc0:2:b01:1d::104]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7B31210C2 for ; Tue, 7 Nov 2023 01:20:30 -0800 (PST) Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.whiteo.stw.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1r0IG4-0000TI-Df; Tue, 07 Nov 2023 10:20:28 +0100 Received: from [2a0a:edc0:0:900:1d::77] (helo=ptz.office.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1r0IG4-007Fmj-0s; Tue, 07 Nov 2023 10:20:28 +0100 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1r0IG3-00ENXM-O8; Tue, 07 Nov 2023 10:20:27 +0100 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Helge Deller Cc: Dmitry Torokhov , linux-omap@vger.kernel.org, linux-fbdev@vger.kernel.org, dri-devel@lists.freedesktop.org, kernel@pengutronix.de Subject: [PATCH 19/22] fb: omapfb/opa362: Convert to platform remove callback returning void Date: Tue, 7 Nov 2023 10:18:00 +0100 Message-ID: <20231107091740.3924258-20-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.42.0.586.gbc5204569f7d.dirty In-Reply-To: <20231107091740.3924258-1-u.kleine-koenig@pengutronix.de> References: <20231107091740.3924258-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=2042; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=y82hh1cU5X7eF1j5G9DB/De2QOkfIzaWhfPbOFdvfxQ=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBlSgDKn5eqiqHmhV2l+yU0aadfm9ovQplPUV12B +iiPPJfOFaJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZUoAygAKCRCPgPtYfRL+ TpB9CACPX/ZR47uYw0+a97b5xLZnqlggbhMZWkNkgDfZVRVk7XzA20Pf/vJJjdixzkHFPE0otOx LDuPe/PO7BNWgMZnL5cX/unTSU5CYSyjvDR4WXhxkfvUOy0qtbYz3x9dSHdYY3dBHM7Hziffwv6 9WAPRp2sYiZdpMyEQ7YNBQFCg2I4JAvkp7sKBech5FIg0+ca2koBfM1RrcUMrmffGdf/w/tg2vn DsjW0m3NIEa7hCGhgNhZvcb/qfvc2oP2QrAZk1F+6ylaUQ2rEIPLV1/A7XN0HpC8LXedkp8OqI/ +Lh6VRs9cvrPqQYjzKC8jIQMxa1/xiORundCPFfvY4ZGrhSi 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.whiteo.stw.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 ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new(), which already returns void. Eventually after all drivers are converted, .remove_new() will be renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König --- drivers/video/fbdev/omap2/omapfb/displays/encoder-opa362.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/video/fbdev/omap2/omapfb/displays/encoder-opa362.c b/drivers/video/fbdev/omap2/omapfb/displays/encoder-opa362.c index 866d71489358..f0d3eb581166 100644 --- a/drivers/video/fbdev/omap2/omapfb/displays/encoder-opa362.c +++ b/drivers/video/fbdev/omap2/omapfb/displays/encoder-opa362.c @@ -231,7 +231,7 @@ static int opa362_probe(struct platform_device *pdev) return r; } -static int opa362_remove(struct platform_device *pdev) +static void opa362_remove(struct platform_device *pdev) { struct panel_drv_data *ddata = platform_get_drvdata(pdev); struct omap_dss_device *dssdev = &ddata->dssdev; @@ -248,8 +248,6 @@ static int opa362_remove(struct platform_device *pdev) opa362_disconnect(dssdev, dssdev->dst); omap_dss_put_device(in); - - return 0; } static const struct of_device_id opa362_of_match[] = { @@ -260,7 +258,7 @@ MODULE_DEVICE_TABLE(of, opa362_of_match); static struct platform_driver opa362_driver = { .probe = opa362_probe, - .remove = opa362_remove, + .remove_new = opa362_remove, .driver = { .name = "amplifier-opa362", .of_match_table = opa362_of_match, From patchwork Tue Nov 7 09:18: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: 742105 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 0D9C4C05022 for ; Tue, 7 Nov 2023 09:20:45 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233908AbjKGJUp (ORCPT ); Tue, 7 Nov 2023 04:20:45 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36982 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233927AbjKGJUd (ORCPT ); Tue, 7 Nov 2023 04:20:33 -0500 Received: from metis.whiteo.stw.pengutronix.de (metis.whiteo.stw.pengutronix.de [IPv6:2a0a:edc0:2:b01:1d::104]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C1F64113 for ; Tue, 7 Nov 2023 01:20:30 -0800 (PST) Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.whiteo.stw.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1r0IG4-0000To-Me; Tue, 07 Nov 2023 10:20:28 +0100 Received: from [2a0a:edc0:0:900:1d::77] (helo=ptz.office.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1r0IG4-007Fmn-6v; Tue, 07 Nov 2023 10:20:28 +0100 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1r0IG3-00ENXP-U1; Tue, 07 Nov 2023 10:20:27 +0100 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Helge Deller Cc: Dmitry Torokhov , linux-omap@vger.kernel.org, linux-fbdev@vger.kernel.org, dri-devel@lists.freedesktop.org, kernel@pengutronix.de Subject: [PATCH 20/22] fb: omapfb/sharp-ls037v7dw01: Convert to platform remove callback returning void Date: Tue, 7 Nov 2023 10:18:01 +0100 Message-ID: <20231107091740.3924258-21-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.42.0.586.gbc5204569f7d.dirty In-Reply-To: <20231107091740.3924258-1-u.kleine-koenig@pengutronix.de> References: <20231107091740.3924258-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=2096; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=oLlKWztgQ/yvbvZLWuFb+P5sTKuar0OzPBryNUb0awE=; b=owEBbAGT/pANAwAKAY+A+1h9Ev5OAcsmYgBlSgDLcfIWbCAOhYblQRLZcn8q4JWB5ADmWE7mH YxLBiREhOyJATIEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZUoAywAKCRCPgPtYfRL+ TreAB/iadu6EKi8XGrFpkJgNKSZvvnVYOTIgQqTFzJzyv6RYpx6bEpK1xboVWXKlwLvROwpBmgk NeVTW8ed0DxLJWo0qrD0EULtSWSnQ9T4/vLfyQ8qjxFS7YSjF07BbKMBKwJZwSWrSKlCcMm/HWI tvt57wQnp0u8Xf5MXgAzFhgswErytk0jSQxAzZTVhuPAwh0nxJ6yJFP9eZdO1ncwJwQeHmQplWC SNFpNjkbXkovXdhfIt8licHFWRJi6+x8DnieOpxOJs6IOrpCpLV2vcMBt0Yy9bH6U3fJOluvrB4 Ju7MaMvqwFy67lSVaCErd7OoaI6DfmCp9T33Fj3FqwANUd4= 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.whiteo.stw.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 ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new(), which already returns void. Eventually after all drivers are converted, .remove_new() will be renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König --- .../fbdev/omap2/omapfb/displays/panel-sharp-ls037v7dw01.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/video/fbdev/omap2/omapfb/displays/panel-sharp-ls037v7dw01.c b/drivers/video/fbdev/omap2/omapfb/displays/panel-sharp-ls037v7dw01.c index d228d74f3bd5..e37268cf8dca 100644 --- a/drivers/video/fbdev/omap2/omapfb/displays/panel-sharp-ls037v7dw01.c +++ b/drivers/video/fbdev/omap2/omapfb/displays/panel-sharp-ls037v7dw01.c @@ -292,7 +292,7 @@ static int sharp_ls_probe(struct platform_device *pdev) return r; } -static int sharp_ls_remove(struct platform_device *pdev) +static void sharp_ls_remove(struct platform_device *pdev) { struct panel_drv_data *ddata = platform_get_drvdata(pdev); struct omap_dss_device *dssdev = &ddata->dssdev; @@ -304,8 +304,6 @@ static int sharp_ls_remove(struct platform_device *pdev) sharp_ls_disconnect(dssdev); omap_dss_put_device(in); - - return 0; } static const struct of_device_id sharp_ls_of_match[] = { @@ -317,7 +315,7 @@ MODULE_DEVICE_TABLE(of, sharp_ls_of_match); static struct platform_driver sharp_ls_driver = { .probe = sharp_ls_probe, - .remove = sharp_ls_remove, + .remove_new = sharp_ls_remove, .driver = { .name = "panel-sharp-ls037v7dw01", .of_match_table = sharp_ls_of_match, From patchwork Tue Nov 7 09:18: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: 742106 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 97BB0C04E83 for ; Tue, 7 Nov 2023 09:20:42 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233779AbjKGJUn (ORCPT ); Tue, 7 Nov 2023 04:20:43 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36948 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233910AbjKGJUd (ORCPT ); Tue, 7 Nov 2023 04:20:33 -0500 Received: from metis.whiteo.stw.pengutronix.de (metis.whiteo.stw.pengutronix.de [IPv6:2a0a:edc0:2:b01:1d::104]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D956D10C7 for ; Tue, 7 Nov 2023 01:20:30 -0800 (PST) Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.whiteo.stw.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1r0IG4-0000Tx-Qy; Tue, 07 Nov 2023 10:20:28 +0100 Received: from [2a0a:edc0:0:900:1d::77] (helo=ptz.office.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1r0IG4-007Fmr-Db; Tue, 07 Nov 2023 10:20:28 +0100 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1r0IG4-00ENXU-4e; Tue, 07 Nov 2023 10:20:28 +0100 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Helge Deller Cc: Dmitry Torokhov , linux-omap@vger.kernel.org, linux-fbdev@vger.kernel.org, dri-devel@lists.freedesktop.org, kernel@pengutronix.de Subject: [PATCH 21/22] fb: omapfb/tfp410: Convert to platform remove callback returning void Date: Tue, 7 Nov 2023 10:18:02 +0100 Message-ID: <20231107091740.3924258-22-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.42.0.586.gbc5204569f7d.dirty In-Reply-To: <20231107091740.3924258-1-u.kleine-koenig@pengutronix.de> References: <20231107091740.3924258-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=2032; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=cTpvFEXEs/xZYr1YFQ7IKksKDwg1iZTcDxeI9sqrcDQ=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBlSgDMg2LvECF65IAiO+tomv5dbeWO3rfrD9h8Z ggz1aDrs3qJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZUoAzAAKCRCPgPtYfRL+ Tu43B/42n8HcVLcRKw5sDZCT2caPWf1vkH6K7OCftltrRjx5E4Co1QgciCT7uUqefRo/QIONEcB bU3FLO7PeisBjFXRm1QrSvKA0b3uA+uImrUaPkwvYSTX6cu/TeArZyO3Ibgk+W6y0n+JEhIQMYl 9fUdVXkMZioARk/sF09Vi9XUs4GEOc8OK+vWHg96owboXU9v1TkcGiYjPD+ttXdFdFuTHonpNDs OOOHTm77rNf9mXioS8AxVo6jiO1i9DqtYNDLnzVcoEWuUTeP4NdP8ZOlDkzUy3Z7Pi/je3701y7 4hVcYwb+QVXedaP3SusTOnVe6HKfEF0g6z+THbmQGhwe8Bho 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.whiteo.stw.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 ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new(), which already returns void. Eventually after all drivers are converted, .remove_new() will be renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König --- drivers/video/fbdev/omap2/omapfb/displays/encoder-tfp410.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/video/fbdev/omap2/omapfb/displays/encoder-tfp410.c b/drivers/video/fbdev/omap2/omapfb/displays/encoder-tfp410.c index 6aa21afc8b21..c8aca4592949 100644 --- a/drivers/video/fbdev/omap2/omapfb/displays/encoder-tfp410.c +++ b/drivers/video/fbdev/omap2/omapfb/displays/encoder-tfp410.c @@ -217,7 +217,7 @@ static int tfp410_probe(struct platform_device *pdev) return r; } -static int tfp410_remove(struct platform_device *pdev) +static void tfp410_remove(struct platform_device *pdev) { struct panel_drv_data *ddata = platform_get_drvdata(pdev); struct omap_dss_device *dssdev = &ddata->dssdev; @@ -234,8 +234,6 @@ static int tfp410_remove(struct platform_device *pdev) tfp410_disconnect(dssdev, dssdev->dst); omap_dss_put_device(in); - - return 0; } static const struct of_device_id tfp410_of_match[] = { @@ -247,7 +245,7 @@ MODULE_DEVICE_TABLE(of, tfp410_of_match); static struct platform_driver tfp410_driver = { .probe = tfp410_probe, - .remove = tfp410_remove, + .remove_new = tfp410_remove, .driver = { .name = "tfp410", .of_match_table = tfp410_of_match,