fbdev: omapfb/tpd12s015: Don't put .remove() in .exit.text and drop suppress_bind_attrs
authorUwe Kleine-König <u.kleine-koenig@pengutronix.de>
Tue, 7 Nov 2023 09:17:52 +0000 (10:17 +0100)
committerHelge Deller <deller@gmx.de>
Fri, 10 Nov 2023 06:34:18 +0000 (07:34 +0100)
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 <u.kleine-koenig@pengutronix.de>
Signed-off-by: Helge Deller <deller@gmx.de>
drivers/video/fbdev/omap2/omapfb/displays/encoder-tpd12s015.c

index 67f0c9250e9e4cc57b3e6d3cf8edab9a7d266d14..0bdedc0f6527358be2ee00e9aa820a9c5fcb915b 100644 (file)
@@ -283,7 +283,7 @@ err_gpio:
        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,
        },
 };