From patchwork Tue Nov 7 09:17: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: 742509 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 3CE89C04A92 for ; Tue, 7 Nov 2023 09:20:34 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233701AbjKGJUe (ORCPT ); Tue, 7 Nov 2023 04:20:34 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37240 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233732AbjKGJUb (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 578E6129 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-0000Ib-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-007FlR-QR; 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-00ENWF-HE; 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 03/22] fb: omapfb/analog-tv: Don't put .remove() in .exit.text and drop suppress_bind_attrs Date: Tue, 7 Nov 2023 10:17:44 +0100 Message-ID: <20231107091740.3924258-4-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=1909; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=6VdYr8cdlJJ63QMV/RkyaKWVaf+688YzUfimrg2v3tk=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBlSgC4P2sDbLL3y6bXQTgb5LvLYRoJsZExJKfm9 DA5RIcxcCWJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZUoAuAAKCRCPgPtYfRL+ TrY1B/9ebuLqqfSO8Z7tgEuEXMFgL2weyds0kDru8kjmTEkzbpxDd4yaBm74d/gbtIKItSp12i2 v4/9LngrEL3z0qjjjF71G5D3zU+Al9JhTX0iE+aOgWQ9N3RXSjYUzPuT5rt/R6qMhRMuCG9m8ZS lzZz85zCuxWEhCCBu3AyKAJS3ZHfJ60a/ZyYlSaD8LDXNkyDbuKCiKmZJVzCAFtq9XimCCtH5xi N2UjJGX0Xn7Mx5BdENDezFUhALm7DzHjJsWIc8AxM7HPjAsO6mFrKTr0iAoW2L1aYF5BW7K1o5U gPZ+8brn4LijTYETyFiQkjnxTgpaqvYGXbuevcCSjRPv/3nG 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-omap@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-omap@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-analog-tv: section mismatch in reference: tvc_connector_driver+0x4 (section: .data) -> tvc_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/connector-analog-tv.c | 5 ++--- 1 file changed, 2 insertions(+), 3 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 0daaf9f89bab..85fa58f48a81 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 __exit tvc_remove(struct platform_device *pdev) +static int tvc_remove(struct platform_device *pdev) { struct panel_drv_data *ddata = platform_get_drvdata(pdev); struct omap_dss_device *dssdev = &ddata->dssdev; @@ -247,11 +247,10 @@ MODULE_DEVICE_TABLE(of, tvc_of_match); static struct platform_driver tvc_connector_driver = { .probe = tvc_probe, - .remove = __exit_p(tvc_remove), + .remove = tvc_remove, .driver = { .name = "connector-analog-tv", .of_match_table = tvc_of_match, - .suppress_bind_attrs = true, }, }; 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: 742164 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 C1BB6C4708E for ; Tue, 7 Nov 2023 09:20:33 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233714AbjKGJUe (ORCPT ); Tue, 7 Nov 2023 04:20:34 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37224 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233701AbjKGJUb (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 5767810A 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-omap@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-omap@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: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: 742502 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 AE32EC04FDE for ; Tue, 7 Nov 2023 09:20:43 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233853AbjKGJUo (ORCPT ); Tue, 7 Nov 2023 04:20:44 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45556 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233938AbjKGJUh (ORCPT ); Tue, 7 Nov 2023 04:20:37 -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 E673BC6 for ; Tue, 7 Nov 2023 01:20:34 -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-0000JA-K1; 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-007FlX-73; 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-00ENWS-U5; Tue, 07 Nov 2023 10:20:24 +0100 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Helge Deller Cc: Daniel Thompson , Stephen Kitt , Rob Herring , Dmitry Torokhov , linux-omap@vger.kernel.org, linux-fbdev@vger.kernel.org, dri-devel@lists.freedesktop.org, kernel@pengutronix.de Subject: [PATCH 05/22] fb: omapfb/dsi-cm: Don't put .remove() in .exit.text and drop suppress_bind_attrs Date: Tue, 7 Nov 2023 10:17:46 +0100 Message-ID: <20231107091740.3924258-6-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=lWi5VgjEId1UcqZ24j1OBiFWpDaEIBXzQX3aIqOZI/A=; b=owGbwMvMwMXY3/A7olbonx/jabUkhlQvhl3nnuztuJt1OvR4hmV06ew4HXGm+uCbnZ5iK0wnv vt/gzulk9GYhYGRi0FWTJHFvnFNplWVXGTn2n+XYQaxMoFMYeDiFICJfP7C/j+V/9S14+xffu65 s/nUbe2YxVOFw891WYR/Ef0TZNhenvqyPVJuf8RH87a+w/HyDOH6Px7qc5x8pdJmknOlnV1T/Fr tXeFXkRdra7486OCYZ/eY3f/rqsrH5Tem8/mwJLT7XGSVFm5vrXnUbdUTsCB4QjOz+mpn9u1XHd XcL72Z0Vvw60xmVOiMNbHhc1qa7k7r07SdmTUjR0dRzvqklZ+BH1tziF2mgXz5jh1lVnvFWl8c/ s6j/0nqtoqigzbbvZi+reeTtVsbN6zXmGvD+nubhfj6uykMtxbKCBxettlBXnWB1rbC7sAPKyeZ ZJ/9qrHVQ963LGrpjhnvAyW7lStn2boFRpdM+RNy4nk6AA== 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-omap@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-omap@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-dsi-cm: section mismatch in reference: dsicm_driver+0x4 (section: .data) -> dsicm_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-dsi-cm.c | 5 ++--- 1 file changed, 2 insertions(+), 3 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 77fce1223a64..3d0978167144 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 __exit dsicm_remove(struct platform_device *pdev) +static int dsicm_remove(struct platform_device *pdev) { struct panel_drv_data *ddata = platform_get_drvdata(pdev); struct omap_dss_device *dssdev = &ddata->dssdev; @@ -1282,11 +1282,10 @@ MODULE_DEVICE_TABLE(of, dsicm_of_match); static struct platform_driver dsicm_driver = { .probe = dsicm_probe, - .remove = __exit_p(dsicm_remove), + .remove = dsicm_remove, .driver = { .name = "panel-dsi-cm", .of_match_table = dsicm_of_match, - .suppress_bind_attrs = true, }, }; From patchwork Tue Nov 7 09:17: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: 742510 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 E550DC4167D for ; Tue, 7 Nov 2023 09:20:32 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229536AbjKGJUd (ORCPT ); Tue, 7 Nov 2023 04:20:33 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37344 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233714AbjKGJUb (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 57892127 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-0000JK-PA; 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-007Fld-Ce; 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-00ENWW-3Z; Tue, 07 Nov 2023 10:20:25 +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 06/22] fb: omapfb/dvi: Don't put .remove() in .exit.text and drop suppress_bind_attrs Date: Tue, 7 Nov 2023 10:17:47 +0100 Message-ID: <20231107091740.3924258-7-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=1879; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=T5NKih1NbhRpQaxm+mQiuA7o/X9WnTBakc/jpKl9Xn8=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBlSgC7/uPC3wG1e4Lup0IbRbN4w4ctwBQNPepEq vngqfwWhj2JATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZUoAuwAKCRCPgPtYfRL+ TohdCACBIY/xrrA+m5WzRZlOHbpj0zjkUcUvhhkbk0xU1AZbNBFsrc1uK56oS694AFb18pe2Al+ UUB1DLKqfyzLF2bGk5maqpgDGwNjav7RfApA/Zcxii5Hi3KH582oios/pTpRDraQgcsAxnl4xvJ tH1gPuL4uF80yV5E3A/Z1AdkZBJMfDyHlQlaOybjHbYMrkA7zfD0LpuZsoMAd/4fb0l+AaHfCej Gztip6t8UWXKD4zMfvCeZecYmC9dl4hoaLRxKd9X6BGMEp7HhG2pSbTMVeoC5lHlFb+/ls2Xs/W UQlLXN7jfrJjfUr8gZHYh++cUgnvr/h47x31AT1S5aZMFjtt 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-omap@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-omap@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-dvi: section mismatch in reference: dvi_connector_driver+0x4 (section: .data) -> dvic_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-dvi.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/drivers/video/fbdev/omap2/omapfb/displays/connector-dvi.c b/drivers/video/fbdev/omap2/omapfb/displays/connector-dvi.c index c8ad3ef42bd3..2a5824fe8ea0 100644 --- a/drivers/video/fbdev/omap2/omapfb/displays/connector-dvi.c +++ b/drivers/video/fbdev/omap2/omapfb/displays/connector-dvi.c @@ -303,7 +303,7 @@ static int dvic_probe(struct platform_device *pdev) return r; } -static int __exit dvic_remove(struct platform_device *pdev) +static int dvic_remove(struct platform_device *pdev) { struct panel_drv_data *ddata = platform_get_drvdata(pdev); struct omap_dss_device *dssdev = &ddata->dssdev; @@ -330,11 +330,10 @@ MODULE_DEVICE_TABLE(of, dvic_of_match); static struct platform_driver dvi_connector_driver = { .probe = dvic_probe, - .remove = __exit_p(dvic_remove), + .remove = dvic_remove, .driver = { .name = "connector-dvi", .of_match_table = dvic_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: 742163 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 DFEF9C04A68 for ; Tue, 7 Nov 2023 09:20:34 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233732AbjKGJUf (ORCPT ); Tue, 7 Nov 2023 04:20:35 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36832 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233818AbjKGJUb (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 189FE126 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-omap@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-omap@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: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: 742162 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 12B1DC04FDE for ; Tue, 7 Nov 2023 09:20:36 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233935AbjKGJUh (ORCPT ); Tue, 7 Nov 2023 04:20:37 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37354 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233838AbjKGJUb (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 C825C1B2 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-0000ME-CW; 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-007Flm-PZ; 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-00ENWe-GW; 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 08/22] fb: omapfb/opa362: Don't put .remove() in .exit.text and drop suppress_bind_attrs Date: Tue, 7 Nov 2023 10:17:49 +0100 Message-ID: <20231107091740.3924258-9-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=1892; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=2uqVAKnjy8G96yCeARXFR2Z9OX9BeyxLVK2gJNh8zvE=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBlSgC91cv9ooqFLV7HLsl2cAnYggKE7cFhi1qFm dduevGUcbKJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZUoAvQAKCRCPgPtYfRL+ TvjECACLPZyeomhDC7xZl5XOHtPC+c3zUQ5tm5iOJV+yJpU3o/O7G2buptLMqescHFYUOf+Mlh3 efPFK1EzGUNuWXih8J1nzUHJGu6uf9ez8ADj9b/2hTdCxhWuta3FC4wOc8CspnC0hmlncx/7Dv4 kNbFwBBFq4Bw4n/i8q9KLTHRigVNSHJE48owIM4rgFZzwriMD9m4F0xvjn/GXm/gEOvgZHw8LSl 0G5+/nhWYKYrPiiPlZ+b7l/pc4qR3raEKpH///acpfnWXM+I2YyXSchPiA38c4BmZx35UhWE95g 0OIT8nGXgEdC4/nSO/1lnZRc7fTlfeGoFxgmZpNmw9NrHmql 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-omap@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-omap@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-tfp410: section mismatch in reference: tfp410_driver+0x4 (section: .data) -> tfp410_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/encoder-opa362.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/drivers/video/fbdev/omap2/omapfb/displays/encoder-opa362.c b/drivers/video/fbdev/omap2/omapfb/displays/encoder-opa362.c index dd29dc5c77ec..866d71489358 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 __exit opa362_remove(struct platform_device *pdev) +static int opa362_remove(struct platform_device *pdev) { struct panel_drv_data *ddata = platform_get_drvdata(pdev); struct omap_dss_device *dssdev = &ddata->dssdev; @@ -260,11 +260,10 @@ MODULE_DEVICE_TABLE(of, opa362_of_match); static struct platform_driver opa362_driver = { .probe = opa362_probe, - .remove = __exit_p(opa362_remove), + .remove = opa362_remove, .driver = { .name = "amplifier-opa362", .of_match_table = opa362_of_match, - .suppress_bind_attrs = true, }, }; From patchwork Tue Nov 7 09:17: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: 742508 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 9134DC4167B for ; Tue, 7 Nov 2023 09:20:35 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233818AbjKGJUg (ORCPT ); Tue, 7 Nov 2023 04:20:36 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36854 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233828AbjKGJUb (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 76A77183 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-0000Mr-Jd; 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-007Flt-Vg; 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-00ENWh-MU; 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 09/22] fb: omapfb/sharp-ls037v7dw01: Don't put .remove() in .exit.text and drop suppress_bind_attrs Date: Tue, 7 Nov 2023 10:17:50 +0100 Message-ID: <20231107091740.3924258-10-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=1968; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=U/9ZDJgvqU6qE0Naz4r8+7ZivMDuTfXNDj1sU0OnaQk=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBlSgC+FvYt1uZCYg2wN98HWtUKF/f2Fegtck3db XP2zshR6h+JATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZUoAvgAKCRCPgPtYfRL+ TsRPCACvZrqE26qckByUxcjuRVeNG2h4p2P+5X/szmUx7T/L2ZmHvbFskLIumu1MXwc7B/xmmMy /xZLMLjWo4W42A4LgvL/b+gXr1fgbCTyKhOPR9vvgVDYapy6bNxdGnUi1h4/3r88kEw+G+8SRm1 mzIZC4qd+FCofYGEtB0hMXdZHmZKo30BM9zpox9mjjxCiALMUvju8SNnsGRAcMvoNit96enybte OM+ZK6ML1jZmorfYvUI8ZR9fVXwWF5HDwejAr+iXV7pg6YI+7/+GNKvn3AaamGFys8rCFmAT/RS nd8ick0AvO78mPmaBMzHcxdDwlNviFSa+7Tu0UM5XhYsrVpy 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-omap@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-omap@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-sharp-ls037v7dw01: section mismatch in reference: sharp_ls_driver+0x4 (section: .data) -> sharp_ls_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 --- .../fbdev/omap2/omapfb/displays/panel-sharp-ls037v7dw01.c | 5 ++--- 1 file changed, 2 insertions(+), 3 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 cc30758300e2..d228d74f3bd5 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 __exit sharp_ls_remove(struct platform_device *pdev) +static int sharp_ls_remove(struct platform_device *pdev) { struct panel_drv_data *ddata = platform_get_drvdata(pdev); struct omap_dss_device *dssdev = &ddata->dssdev; @@ -317,11 +317,10 @@ MODULE_DEVICE_TABLE(of, sharp_ls_of_match); static struct platform_driver sharp_ls_driver = { .probe = sharp_ls_probe, - .remove = __exit_p(sharp_ls_remove), + .remove = sharp_ls_remove, .driver = { .name = "panel-sharp-ls037v7dw01", .of_match_table = sharp_ls_of_match, - .suppress_bind_attrs = true, }, }; From patchwork Tue Nov 7 09:17: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: 742161 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 47E4EC05032 for ; Tue, 7 Nov 2023 09:20:37 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233833AbjKGJUi (ORCPT ); Tue, 7 Nov 2023 04:20:38 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37254 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233846AbjKGJUb (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 F268AD6E 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-0000NL-N3; 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-007Fm8-5C; 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 1r0IG1-00ENWl-SQ; 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 10/22] fb: omapfb/tfp410: Don't put .remove() in .exit.text and drop suppress_bind_attrs Date: Tue, 7 Nov 2023 10:17:51 +0100 Message-ID: <20231107091740.3924258-11-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=1882; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=nh7BEwyRZB0tI40Ncwk1U1nReklA/LARc0RKsdVFXj8=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBlSgDAJ4Afkz6QLp//AkocMg1rC0QhENBKPvWnN ryjeQ/CFVWJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZUoAwAAKCRCPgPtYfRL+ TktmCACpRaNDVoOTiLU7iBDUoGstFJXTCmvFCdip4nAxp5WzE1P2hJ/S4XwAmWYQMcwlwpGif4x vlHD8ZdmveGz4nVqZ9sDyccPvvhW49hmbTgbXPHF1JT+UqjCIq7K3rsGjaa+3Azgx2fT/3Emq2Q Zxi+1TQ7svVPaFcp3wJ3GdWu4Mdsvn9voMAVEe906G45fJ73aFD6hV/622lv6fi617nppljzzee 8hYp//jJCRh0v6wZu+dxr3tPiLNi6a0x4VdUbshYBgG+ehy7EhS4+uoMN1zs2eoIure37UGYFN0 eubkOEZR9xGRVscuIYFRg+wFNMskzKXD8J/zQhkqO23GKxxk 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-omap@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-omap@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-tfp410: section mismatch in reference: tfp410_driver+0x4 (section: .data) -> tfp410_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/encoder-tfp410.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/drivers/video/fbdev/omap2/omapfb/displays/encoder-tfp410.c b/drivers/video/fbdev/omap2/omapfb/displays/encoder-tfp410.c index 7bac420169a6..6aa21afc8b21 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 __exit tfp410_remove(struct platform_device *pdev) +static int tfp410_remove(struct platform_device *pdev) { struct panel_drv_data *ddata = platform_get_drvdata(pdev); struct omap_dss_device *dssdev = &ddata->dssdev; @@ -247,11 +247,10 @@ MODULE_DEVICE_TABLE(of, tfp410_of_match); static struct platform_driver tfp410_driver = { .probe = tfp410_probe, - .remove = __exit_p(tfp410_remove), + .remove = tfp410_remove, .driver = { .name = "tfp410", .of_match_table = tfp410_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: 742507 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 EB5C7C05027 for ; Tue, 7 Nov 2023 09:20:36 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233941AbjKGJUh (ORCPT ); Tue, 7 Nov 2023 04:20:37 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36874 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233836AbjKGJUb (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 C74BB18F 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-omap@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-omap@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: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: 742160 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 F2063C070C3 for ; Tue, 7 Nov 2023 09:20:37 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233839AbjKGJUi (ORCPT ); Tue, 7 Nov 2023 04:20:38 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36910 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233854AbjKGJUc (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 56E27D73 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-omap@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-omap@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: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: 742504 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 13DF4C001B2 for ; Tue, 7 Nov 2023 09:20:40 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233947AbjKGJUk (ORCPT ); Tue, 7 Nov 2023 04:20:40 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37092 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233864AbjKGJUc (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 871AAD75 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-0000Pv-LY; 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-007FmS-6E; 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 1r0IG2-00ENX6-T8; 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 15/22] fb: omapfb/dpi: Convert to platform remove callback returning void Date: Tue, 7 Nov 2023 10:17:56 +0100 Message-ID: <20231107091740.3924258-16-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=jYaCQ2mrNANsPJgdXd2mtY81seo0PiSk6aculhgGasw=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBlSgDFBqz/NIP0TbjAlLZ9pRA6QTPhGT9OyF1Ye lCN9hOPA4WJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZUoAxQAKCRCPgPtYfRL+ TkSkB/wKAnobpP2ToSnFUaNRDw0u2oBXnCHlUopN7OA7PNvxH4gT75xsy3IY1YJ09guYjydFykR pMhYa59OhsHPse7x8iCSf9nhAsnEVL36X0cElqaCTvK1KidynUIhUByv4OK84As5PswzT6bDF2h Oy8PK7UYhMMtvLNGTRS0Gyd05seMQuqnd2NE5yJVWL/dbruWTqyXwf96y5Y7qMVUu6TaDu7GDWL uXqDN2+1F9KGlzmi0TimPJlgnZ6Y+ioIz7f6MRN/ljm0yveib4iRNetIn/+Lw5oppOOBAsvzCMK V2tTzytN0eQuy4RsU6CCfh85t+P3TkNr+ArwxW9ovoaZszF+ 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-omap@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-omap@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-dpi.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/video/fbdev/omap2/omapfb/displays/panel-dpi.c b/drivers/video/fbdev/omap2/omapfb/displays/panel-dpi.c index aa6faa5ba158..937f9091274f 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 panel_dpi_remove(struct platform_device *pdev) +static void panel_dpi_remove(struct platform_device *pdev) { struct panel_drv_data *ddata = platform_get_drvdata(pdev); struct omap_dss_device *dssdev = &ddata->dssdev; @@ -223,8 +223,6 @@ static int panel_dpi_remove(struct platform_device *pdev) panel_dpi_disconnect(dssdev); omap_dss_put_device(in); - - return 0; } static const struct of_device_id panel_dpi_of_match[] = { @@ -236,7 +234,7 @@ MODULE_DEVICE_TABLE(of, panel_dpi_of_match); static struct platform_driver panel_dpi_driver = { .probe = panel_dpi_probe, - .remove = panel_dpi_remove, + .remove_new = panel_dpi_remove, .driver = { .name = "panel-dpi", .of_match_table = panel_dpi_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: 742156 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 7AC13C07352 for ; Tue, 7 Nov 2023 09:20:44 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233897AbjKGJUo (ORCPT ); Tue, 7 Nov 2023 04:20:44 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53800 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233867AbjKGJUk (ORCPT ); Tue, 7 Nov 2023 04:20:40 -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 EA09A10A for ; Tue, 7 Nov 2023 01:20:36 -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-omap@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-omap@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: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: 742505 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 5A8E4C0018C for ; Tue, 7 Nov 2023 09:20:39 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233854AbjKGJUk (ORCPT ); Tue, 7 Nov 2023 04:20:40 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37260 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233858AbjKGJUc (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 96B93D77 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 1r0IG4-0000Ra-10; 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-007Fmb-KE; 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-00ENXE-B8; Tue, 07 Nov 2023 10:20:27 +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 17/22] fb: omapfb/dvi: Convert to platform remove callback returning void Date: Tue, 7 Nov 2023 10:17:58 +0100 Message-ID: <20231107091740.3924258-18-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=2017; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=c1MnPGwKhhAKjjbYpg7H+y0xhxS8YSPy0Wy96vB/zUg=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBlSgDI3sU6pmo4Z+/N//Id2YoyzTAjWRvVwU4mi ZrYHWZ51HGJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZUoAyAAKCRCPgPtYfRL+ Tp+kB/4zKjjErSxDfl8cJ1wPc1rJJVTVKfGOK0BBm9a8QftqxCFoEhKZLtqZIQvoHPK0ordwoLN IlPb1FI50YiHwO56hL3uLeNNPXVIO7EL2WOX8Wrbm/pEM/Ng1jM5hGnyqLglnMarOGa1ooRvFZ8 kcNjjxMvfla4YgM/LtnkIkUG9jbu8H/NnxmdfOR7lgUYIl2icHU9muuHd32ol2MofEn/O792Ko4 w8vUzKCK3PrTh5MqmizFjWzvlE1MBCdKi3Fmb0gmwlCNXlWLCGLkKHuur8WkxsnxrZ0/AZR5NIZ 5Y+Qt32gi2vcbSdyS1A+Dspud/ti62tUxH19RBXnodcH4LcE 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-omap@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-omap@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-dvi.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/video/fbdev/omap2/omapfb/displays/connector-dvi.c b/drivers/video/fbdev/omap2/omapfb/displays/connector-dvi.c index 2a5824fe8ea0..0cc9294f89b4 100644 --- a/drivers/video/fbdev/omap2/omapfb/displays/connector-dvi.c +++ b/drivers/video/fbdev/omap2/omapfb/displays/connector-dvi.c @@ -303,7 +303,7 @@ static int dvic_probe(struct platform_device *pdev) return r; } -static int dvic_remove(struct platform_device *pdev) +static void dvic_remove(struct platform_device *pdev) { struct panel_drv_data *ddata = platform_get_drvdata(pdev); struct omap_dss_device *dssdev = &ddata->dssdev; @@ -317,8 +317,6 @@ static int dvic_remove(struct platform_device *pdev) omap_dss_put_device(in); i2c_put_adapter(ddata->i2c_adapter); - - return 0; } static const struct of_device_id dvic_of_match[] = { @@ -330,7 +328,7 @@ MODULE_DEVICE_TABLE(of, dvic_of_match); static struct platform_driver dvi_connector_driver = { .probe = dvic_probe, - .remove = dvic_remove, + .remove_new = dvic_remove, .driver = { .name = "connector-dvi", .of_match_table = dvic_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: 742506 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 7A4D4C07208 for ; Tue, 7 Nov 2023 09:20:38 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233933AbjKGJUj (ORCPT ); Tue, 7 Nov 2023 04:20:39 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37152 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233882AbjKGJUc (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 12CCCD7C 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-omap@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-omap@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: 742159 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 14645C072A0 for ; Tue, 7 Nov 2023 09:20:41 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233864AbjKGJUl (ORCPT ); Tue, 7 Nov 2023 04:20:41 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37390 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233830AbjKGJUc (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 5884DD7E 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-omap@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-omap@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: 742503 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 5395BC072AB for ; Tue, 7 Nov 2023 09:20:42 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233948AbjKGJUn (ORCPT ); Tue, 7 Nov 2023 04:20:43 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36548 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233898AbjKGJUd (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 8C7CE10C6 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-omap@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-omap@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: 742157 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 CAC68C072DD for ; Tue, 7 Nov 2023 09:20:42 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233873AbjKGJUn (ORCPT ); Tue, 7 Nov 2023 04:20:43 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36970 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233924AbjKGJUd (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 A792B101 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-omap@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-omap@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, From patchwork Tue Nov 7 09:18: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: 742158 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 16929C072A2 for ; Tue, 7 Nov 2023 09:20:42 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233830AbjKGJUm (ORCPT ); Tue, 7 Nov 2023 04:20:42 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37280 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233892AbjKGJUd (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 8C55D10C3 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 1r0IG5-0000UA-11; Tue, 07 Nov 2023 10:20:29 +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-007Fmv-Jv; 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-00ENXX-Ap; Tue, 07 Nov 2023 10:20:28 +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 22/22] fb: omapfb/tpd12s015: Convert to platform remove callback returning void Date: Tue, 7 Nov 2023 10:18:03 +0100 Message-ID: <20231107091740.3924258-23-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=2012; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=BM9a+fM/lixBZNZcPucnNQynZ8Q+QQTeD5OtUZMImzI=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBlSgDN9zJoIuTQBAlJR80+NdgrWU0RdnoAvpfN/ BirwLi0XzyJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZUoAzQAKCRCPgPtYfRL+ TjZJB/sFG958INcVgLN+iQWd8qLHyGNDuKX2o6SoomEPqoVKsDrvtTQpEweM6IACZxTzX1DzlHQ xWhmA9O9x0p8FcZNIwr8Pvy7jaa+SrryEX41d/S5kC8PMC3HjZOVlYadp6qtlFhZTpNSJi+0vJA gUPDEd6eejT4to7I2V21TVpAL+985U0CSjjNnbpFoNYMAUkwafOLVTayKkhfhO9uJTuX4VooJX5 ObntA0+XNv7fFxsVjsEsUcLHBrfvsx9hHRQZSjdLknhKKNLOBu5fQBH8Y65J3MwmpKq3D70RQ+z sgXh+u3HFD3tcUPAWrOtY5vPbonu4oCjrKZit4r26lcPMdgt 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-omap@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-omap@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/encoder-tpd12s015.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/video/fbdev/omap2/omapfb/displays/encoder-tpd12s015.c b/drivers/video/fbdev/omap2/omapfb/displays/encoder-tpd12s015.c index 0bdedc0f6527..eb3926d0361b 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 tpd_remove(struct platform_device *pdev) +static void tpd_remove(struct platform_device *pdev) { struct panel_drv_data *ddata = platform_get_drvdata(pdev); struct omap_dss_device *dssdev = &ddata->dssdev; @@ -300,8 +300,6 @@ static int tpd_remove(struct platform_device *pdev) tpd_disconnect(dssdev, dssdev->dst); omap_dss_put_device(in); - - return 0; } static const struct of_device_id tpd_of_match[] = { @@ -313,7 +311,7 @@ MODULE_DEVICE_TABLE(of, tpd_of_match); static struct platform_driver tpd_driver = { .probe = tpd_probe, - .remove = tpd_remove, + .remove_new = tpd_remove, .driver = { .name = "tpd12s015", .of_match_table = tpd_of_match,