diff options
Diffstat (limited to 'drivers/video/s3fb.c')
-rw-r--r-- | drivers/video/s3fb.c | 34 |
1 files changed, 18 insertions, 16 deletions
diff --git a/drivers/video/s3fb.c b/drivers/video/s3fb.c index 7d53bc23b9c7..2972f112dbed 100644 --- a/drivers/video/s3fb.c +++ b/drivers/video/s3fb.c | |||
@@ -132,10 +132,10 @@ static const struct svga_timing_regs s3_timing_regs = { | |||
132 | /* Module parameters */ | 132 | /* Module parameters */ |
133 | 133 | ||
134 | 134 | ||
135 | static char *mode = "640x480-8@60"; | 135 | static char *mode_option __devinitdata = "640x480-8@60"; |
136 | 136 | ||
137 | #ifdef CONFIG_MTRR | 137 | #ifdef CONFIG_MTRR |
138 | static int mtrr = 1; | 138 | static int mtrr __devinitdata = 1; |
139 | #endif | 139 | #endif |
140 | 140 | ||
141 | static int fasttext = 1; | 141 | static int fasttext = 1; |
@@ -145,8 +145,10 @@ MODULE_AUTHOR("(c) 2006-2007 Ondrej Zajicek <santiago@crfreenet.org>"); | |||
145 | MODULE_LICENSE("GPL"); | 145 | MODULE_LICENSE("GPL"); |
146 | MODULE_DESCRIPTION("fbdev driver for S3 Trio/Virge"); | 146 | MODULE_DESCRIPTION("fbdev driver for S3 Trio/Virge"); |
147 | 147 | ||
148 | module_param(mode, charp, 0444); | 148 | module_param(mode_option, charp, 0444); |
149 | MODULE_PARM_DESC(mode, "Default video mode ('640x480-8@60', etc)"); | 149 | MODULE_PARM_DESC(mode_option, "Default video mode ('640x480-8@60', etc)"); |
150 | module_param_named(mode, mode_option, charp, 0444); | ||
151 | MODULE_PARM_DESC(mode, "Default video mode ('640x480-8@60', etc) (deprecated)"); | ||
150 | 152 | ||
151 | #ifdef CONFIG_MTRR | 153 | #ifdef CONFIG_MTRR |
152 | module_param(mtrr, int, 0444); | 154 | module_param(mtrr, int, 0444); |
@@ -886,7 +888,7 @@ static int __devinit s3_pci_probe(struct pci_dev *dev, const struct pci_device_i | |||
886 | } | 888 | } |
887 | 889 | ||
888 | /* Allocate and fill driver data structure */ | 890 | /* Allocate and fill driver data structure */ |
889 | info = framebuffer_alloc(sizeof(struct s3fb_info), NULL); | 891 | info = framebuffer_alloc(sizeof(struct s3fb_info), &(dev->dev)); |
890 | if (!info) { | 892 | if (!info) { |
891 | dev_err(&(dev->dev), "cannot allocate memory\n"); | 893 | dev_err(&(dev->dev), "cannot allocate memory\n"); |
892 | return -ENOMEM; | 894 | return -ENOMEM; |
@@ -901,13 +903,13 @@ static int __devinit s3_pci_probe(struct pci_dev *dev, const struct pci_device_i | |||
901 | /* Prepare PCI device */ | 903 | /* Prepare PCI device */ |
902 | rc = pci_enable_device(dev); | 904 | rc = pci_enable_device(dev); |
903 | if (rc < 0) { | 905 | if (rc < 0) { |
904 | dev_err(&(dev->dev), "cannot enable PCI device\n"); | 906 | dev_err(info->dev, "cannot enable PCI device\n"); |
905 | goto err_enable_device; | 907 | goto err_enable_device; |
906 | } | 908 | } |
907 | 909 | ||
908 | rc = pci_request_regions(dev, "s3fb"); | 910 | rc = pci_request_regions(dev, "s3fb"); |
909 | if (rc < 0) { | 911 | if (rc < 0) { |
910 | dev_err(&(dev->dev), "cannot reserve framebuffer region\n"); | 912 | dev_err(info->dev, "cannot reserve framebuffer region\n"); |
911 | goto err_request_regions; | 913 | goto err_request_regions; |
912 | } | 914 | } |
913 | 915 | ||
@@ -919,7 +921,7 @@ static int __devinit s3_pci_probe(struct pci_dev *dev, const struct pci_device_i | |||
919 | info->screen_base = pci_iomap(dev, 0, 0); | 921 | info->screen_base = pci_iomap(dev, 0, 0); |
920 | if (! info->screen_base) { | 922 | if (! info->screen_base) { |
921 | rc = -ENOMEM; | 923 | rc = -ENOMEM; |
922 | dev_err(&(dev->dev), "iomap for framebuffer failed\n"); | 924 | dev_err(info->dev, "iomap for framebuffer failed\n"); |
923 | goto err_iomap; | 925 | goto err_iomap; |
924 | } | 926 | } |
925 | 927 | ||
@@ -960,22 +962,22 @@ static int __devinit s3_pci_probe(struct pci_dev *dev, const struct pci_device_i | |||
960 | info->pseudo_palette = (void*) (par->pseudo_palette); | 962 | info->pseudo_palette = (void*) (par->pseudo_palette); |
961 | 963 | ||
962 | /* Prepare startup mode */ | 964 | /* Prepare startup mode */ |
963 | rc = fb_find_mode(&(info->var), info, mode, NULL, 0, NULL, 8); | 965 | rc = fb_find_mode(&(info->var), info, mode_option, NULL, 0, NULL, 8); |
964 | if (! ((rc == 1) || (rc == 2))) { | 966 | if (! ((rc == 1) || (rc == 2))) { |
965 | rc = -EINVAL; | 967 | rc = -EINVAL; |
966 | dev_err(&(dev->dev), "mode %s not found\n", mode); | 968 | dev_err(info->dev, "mode %s not found\n", mode_option); |
967 | goto err_find_mode; | 969 | goto err_find_mode; |
968 | } | 970 | } |
969 | 971 | ||
970 | rc = fb_alloc_cmap(&info->cmap, 256, 0); | 972 | rc = fb_alloc_cmap(&info->cmap, 256, 0); |
971 | if (rc < 0) { | 973 | if (rc < 0) { |
972 | dev_err(&(dev->dev), "cannot allocate colormap\n"); | 974 | dev_err(info->dev, "cannot allocate colormap\n"); |
973 | goto err_alloc_cmap; | 975 | goto err_alloc_cmap; |
974 | } | 976 | } |
975 | 977 | ||
976 | rc = register_framebuffer(info); | 978 | rc = register_framebuffer(info); |
977 | if (rc < 0) { | 979 | if (rc < 0) { |
978 | dev_err(&(dev->dev), "cannot register framebuffer\n"); | 980 | dev_err(info->dev, "cannot register framebuffer\n"); |
979 | goto err_reg_fb; | 981 | goto err_reg_fb; |
980 | } | 982 | } |
981 | 983 | ||
@@ -1051,7 +1053,7 @@ static int s3_pci_suspend(struct pci_dev* dev, pm_message_t state) | |||
1051 | struct fb_info *info = pci_get_drvdata(dev); | 1053 | struct fb_info *info = pci_get_drvdata(dev); |
1052 | struct s3fb_info *par = info->par; | 1054 | struct s3fb_info *par = info->par; |
1053 | 1055 | ||
1054 | dev_info(&(dev->dev), "suspend\n"); | 1056 | dev_info(info->dev, "suspend\n"); |
1055 | 1057 | ||
1056 | acquire_console_sem(); | 1058 | acquire_console_sem(); |
1057 | mutex_lock(&(par->open_lock)); | 1059 | mutex_lock(&(par->open_lock)); |
@@ -1083,7 +1085,7 @@ static int s3_pci_resume(struct pci_dev* dev) | |||
1083 | struct s3fb_info *par = info->par; | 1085 | struct s3fb_info *par = info->par; |
1084 | int err; | 1086 | int err; |
1085 | 1087 | ||
1086 | dev_info(&(dev->dev), "resume\n"); | 1088 | dev_info(info->dev, "resume\n"); |
1087 | 1089 | ||
1088 | acquire_console_sem(); | 1090 | acquire_console_sem(); |
1089 | mutex_lock(&(par->open_lock)); | 1091 | mutex_lock(&(par->open_lock)); |
@@ -1100,7 +1102,7 @@ static int s3_pci_resume(struct pci_dev* dev) | |||
1100 | if (err) { | 1102 | if (err) { |
1101 | mutex_unlock(&(par->open_lock)); | 1103 | mutex_unlock(&(par->open_lock)); |
1102 | release_console_sem(); | 1104 | release_console_sem(); |
1103 | dev_err(&(dev->dev), "error %d enabling device for resume\n", err); | 1105 | dev_err(info->dev, "error %d enabling device for resume\n", err); |
1104 | return err; | 1106 | return err; |
1105 | } | 1107 | } |
1106 | pci_set_master(dev); | 1108 | pci_set_master(dev); |
@@ -1168,7 +1170,7 @@ static int __init s3fb_setup(char *options) | |||
1168 | else if (!strncmp(opt, "fasttext:", 9)) | 1170 | else if (!strncmp(opt, "fasttext:", 9)) |
1169 | fasttext = simple_strtoul(opt + 9, NULL, 0); | 1171 | fasttext = simple_strtoul(opt + 9, NULL, 0); |
1170 | else | 1172 | else |
1171 | mode = opt; | 1173 | mode_option = opt; |
1172 | } | 1174 | } |
1173 | 1175 | ||
1174 | return 0; | 1176 | return 0; |