Skip to content

Commit 13c8fb9

Browse files
Uwe Kleine-Könighdeller
authored andcommitted
fbdev: atmel_lcdfb: Stop using platform_driver_probe()
On today's platforms the benefit of platform_driver_probe() isn't that relevant any more. It allows to drop some code after booting (or module loading) for .probe() and discard the .remove() function completely if the driver is built-in. This typically saves a few 100k. The downside of platform_driver_probe() is that the driver cannot be bound and unbound at runtime which is ancient and also slightly complicates testing. There are also thoughts to deprecate platform_driver_probe() because it adds some complexity in the driver core for little gain. Also many drivers don't use it correctly. This driver for example misses to mark the driver struct with __refdata which is needed to suppress a (W=1) modpost warning: WARNING: modpost: drivers/video/fbdev/atmel_lcdfb: section mismatch in reference: atmel_lcdfb_driver+0x4 (section: .data) -> atmel_lcdfb_remove (section: .exit.text) [folded in patch by Nathan Chancellor] Signed-off-by: Uwe Kleine-König <[email protected]> Signed-off-by: Nathan Chancellor <[email protected]> Signed-off-by: Helge Deller <[email protected]>
1 parent aba6ab5 commit 13c8fb9

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

drivers/video/fbdev/atmel_lcdfb.c

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -220,7 +220,7 @@ static inline void atmel_lcdfb_power_control(struct atmel_lcdfb_info *sinfo, int
220220
}
221221
}
222222

223-
static const struct fb_fix_screeninfo atmel_lcdfb_fix __initconst = {
223+
static const struct fb_fix_screeninfo atmel_lcdfb_fix = {
224224
.type = FB_TYPE_PACKED_PIXELS,
225225
.visual = FB_VISUAL_TRUECOLOR,
226226
.xpanstep = 0,
@@ -841,7 +841,7 @@ static void atmel_lcdfb_task(struct work_struct *work)
841841
atmel_lcdfb_reset(sinfo);
842842
}
843843

844-
static int __init atmel_lcdfb_init_fbinfo(struct atmel_lcdfb_info *sinfo)
844+
static int atmel_lcdfb_init_fbinfo(struct atmel_lcdfb_info *sinfo)
845845
{
846846
struct fb_info *info = sinfo->info;
847847
int ret = 0;
@@ -1017,7 +1017,7 @@ static int atmel_lcdfb_of_init(struct atmel_lcdfb_info *sinfo)
10171017
return ret;
10181018
}
10191019

1020-
static int __init atmel_lcdfb_probe(struct platform_device *pdev)
1020+
static int atmel_lcdfb_probe(struct platform_device *pdev)
10211021
{
10221022
struct device *dev = &pdev->dev;
10231023
struct fb_info *info;
@@ -1223,7 +1223,7 @@ static int __init atmel_lcdfb_probe(struct platform_device *pdev)
12231223
return ret;
12241224
}
12251225

1226-
static int __exit atmel_lcdfb_remove(struct platform_device *pdev)
1226+
static int atmel_lcdfb_remove(struct platform_device *pdev)
12271227
{
12281228
struct device *dev = &pdev->dev;
12291229
struct fb_info *info = dev_get_drvdata(dev);
@@ -1301,16 +1301,16 @@ static int atmel_lcdfb_resume(struct platform_device *pdev)
13011301
#endif
13021302

13031303
static struct platform_driver atmel_lcdfb_driver = {
1304-
.remove = __exit_p(atmel_lcdfb_remove),
1304+
.probe = atmel_lcdfb_probe,
1305+
.remove = atmel_lcdfb_remove,
13051306
.suspend = atmel_lcdfb_suspend,
13061307
.resume = atmel_lcdfb_resume,
13071308
.driver = {
13081309
.name = "atmel_lcdfb",
13091310
.of_match_table = atmel_lcdfb_dt_ids,
13101311
},
13111312
};
1312-
1313-
module_platform_driver_probe(atmel_lcdfb_driver, atmel_lcdfb_probe);
1313+
module_platform_driver(atmel_lcdfb_driver);
13141314

13151315
MODULE_DESCRIPTION("AT91 LCD Controller framebuffer driver");
13161316
MODULE_AUTHOR("Nicolas Ferre <[email protected]>");

0 commit comments

Comments
 (0)