diff options
author | Tomi Valkeinen <tomi.valkeinen@ti.com> | 2013-04-26 06:40:25 -0400 |
---|---|---|
committer | Tomi Valkeinen <tomi.valkeinen@ti.com> | 2013-05-02 04:24:19 -0400 |
commit | af56fe3ca6b034685d8a7da4088637fc4fb1a6e7 (patch) | |
tree | c2b335b3682b12d35e253f7b42a2142c7ba2d5e7 /drivers | |
parent | ca96e201ffe55dd240940518633b3599071c74e8 (diff) |
OMAPFB: use module_platform_driver()
Instead of using platform_driver_probe(), use module_platform_driver()
so that we can support deferred probing.
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/video/omap2/omapfb/omapfb-main.c | 28 |
1 files changed, 3 insertions, 25 deletions
diff --git a/drivers/video/omap2/omapfb/omapfb-main.c b/drivers/video/omap2/omapfb/omapfb-main.c index f38348ea3375..808f6af83b15 100644 --- a/drivers/video/omap2/omapfb/omapfb-main.c +++ b/drivers/video/omap2/omapfb/omapfb-main.c | |||
@@ -2422,7 +2422,7 @@ static int omapfb_init_connections(struct omapfb2_device *fbdev, | |||
2422 | return 0; | 2422 | return 0; |
2423 | } | 2423 | } |
2424 | 2424 | ||
2425 | static int __init omapfb_probe(struct platform_device *pdev) | 2425 | static int omapfb_probe(struct platform_device *pdev) |
2426 | { | 2426 | { |
2427 | struct omapfb2_device *fbdev = NULL; | 2427 | struct omapfb2_device *fbdev = NULL; |
2428 | int r = 0; | 2428 | int r = 0; |
@@ -2595,6 +2595,7 @@ static int __exit omapfb_remove(struct platform_device *pdev) | |||
2595 | } | 2595 | } |
2596 | 2596 | ||
2597 | static struct platform_driver omapfb_driver = { | 2597 | static struct platform_driver omapfb_driver = { |
2598 | .probe = omapfb_probe, | ||
2598 | .remove = __exit_p(omapfb_remove), | 2599 | .remove = __exit_p(omapfb_remove), |
2599 | .driver = { | 2600 | .driver = { |
2600 | .name = "omapfb", | 2601 | .name = "omapfb", |
@@ -2602,36 +2603,13 @@ static struct platform_driver omapfb_driver = { | |||
2602 | }, | 2603 | }, |
2603 | }; | 2604 | }; |
2604 | 2605 | ||
2605 | static int __init omapfb_init(void) | ||
2606 | { | ||
2607 | DBG("omapfb_init\n"); | ||
2608 | |||
2609 | if (platform_driver_probe(&omapfb_driver, omapfb_probe)) { | ||
2610 | printk(KERN_ERR "failed to register omapfb driver\n"); | ||
2611 | return -ENODEV; | ||
2612 | } | ||
2613 | |||
2614 | return 0; | ||
2615 | } | ||
2616 | |||
2617 | static void __exit omapfb_exit(void) | ||
2618 | { | ||
2619 | DBG("omapfb_exit\n"); | ||
2620 | platform_driver_unregister(&omapfb_driver); | ||
2621 | } | ||
2622 | |||
2623 | module_param_named(mode, def_mode, charp, 0); | 2606 | module_param_named(mode, def_mode, charp, 0); |
2624 | module_param_named(vram, def_vram, charp, 0); | 2607 | module_param_named(vram, def_vram, charp, 0); |
2625 | module_param_named(rotate, def_rotate, int, 0); | 2608 | module_param_named(rotate, def_rotate, int, 0); |
2626 | module_param_named(vrfb, def_vrfb, bool, 0); | 2609 | module_param_named(vrfb, def_vrfb, bool, 0); |
2627 | module_param_named(mirror, def_mirror, bool, 0); | 2610 | module_param_named(mirror, def_mirror, bool, 0); |
2628 | 2611 | ||
2629 | /* late_initcall to let panel/ctrl drivers loaded first. | 2612 | module_platform_driver(omapfb_driver); |
2630 | * I guess better option would be a more dynamic approach, | ||
2631 | * so that omapfb reacts to new panels when they are loaded */ | ||
2632 | late_initcall(omapfb_init); | ||
2633 | /*module_init(omapfb_init);*/ | ||
2634 | module_exit(omapfb_exit); | ||
2635 | 2613 | ||
2636 | MODULE_AUTHOR("Tomi Valkeinen <tomi.valkeinen@nokia.com>"); | 2614 | MODULE_AUTHOR("Tomi Valkeinen <tomi.valkeinen@nokia.com>"); |
2637 | MODULE_DESCRIPTION("OMAP2/3 Framebuffer"); | 2615 | MODULE_DESCRIPTION("OMAP2/3 Framebuffer"); |