projects
/
powerpc.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
IPoIB: Fix use-after-free in path_rec_completion()
[powerpc.git]
/
drivers
/
video
/
pm2fb.c
diff --git
a/drivers/video/pm2fb.c
b/drivers/video/pm2fb.c
index
0277ce0
..
a560a22
100644
(file)
--- a/
drivers/video/pm2fb.c
+++ b/
drivers/video/pm2fb.c
@@
-27,14
+27,12
@@
*
*/
*
*/
-#include <linux/config.h>
#include <linux/module.h>
#include <linux/moduleparam.h>
#include <linux/kernel.h>
#include <linux/errno.h>
#include <linux/string.h>
#include <linux/mm.h>
#include <linux/module.h>
#include <linux/moduleparam.h>
#include <linux/kernel.h>
#include <linux/errno.h>
#include <linux/string.h>
#include <linux/mm.h>
-#include <linux/tty.h>
#include <linux/slab.h>
#include <linux/delay.h>
#include <linux/fb.h>
#include <linux/slab.h>
#include <linux/delay.h>
#include <linux/fb.h>
@@
-73,8
+71,8
@@
static char *mode __devinitdata = NULL;
* these flags allow the user to specify that requests for +ve sync
* should be silently turned in -ve sync.
*/
* these flags allow the user to specify that requests for +ve sync
* should be silently turned in -ve sync.
*/
-static int lowhsync
__devinitdata = 0
;
-static int lowvsync
__devinitdata = 0
;
+static int lowhsync;
+static int lowvsync;
/*
* The hardware state of the graphics card that isn't part of the
/*
* The hardware state of the graphics card that isn't part of the
@@
-91,6
+89,7
@@
struct pm2fb_par
u32 mem_config; /* MemConfig reg at probe */
u32 mem_control; /* MemControl reg at probe */
u32 boot_address; /* BootAddress reg at probe */
u32 mem_config; /* MemConfig reg at probe */
u32 mem_control; /* MemControl reg at probe */
u32 boot_address; /* BootAddress reg at probe */
+ u32 palette[16];
};
/*
};
/*
@@
-674,7
+673,7
@@
static int pm2fb_check_var(struct fb_var_screeninfo *var, struct fb_info *info)
*/
static int pm2fb_set_par(struct fb_info *info)
{
*/
static int pm2fb_set_par(struct fb_info *info)
{
- struct pm2fb_par *par =
(struct pm2fb_par *)
info->par;
+ struct pm2fb_par *par = info->par;
u32 pixclock;
u32 width, height, depth;
u32 hsstart, hsend, hbend, htotal;
u32 pixclock;
u32 width, height, depth;
u32 hsstart, hsend, hbend, htotal;
@@
-854,7
+853,7
@@
static int pm2fb_setcolreg(unsigned regno, unsigned red, unsigned green,
unsigned blue, unsigned transp,
struct fb_info *info)
{
unsigned blue, unsigned transp,
struct fb_info *info)
{
- struct pm2fb_par *par =
(struct pm2fb_par *)
info->par;
+ struct pm2fb_par *par = info->par;
if (regno >= info->cmap.len) /* no. of hw registers */
return 1;
if (regno >= info->cmap.len) /* no. of hw registers */
return 1;
@@
-929,7
+928,7
@@
static int pm2fb_setcolreg(unsigned regno, unsigned red, unsigned green,
case 16:
case 24:
case 32:
case 16:
case 24:
case 32:
-
((u32*)(info->pseudo_palette))
[regno] = v;
+
par->palette
[regno] = v;
break;
}
return 0;
break;
}
return 0;
@@
-955,7
+954,7
@@
static int pm2fb_setcolreg(unsigned regno, unsigned red, unsigned green,
static int pm2fb_pan_display(struct fb_var_screeninfo *var,
struct fb_info *info)
{
static int pm2fb_pan_display(struct fb_var_screeninfo *var,
struct fb_info *info)
{
- struct pm2fb_par *p =
(struct pm2fb_par *)
info->par;
+ struct pm2fb_par *p = info->par;
u32 base;
u32 depth;
u32 xres;
u32 base;
u32 depth;
u32 xres;
@@
-987,7
+986,7
@@
static int pm2fb_pan_display(struct fb_var_screeninfo *var,
*/
static int pm2fb_blank(int blank_mode, struct fb_info *info)
{
*/
static int pm2fb_blank(int blank_mode, struct fb_info *info)
{
- struct pm2fb_par *par =
(struct pm2fb_par *)
info->par;
+ struct pm2fb_par *par = info->par;
u32 video = par->video;
DPRINTK("blank_mode %d\n", blank_mode);
u32 video = par->video;
DPRINTK("blank_mode %d\n", blank_mode);
@@
-1054,8
+1053,7
@@
static int __devinit pm2fb_probe(struct pci_dev *pdev,
{
struct pm2fb_par *default_par;
struct fb_info *info;
{
struct pm2fb_par *default_par;
struct fb_info *info;
- int size, err;
- int err_retval = -ENXIO;
+ int err, err_retval = -ENXIO;
err = pci_enable_device(pdev);
if ( err ) {
err = pci_enable_device(pdev);
if ( err ) {
@@
-1063,11
+1061,10
@@
static int __devinit pm2fb_probe(struct pci_dev *pdev,
return err;
}
return err;
}
- size = sizeof(struct pm2fb_par) + 256 * sizeof(u32);
- info = framebuffer_alloc(size, &pdev->dev);
+ info = framebuffer_alloc(sizeof(struct pm2fb_par), &pdev->dev);
if ( !info )
return -ENOMEM;
if ( !info )
return -ENOMEM;
- default_par =
(struct pm2fb_par *)
info->par;
+ default_par = info->par;
switch (pdev->device) {
case PCI_DEVICE_ID_TI_TVP4020:
switch (pdev->device) {
case PCI_DEVICE_ID_TI_TVP4020:
@@
-1171,7
+1168,7
@@
static int __devinit pm2fb_probe(struct pci_dev *pdev,
info->fbops = &pm2fb_ops;
info->fix = pm2fb_fix;
info->fbops = &pm2fb_ops;
info->fix = pm2fb_fix;
- info->pseudo_palette =
(void *)(default_par + 1);
+ info->pseudo_palette =
default_par->palette;
info->flags = FBINFO_DEFAULT |
FBINFO_HWACCEL_YPAN;
info->flags = FBINFO_DEFAULT |
FBINFO_HWACCEL_YPAN;