From mboxrd@z Thu Jan 1 00:00:00 1970 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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 432C8C4332F for ; Tue, 7 Nov 2023 20:02:23 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:Content-Type:Cc: List-Subscribe:List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id: In-Reply-To:MIME-Version:References:Message-ID:Subject:To:From:Date:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=ZOqSuDimcGJvHkDqkmmvUPvc8gniDOrHMYxAU4aCIaM=; b=SErUVJKEZn4Vr6k7wDhNGP5IZc DBnn2QMucysCI8O6jxjQVbT1u/ThXb5wKuCjyqMXGaDBMwQOdoyF5D3CcwAe5GhOV73NPcdAPeGLp Mre4Gn4ihmS4bP1LuJjb9gxQj2nbZul1e03p6s1LY0Sx7ICXqht97mIXB8vW0vE0Q17X1dE31CqvM GymzKobALMXYx6GWiSoKlWwiOD0P/NyuO8ocC76AiEcGDqLc4w8mtvxiccJ1cVGY2xj9kOIe018ER p81GsZrwCTBQi+MR3NhfGXwdPrcIEySOg47jrBRC3ksWmujcHl3GdhoR+T+YDr+pHM6FS4651FqPD +uVYtUMQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1r0SGm-002JcI-0v; Tue, 07 Nov 2023 20:01:52 +0000 Received: from metis.whiteo.stw.pengutronix.de ([2a0a:edc0:2:b01:1d::104]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1r0SGi-002JRt-19 for linux-arm-kernel@lists.infradead.org; Tue, 07 Nov 2023 20:01:50 +0000 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 1r0SGV-0008C6-Vx; Tue, 07 Nov 2023 21:01:36 +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 1r0SGU-007MtR-VY; Tue, 07 Nov 2023 21:01:34 +0100 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1r0SGU-00En5h-M9; Tue, 07 Nov 2023 21:01:34 +0100 Date: Tue, 7 Nov 2023 21:01:34 +0100 From: Uwe =?utf-8?Q?Kleine-K=C3=B6nig?= To: Helge Deller Subject: Re: [PATCH 02/22] fb: atmel_lcdfb: Stop using platform_driver_probe() Message-ID: <20231107200134.jsowrcruisrtnspw@pengutronix.de> References: <20231107091740.3924258-1-u.kleine-koenig@pengutronix.de> <20231107091740.3924258-3-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 In-Reply-To: <20231107091740.3924258-3-u.kleine-koenig@pengutronix.de> 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-arm-kernel@lists.infradead.org X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20231107_120148_391491_8E70479A X-CRM114-Status: GOOD ( 30.39 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Alexandre Belloni , linux-fbdev@vger.kernel.org, dri-devel@lists.freedesktop.org, kernel@pengutronix.de, Claudiu Beznea , linux-arm-kernel@lists.infradead.org Content-Type: multipart/mixed; boundary="===============5783039743235892832==" Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org --===============5783039743235892832== Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="sjmfdg57sgsypwrr" Content-Disposition: inline --sjmfdg57sgsypwrr Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Tue, Nov 07, 2023 at 10:17:43AM +0100, Uwe Kleine-K=F6nig wrote: > On today's platforms the benefit of platform_driver_probe() isn't that > relevant any more. It allows to drop some code after booting (or module > loading) for .probe() and discard the .remove() function completely if > the driver is built-in. This typically saves a few 100k. >=20 > The downside of platform_driver_probe() is that the driver cannot be > bound and unbound at runtime which is ancient and also slightly > complicates testing. There are also thoughts to deprecate > platform_driver_probe() because it adds some complexity in the driver > core for little gain. Also many drivers don't use it correctly. This > driver for example misses to mark the driver struct with __refdata which > is needed to suppress a (W=3D1) modpost warning: >=20 > WARNING: modpost: drivers/video/fbdev/atmel_lcdfb: section mismatch in r= eference: atmel_lcdfb_driver+0x4 (section: .data) -> atmel_lcdfb_remove (se= ction: .exit.text) >=20 > Signed-off-by: Uwe Kleine-K=F6nig > --- > drivers/video/fbdev/atmel_lcdfb.c | 9 +++++---- > 1 file changed, 5 insertions(+), 4 deletions(-) >=20 > diff --git a/drivers/video/fbdev/atmel_lcdfb.c b/drivers/video/fbdev/atme= l_lcdfb.c > index a908db233409..b218731ef732 100644 > --- a/drivers/video/fbdev/atmel_lcdfb.c > +++ b/drivers/video/fbdev/atmel_lcdfb.c > @@ -1017,7 +1017,7 @@ static int atmel_lcdfb_of_init(struct atmel_lcdfb_i= nfo *sinfo) > return ret; > } > =20 > -static int __init atmel_lcdfb_probe(struct platform_device *pdev) > +static int atmel_lcdfb_probe(struct platform_device *pdev) > { > struct device *dev =3D &pdev->dev; > struct fb_info *info; > @@ -1223,7 +1223,7 @@ static int __init atmel_lcdfb_probe(struct platform= _device *pdev) > return ret; > } > =20 > -static int __exit atmel_lcdfb_remove(struct platform_device *pdev) > +static int atmel_lcdfb_remove(struct platform_device *pdev) > { > struct device *dev =3D &pdev->dev; > struct fb_info *info =3D dev_get_drvdata(dev); > @@ -1301,7 +1301,8 @@ static int atmel_lcdfb_resume(struct platform_devic= e *pdev) > #endif > =20 > static struct platform_driver atmel_lcdfb_driver =3D { > - .remove =3D __exit_p(atmel_lcdfb_remove), > + .probe =3D atmel_lcdfb_probe, > + .remove =3D atmel_lcdfb_remove, > .suspend =3D atmel_lcdfb_suspend, > .resume =3D atmel_lcdfb_resume, > .driver =3D { > @@ -1310,7 +1311,7 @@ static struct platform_driver atmel_lcdfb_driver = =3D { > }, > }; > =20 > -module_platform_driver_probe(atmel_lcdfb_driver, atmel_lcdfb_probe); > +module_platform_driver(atmel_lcdfb_driver, ); Argh, the , must be removed. I had this in my working copy but forgot to squash it into this commit. Sorry! Can you squash in the following please?: diff --git a/drivers/video/fbdev/atmel_lcdfb.c b/drivers/video/fbdev/atmel_= lcdfb.c index 0531d6f6dcc5..88c75ae7d315 100644 --- a/drivers/video/fbdev/atmel_lcdfb.c +++ b/drivers/video/fbdev/atmel_lcdfb.c @@ -1308,8 +1308,7 @@ static struct platform_driver atmel_lcdfb_driver =3D { .of_match_table =3D atmel_lcdfb_dt_ids, }, }; - -module_platform_driver(atmel_lcdfb_driver, ); +module_platform_driver(atmel_lcdfb_driver); =20 MODULE_DESCRIPTION("AT91 LCD Controller framebuffer driver"); MODULE_AUTHOR("Nicolas Ferre "); Best regards Uwe --=20 Pengutronix e.K. | Uwe Kleine-K=F6nig | Industrial Linux Solutions | https://www.pengutronix.de/ | --sjmfdg57sgsypwrr Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQEzBAABCgAdFiEEP4GsaTp6HlmJrf7Tj4D7WH0S/k4FAmVKl50ACgkQj4D7WH0S /k79igf+NcsaKUuX+n6J099hutP7e/6l1H4tbP734q1G0NfcM88RoImECYSikOS7 kjD3nZNRkIZZI4wvwUHVDVWeG53uzR9j1/M92J2iPBbeixxiF7oJvpoDtySYTMxm J4KbgDb1F1cNXXfG5DhDv+Av7db0QVX1nWr8ClrN8OpXPg7RRLbDeve0DyVVNThx Wq/JyMW+UeucJCf+j/b9YS1+8F+cDCztNwmcQYxycRCKplItqkjnUyfHGFZYZzUg cN/S3Km57tPKwxKHxpKaVPIF9hFGFkZKKNTJaXA0PDPyxwGpFj/vATYlNNovFYhL X/hoC1DjhyzoIS6OBmwOsD9YX8AALg== =NGWh -----END PGP SIGNATURE----- --sjmfdg57sgsypwrr-- --===============5783039743235892832== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel --===============5783039743235892832==--