Commit f4a41836 authored by Antonino A. Daplas's avatar Antonino A. Daplas Committed by Linus Torvalds

[PATCH] fbdev: rivafb: Driver cleanups

- remove redundant casts
Signed-off-by: default avatarAntonino Daplas <adaplas@pol.net>
Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent c019c0ec
...@@ -630,7 +630,7 @@ static void riva_load_video_mode(struct fb_info *info) ...@@ -630,7 +630,7 @@ static void riva_load_video_mode(struct fb_info *info)
int bpp, width, hDisplaySize, hDisplay, hStart, int bpp, width, hDisplaySize, hDisplay, hStart,
hEnd, hTotal, height, vDisplay, vStart, vEnd, vTotal, dotClock; hEnd, hTotal, height, vDisplay, vStart, vEnd, vTotal, dotClock;
int hBlankStart, hBlankEnd, vBlankStart, vBlankEnd; int hBlankStart, hBlankEnd, vBlankStart, vBlankEnd;
struct riva_par *par = (struct riva_par *) info->par; struct riva_par *par = info->par;
struct riva_regs newmode; struct riva_regs newmode;
NVTRACE_ENTER(); NVTRACE_ENTER();
...@@ -925,7 +925,7 @@ riva_set_rop_solid(struct riva_par *par, int rop) ...@@ -925,7 +925,7 @@ riva_set_rop_solid(struct riva_par *par, int rop)
static void riva_setup_accel(struct fb_info *info) static void riva_setup_accel(struct fb_info *info)
{ {
struct riva_par *par = (struct riva_par *) info->par; struct riva_par *par = info->par;
RIVA_FIFO_FREE(par->riva, Clip, 2); RIVA_FIFO_FREE(par->riva, Clip, 2);
NV_WR32(&par->riva.Clip->TopLeft, 0, 0x0); NV_WR32(&par->riva.Clip->TopLeft, 0, 0x0);
...@@ -979,7 +979,7 @@ static int riva_get_cmap_len(const struct fb_var_screeninfo *var) ...@@ -979,7 +979,7 @@ static int riva_get_cmap_len(const struct fb_var_screeninfo *var)
#ifdef CONFIG_PMAC_BACKLIGHT #ifdef CONFIG_PMAC_BACKLIGHT
static int riva_set_backlight_enable(int on, int level, void *data) static int riva_set_backlight_enable(int on, int level, void *data)
{ {
struct riva_par *par = (struct riva_par *)data; struct riva_par *par = data;
U032 tmp_pcrt, tmp_pmc; U032 tmp_pcrt, tmp_pmc;
tmp_pmc = par->riva.PMC[0x10F0/4] & 0x0000FFFF; tmp_pmc = par->riva.PMC[0x10F0/4] & 0x0000FFFF;
...@@ -1008,7 +1008,7 @@ static int riva_set_backlight_level(int level, void *data) ...@@ -1008,7 +1008,7 @@ static int riva_set_backlight_level(int level, void *data)
static int rivafb_open(struct fb_info *info, int user) static int rivafb_open(struct fb_info *info, int user)
{ {
struct riva_par *par = (struct riva_par *) info->par; struct riva_par *par = info->par;
int cnt = atomic_read(&par->ref_count); int cnt = atomic_read(&par->ref_count);
NVTRACE_ENTER(); NVTRACE_ENTER();
...@@ -1034,7 +1034,7 @@ static int rivafb_open(struct fb_info *info, int user) ...@@ -1034,7 +1034,7 @@ static int rivafb_open(struct fb_info *info, int user)
static int rivafb_release(struct fb_info *info, int user) static int rivafb_release(struct fb_info *info, int user)
{ {
struct riva_par *par = (struct riva_par *) info->par; struct riva_par *par = info->par;
int cnt = atomic_read(&par->ref_count); int cnt = atomic_read(&par->ref_count);
NVTRACE_ENTER(); NVTRACE_ENTER();
...@@ -1057,7 +1057,7 @@ static int rivafb_release(struct fb_info *info, int user) ...@@ -1057,7 +1057,7 @@ static int rivafb_release(struct fb_info *info, int user)
static int rivafb_check_var(struct fb_var_screeninfo *var, struct fb_info *info) static int rivafb_check_var(struct fb_var_screeninfo *var, struct fb_info *info)
{ {
struct fb_videomode *mode; struct fb_videomode *mode;
struct riva_par *par = (struct riva_par *) info->par; struct riva_par *par = info->par;
int nom, den; /* translating from pixels->bytes */ int nom, den; /* translating from pixels->bytes */
int mode_valid = 0; int mode_valid = 0;
...@@ -1166,7 +1166,7 @@ static int rivafb_check_var(struct fb_var_screeninfo *var, struct fb_info *info) ...@@ -1166,7 +1166,7 @@ static int rivafb_check_var(struct fb_var_screeninfo *var, struct fb_info *info)
static int rivafb_set_par(struct fb_info *info) static int rivafb_set_par(struct fb_info *info)
{ {
struct riva_par *par = (struct riva_par *) info->par; struct riva_par *par = info->par;
NVTRACE_ENTER(); NVTRACE_ENTER();
/* vgaHWunlock() + riva unlock (0x7F) */ /* vgaHWunlock() + riva unlock (0x7F) */
...@@ -1205,7 +1205,7 @@ static int rivafb_set_par(struct fb_info *info) ...@@ -1205,7 +1205,7 @@ static int rivafb_set_par(struct fb_info *info)
static int rivafb_pan_display(struct fb_var_screeninfo *var, static int rivafb_pan_display(struct fb_var_screeninfo *var,
struct fb_info *info) struct fb_info *info)
{ {
struct riva_par *par = (struct riva_par *)info->par; struct riva_par *par = info->par;
unsigned int base; unsigned int base;
NVTRACE_ENTER(); NVTRACE_ENTER();
...@@ -1241,7 +1241,7 @@ static int rivafb_pan_display(struct fb_var_screeninfo *var, ...@@ -1241,7 +1241,7 @@ static int rivafb_pan_display(struct fb_var_screeninfo *var,
static int rivafb_blank(int blank, struct fb_info *info) static int rivafb_blank(int blank, struct fb_info *info)
{ {
struct riva_par *par= (struct riva_par *)info->par; struct riva_par *par= info->par;
unsigned char tmp, vesa; unsigned char tmp, vesa;
tmp = SEQin(par, 0x01) & ~0x20; /* screen on/off */ tmp = SEQin(par, 0x01) & ~0x20; /* screen on/off */
...@@ -1304,7 +1304,7 @@ static int rivafb_setcolreg(unsigned regno, unsigned red, unsigned green, ...@@ -1304,7 +1304,7 @@ static int rivafb_setcolreg(unsigned regno, unsigned red, unsigned green,
unsigned blue, unsigned transp, unsigned blue, unsigned transp,
struct fb_info *info) struct fb_info *info)
{ {
struct riva_par *par = (struct riva_par *)info->par; struct riva_par *par = info->par;
RIVA_HW_INST *chip = &par->riva; RIVA_HW_INST *chip = &par->riva;
int i; int i;
...@@ -1393,7 +1393,7 @@ static int rivafb_setcolreg(unsigned regno, unsigned red, unsigned green, ...@@ -1393,7 +1393,7 @@ static int rivafb_setcolreg(unsigned regno, unsigned red, unsigned green,
*/ */
static void rivafb_fillrect(struct fb_info *info, const struct fb_fillrect *rect) static void rivafb_fillrect(struct fb_info *info, const struct fb_fillrect *rect)
{ {
struct riva_par *par = (struct riva_par *) info->par; struct riva_par *par = info->par;
u_int color, rop = 0; u_int color, rop = 0;
if ((info->flags & FBINFO_HWACCEL_DISABLED)) { if ((info->flags & FBINFO_HWACCEL_DISABLED)) {
...@@ -1449,7 +1449,7 @@ static void rivafb_fillrect(struct fb_info *info, const struct fb_fillrect *rect ...@@ -1449,7 +1449,7 @@ static void rivafb_fillrect(struct fb_info *info, const struct fb_fillrect *rect
*/ */
static void rivafb_copyarea(struct fb_info *info, const struct fb_copyarea *region) static void rivafb_copyarea(struct fb_info *info, const struct fb_copyarea *region)
{ {
struct riva_par *par = (struct riva_par *) info->par; struct riva_par *par = info->par;
if ((info->flags & FBINFO_HWACCEL_DISABLED)) { if ((info->flags & FBINFO_HWACCEL_DISABLED)) {
cfb_copyarea(info, region); cfb_copyarea(info, region);
...@@ -1495,7 +1495,7 @@ static inline void convert_bgcolor_16(u32 *col) ...@@ -1495,7 +1495,7 @@ static inline void convert_bgcolor_16(u32 *col)
static void rivafb_imageblit(struct fb_info *info, static void rivafb_imageblit(struct fb_info *info,
const struct fb_image *image) const struct fb_image *image)
{ {
struct riva_par *par = (struct riva_par *) info->par; struct riva_par *par = info->par;
u32 fgx = 0, bgx = 0, width, tmp; u32 fgx = 0, bgx = 0, width, tmp;
u8 *cdat = (u8 *) image->data; u8 *cdat = (u8 *) image->data;
volatile u32 __iomem *d; volatile u32 __iomem *d;
...@@ -1580,7 +1580,7 @@ static void rivafb_imageblit(struct fb_info *info, ...@@ -1580,7 +1580,7 @@ static void rivafb_imageblit(struct fb_info *info,
*/ */
static int rivafb_cursor(struct fb_info *info, struct fb_cursor *cursor) static int rivafb_cursor(struct fb_info *info, struct fb_cursor *cursor)
{ {
struct riva_par *par = (struct riva_par *) info->par; struct riva_par *par = info->par;
u8 data[MAX_CURS * MAX_CURS/8]; u8 data[MAX_CURS * MAX_CURS/8];
int i, set = cursor->set; int i, set = cursor->set;
u16 fg, bg; u16 fg, bg;
...@@ -1664,7 +1664,7 @@ static int rivafb_cursor(struct fb_info *info, struct fb_cursor *cursor) ...@@ -1664,7 +1664,7 @@ static int rivafb_cursor(struct fb_info *info, struct fb_cursor *cursor)
static int rivafb_sync(struct fb_info *info) static int rivafb_sync(struct fb_info *info)
{ {
struct riva_par *par = (struct riva_par *)info->par; struct riva_par *par = info->par;
wait_for_idle(par); wait_for_idle(par);
return 0; return 0;
...@@ -1696,7 +1696,7 @@ static struct fb_ops riva_fb_ops = { ...@@ -1696,7 +1696,7 @@ static struct fb_ops riva_fb_ops = {
static int __devinit riva_set_fbinfo(struct fb_info *info) static int __devinit riva_set_fbinfo(struct fb_info *info)
{ {
unsigned int cmap_len; unsigned int cmap_len;
struct riva_par *par = (struct riva_par *) info->par; struct riva_par *par = info->par;
NVTRACE_ENTER(); NVTRACE_ENTER();
info->flags = FBINFO_DEFAULT info->flags = FBINFO_DEFAULT
...@@ -1733,7 +1733,7 @@ static int __devinit riva_set_fbinfo(struct fb_info *info) ...@@ -1733,7 +1733,7 @@ static int __devinit riva_set_fbinfo(struct fb_info *info)
#ifdef CONFIG_PPC_OF #ifdef CONFIG_PPC_OF
static int __devinit riva_get_EDID_OF(struct fb_info *info, struct pci_dev *pd) static int __devinit riva_get_EDID_OF(struct fb_info *info, struct pci_dev *pd)
{ {
struct riva_par *par = (struct riva_par *) info->par; struct riva_par *par = info->par;
struct device_node *dp; struct device_node *dp;
unsigned char *pedid = NULL; unsigned char *pedid = NULL;
unsigned char *disptype = NULL; unsigned char *disptype = NULL;
...@@ -1767,7 +1767,7 @@ static int __devinit riva_get_EDID_OF(struct fb_info *info, struct pci_dev *pd) ...@@ -1767,7 +1767,7 @@ static int __devinit riva_get_EDID_OF(struct fb_info *info, struct pci_dev *pd)
#if defined(CONFIG_FB_RIVA_I2C) && !defined(CONFIG_PPC_OF) #if defined(CONFIG_FB_RIVA_I2C) && !defined(CONFIG_PPC_OF)
static int __devinit riva_get_EDID_i2c(struct fb_info *info) static int __devinit riva_get_EDID_i2c(struct fb_info *info)
{ {
struct riva_par *par = (struct riva_par *) info->par; struct riva_par *par = info->par;
struct fb_var_screeninfo var; struct fb_var_screeninfo var;
int i; int i;
...@@ -1837,7 +1837,7 @@ static void __devinit riva_get_EDID(struct fb_info *info, struct pci_dev *pdev) ...@@ -1837,7 +1837,7 @@ static void __devinit riva_get_EDID(struct fb_info *info, struct pci_dev *pdev)
static void __devinit riva_get_edidinfo(struct fb_info *info) static void __devinit riva_get_edidinfo(struct fb_info *info)
{ {
struct fb_var_screeninfo *var = &rivafb_default_var; struct fb_var_screeninfo *var = &rivafb_default_var;
struct riva_par *par = (struct riva_par *) info->par; struct riva_par *par = info->par;
fb_edid_to_monspecs(par->EDID, &info->monspecs); fb_edid_to_monspecs(par->EDID, &info->monspecs);
fb_videomode_to_modelist(info->monspecs.modedb, info->monspecs.modedb_len, fb_videomode_to_modelist(info->monspecs.modedb, info->monspecs.modedb_len,
...@@ -1909,7 +1909,7 @@ static int __devinit rivafb_probe(struct pci_dev *pd, ...@@ -1909,7 +1909,7 @@ static int __devinit rivafb_probe(struct pci_dev *pd,
ret = -ENOMEM; ret = -ENOMEM;
goto err_ret; goto err_ret;
} }
default_par = (struct riva_par *) info->par; default_par = info->par;
default_par->pdev = pd; default_par->pdev = pd;
info->pixmap.addr = kmalloc(8 * 1024, GFP_KERNEL); info->pixmap.addr = kmalloc(8 * 1024, GFP_KERNEL);
...@@ -2070,7 +2070,7 @@ static int __devinit rivafb_probe(struct pci_dev *pd, ...@@ -2070,7 +2070,7 @@ static int __devinit rivafb_probe(struct pci_dev *pd,
err_iounmap_screen_base: err_iounmap_screen_base:
#ifdef CONFIG_FB_RIVA_I2C #ifdef CONFIG_FB_RIVA_I2C
riva_delete_i2c_busses((struct riva_par *) info->par); riva_delete_i2c_busses(info->par);
#endif #endif
iounmap(info->screen_base); iounmap(info->screen_base);
err_iounmap_pramin: err_iounmap_pramin:
...@@ -2093,7 +2093,7 @@ err_ret: ...@@ -2093,7 +2093,7 @@ err_ret:
static void __exit rivafb_remove(struct pci_dev *pd) static void __exit rivafb_remove(struct pci_dev *pd)
{ {
struct fb_info *info = pci_get_drvdata(pd); struct fb_info *info = pci_get_drvdata(pd);
struct riva_par *par = (struct riva_par *) info->par; struct riva_par *par = info->par;
NVTRACE_ENTER(); NVTRACE_ENTER();
if (!info) if (!info)
......
...@@ -30,7 +30,7 @@ ...@@ -30,7 +30,7 @@
static void riva_gpio_setscl(void* data, int state) static void riva_gpio_setscl(void* data, int state)
{ {
struct riva_i2c_chan *chan = (struct riva_i2c_chan *)data; struct riva_i2c_chan *chan = data;
struct riva_par *par = chan->par; struct riva_par *par = chan->par;
u32 val; u32 val;
...@@ -48,7 +48,7 @@ static void riva_gpio_setscl(void* data, int state) ...@@ -48,7 +48,7 @@ static void riva_gpio_setscl(void* data, int state)
static void riva_gpio_setsda(void* data, int state) static void riva_gpio_setsda(void* data, int state)
{ {
struct riva_i2c_chan *chan = (struct riva_i2c_chan *)data; struct riva_i2c_chan *chan = data;
struct riva_par *par = chan->par; struct riva_par *par = chan->par;
u32 val; u32 val;
...@@ -66,7 +66,7 @@ static void riva_gpio_setsda(void* data, int state) ...@@ -66,7 +66,7 @@ static void riva_gpio_setsda(void* data, int state)
static int riva_gpio_getscl(void* data) static int riva_gpio_getscl(void* data)
{ {
struct riva_i2c_chan *chan = (struct riva_i2c_chan *)data; struct riva_i2c_chan *chan = data;
struct riva_par *par = chan->par; struct riva_par *par = chan->par;
u32 val = 0; u32 val = 0;
...@@ -81,7 +81,7 @@ static int riva_gpio_getscl(void* data) ...@@ -81,7 +81,7 @@ static int riva_gpio_getscl(void* data)
static int riva_gpio_getsda(void* data) static int riva_gpio_getsda(void* data)
{ {
struct riva_i2c_chan *chan = (struct riva_i2c_chan *)data; struct riva_i2c_chan *chan = data;
struct riva_par *par = chan->par; struct riva_par *par = chan->par;
u32 val = 0; u32 val = 0;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment