aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/video
diff options
context:
space:
mode:
authorAntonino A. Daplas <adaplas@gmail.com>2006-01-09 23:53:10 -0500
committerLinus Torvalds <torvalds@g5.osdl.org>2006-01-10 11:01:45 -0500
commit6772a2ee9d5992a712b46990f39249c500e0221f (patch)
treea23e391d6b8ad9bcb311aca5193ec9ec9dec2d05 /drivers/video
parent9f19bc56c3ce7d9a1c7159c2456d9b50883930e6 (diff)
[PATCH] fbdev: pm2fb: Driver cleanups
- remove unneeded casts - move memory for pseudo_palette inside struct pm2fb_par Signed-off-by: Antonino Daplas <adaplas@pol.net> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'drivers/video')
-rw-r--r--drivers/video/pm2fb.c21
1 files changed, 10 insertions, 11 deletions
diff --git a/drivers/video/pm2fb.c b/drivers/video/pm2fb.c
index 0277ce031e5e..5fe197943deb 100644
--- a/drivers/video/pm2fb.c
+++ b/drivers/video/pm2fb.c
@@ -91,6 +91,7 @@ struct pm2fb_par
91 u32 mem_config; /* MemConfig reg at probe */ 91 u32 mem_config; /* MemConfig reg at probe */
92 u32 mem_control; /* MemControl reg at probe */ 92 u32 mem_control; /* MemControl reg at probe */
93 u32 boot_address; /* BootAddress reg at probe */ 93 u32 boot_address; /* BootAddress reg at probe */
94 u32 palette[16];
94}; 95};
95 96
96/* 97/*
@@ -674,7 +675,7 @@ static int pm2fb_check_var(struct fb_var_screeninfo *var, struct fb_info *info)
674 */ 675 */
675static int pm2fb_set_par(struct fb_info *info) 676static int pm2fb_set_par(struct fb_info *info)
676{ 677{
677 struct pm2fb_par *par = (struct pm2fb_par *) info->par; 678 struct pm2fb_par *par = info->par;
678 u32 pixclock; 679 u32 pixclock;
679 u32 width, height, depth; 680 u32 width, height, depth;
680 u32 hsstart, hsend, hbend, htotal; 681 u32 hsstart, hsend, hbend, htotal;
@@ -854,7 +855,7 @@ static int pm2fb_setcolreg(unsigned regno, unsigned red, unsigned green,
854 unsigned blue, unsigned transp, 855 unsigned blue, unsigned transp,
855 struct fb_info *info) 856 struct fb_info *info)
856{ 857{
857 struct pm2fb_par *par = (struct pm2fb_par *) info->par; 858 struct pm2fb_par *par = info->par;
858 859
859 if (regno >= info->cmap.len) /* no. of hw registers */ 860 if (regno >= info->cmap.len) /* no. of hw registers */
860 return 1; 861 return 1;
@@ -929,7 +930,7 @@ static int pm2fb_setcolreg(unsigned regno, unsigned red, unsigned green,
929 case 16: 930 case 16:
930 case 24: 931 case 24:
931 case 32: 932 case 32:
932 ((u32*)(info->pseudo_palette))[regno] = v; 933 par->palette[regno] = v;
933 break; 934 break;
934 } 935 }
935 return 0; 936 return 0;
@@ -955,7 +956,7 @@ static int pm2fb_setcolreg(unsigned regno, unsigned red, unsigned green,
955static int pm2fb_pan_display(struct fb_var_screeninfo *var, 956static int pm2fb_pan_display(struct fb_var_screeninfo *var,
956 struct fb_info *info) 957 struct fb_info *info)
957{ 958{
958 struct pm2fb_par *p = (struct pm2fb_par *) info->par; 959 struct pm2fb_par *p = info->par;
959 u32 base; 960 u32 base;
960 u32 depth; 961 u32 depth;
961 u32 xres; 962 u32 xres;
@@ -987,7 +988,7 @@ static int pm2fb_pan_display(struct fb_var_screeninfo *var,
987 */ 988 */
988static int pm2fb_blank(int blank_mode, struct fb_info *info) 989static int pm2fb_blank(int blank_mode, struct fb_info *info)
989{ 990{
990 struct pm2fb_par *par = (struct pm2fb_par *) info->par; 991 struct pm2fb_par *par = info->par;
991 u32 video = par->video; 992 u32 video = par->video;
992 993
993 DPRINTK("blank_mode %d\n", blank_mode); 994 DPRINTK("blank_mode %d\n", blank_mode);
@@ -1054,8 +1055,7 @@ static int __devinit pm2fb_probe(struct pci_dev *pdev,
1054{ 1055{
1055 struct pm2fb_par *default_par; 1056 struct pm2fb_par *default_par;
1056 struct fb_info *info; 1057 struct fb_info *info;
1057 int size, err; 1058 int err, err_retval = -ENXIO;
1058 int err_retval = -ENXIO;
1059 1059
1060 err = pci_enable_device(pdev); 1060 err = pci_enable_device(pdev);
1061 if ( err ) { 1061 if ( err ) {
@@ -1063,11 +1063,10 @@ static int __devinit pm2fb_probe(struct pci_dev *pdev,
1063 return err; 1063 return err;
1064 } 1064 }
1065 1065
1066 size = sizeof(struct pm2fb_par) + 256 * sizeof(u32); 1066 info = framebuffer_alloc(sizeof(struct pm2fb_par), &pdev->dev);
1067 info = framebuffer_alloc(size, &pdev->dev);
1068 if ( !info ) 1067 if ( !info )
1069 return -ENOMEM; 1068 return -ENOMEM;
1070 default_par = (struct pm2fb_par *) info->par; 1069 default_par = info->par;
1071 1070
1072 switch (pdev->device) { 1071 switch (pdev->device) {
1073 case PCI_DEVICE_ID_TI_TVP4020: 1072 case PCI_DEVICE_ID_TI_TVP4020:
@@ -1171,7 +1170,7 @@ static int __devinit pm2fb_probe(struct pci_dev *pdev,
1171 1170
1172 info->fbops = &pm2fb_ops; 1171 info->fbops = &pm2fb_ops;
1173 info->fix = pm2fb_fix; 1172 info->fix = pm2fb_fix;
1174 info->pseudo_palette = (void *)(default_par + 1); 1173 info->pseudo_palette = default_par->palette;
1175 info->flags = FBINFO_DEFAULT | 1174 info->flags = FBINFO_DEFAULT |
1176 FBINFO_HWACCEL_YPAN; 1175 FBINFO_HWACCEL_YPAN;
1177 1176