diff options
author | Sudip Mukherjee <sudipm.mukherjee@gmail.com> | 2015-03-08 23:10:09 +0530 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2015-03-20 13:56:03 +0100 |
commit | c65434eb265393ea1741953621559c61bba56062 (patch) | |
tree | a206f76bc21c1c5e8131b0d47a4351e3f92a8638 /drivers/staging/sm7xxfb | |
parent | f3e5df43488f7c6c5e91578ec9c7fdda5cd36167 (diff) |
staging: sm7xxfb: use module init and exit
use module_init() and module_exit() instead of module_pci_driver
and at the same time make way for use of kernel boot parameters.
Signed-off-by: Sudip Mukherjee <sudip@vectorindia.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/staging/sm7xxfb')
-rw-r--r-- | drivers/staging/sm7xxfb/sm7xxfb.c | 26 |
1 files changed, 25 insertions, 1 deletions
diff --git a/drivers/staging/sm7xxfb/sm7xxfb.c b/drivers/staging/sm7xxfb/sm7xxfb.c index ebd95365ffae..17b3917ccde0 100644 --- a/drivers/staging/sm7xxfb/sm7xxfb.c +++ b/drivers/staging/sm7xxfb/sm7xxfb.c @@ -113,6 +113,8 @@ static struct vesa_mode vesa_mode_table[] = { static struct screen_info smtc_scr_info; +static char *mode_option; + /* process command line options, get vga parameter */ static int __init sm7xx_vga_setup(char *options) { @@ -1017,7 +1019,29 @@ static struct pci_driver smtcfb_driver = { .driver.pm = SM7XX_PM_OPS, }; -module_pci_driver(smtcfb_driver); +static int __init sm712fb_init(void) +{ +#ifndef MODULE + char *option = NULL; + + if (fb_get_options("sm712fb", &option)) + return -ENODEV; + if (option && *option) + mode_option = option; +#endif + sm7xx_vga_setup(mode_option); + + return pci_register_driver(&smtcfb_driver); +} + +module_init(sm712fb_init); + +static void __exit sm712fb_exit(void) +{ + pci_unregister_driver(&smtcfb_driver); +} + +module_exit(sm712fb_exit); MODULE_AUTHOR("Siliconmotion "); MODULE_DESCRIPTION("Framebuffer driver for SMI Graphic Cards"); |