Commit 20400563 authored by David S. Miller's avatar David S. Miller

[SBUSFB]: Fix up ioctl helper changes.

parent c69d3a9c
......@@ -183,7 +183,7 @@ static int bw2_ioctl(struct inode *inode, struct file *file, unsigned int cmd,
{
struct bw2_par *par = (struct bw2_par *) info->par;
return sbusfb_ioctl_helper(cmd, info,
return sbusfb_ioctl_helper(cmd, arg, info,
FBTYPE_SUN2BW, 1, par->fbsize);
}
......
......@@ -321,7 +321,7 @@ static int cg14_ioctl(struct inode *inode, struct file *file, unsigned int cmd,
break;
default:
ret = sbusfb_ioctl_helper(cmd, info,
ret = sbusfb_ioctl_helper(cmd, arg, info,
FBTYPE_MDICOLOR, 24, par->fbsize);
break;
};
......
......@@ -240,7 +240,7 @@ static int cg3_ioctl(struct inode *inode, struct file *file, unsigned int cmd,
{
struct cg3_par *par = (struct cg3_par *) info->par;
return sbusfb_ioctl_helper(cmd, info,
return sbusfb_ioctl_helper(cmd, arg, info,
FBTYPE_SUN3COLOR, 8, par->fbsize);
}
......
......@@ -506,7 +506,7 @@ static int cg6_ioctl(struct inode *inode, struct file *file, unsigned int cmd,
{
struct cg6_par *par = (struct cg6_par *) info->par;
return sbusfb_ioctl_helper(cmd, info,
return sbusfb_ioctl_helper(cmd, arg, info,
FBTYPE_SUNFAST_COLOR, 8, par->fbsize);
}
......
......@@ -788,7 +788,7 @@ static int ffb_ioctl(struct inode *inode, struct file *file, unsigned int cmd,
{
struct ffb_par *par = (struct ffb_par *) info->par;
return sbusfb_ioctl_helper(cmd, info,
return sbusfb_ioctl_helper(cmd, arg, info,
FBTYPE_CREATOR, 24, par->fbsize);
}
......
......@@ -237,7 +237,7 @@ static int p9100_ioctl(struct inode *inode, struct file *file, unsigned int cmd,
struct p9100_par *par = (struct p9100_par *) info->par;
/* Make it look like a cg3. */
return sbusfb_ioctl_helper(cmd, info,
return sbusfb_ioctl_helper(cmd, arg, info,
FBTYPE_SUN3COLOR, 8, par->fbsize);
}
......
......@@ -9,6 +9,7 @@
#include <linux/fb.h>
#include <asm/oplib.h>
#include <asm/fbio.h>
#include "sbuslib.h"
......@@ -85,7 +86,8 @@ int sbusfb_mmap_helper(struct sbus_mmap_map *map,
}
EXPORT_SYMBOL(sbusfb_mmap_helper);
int sbusfb_ioctl_helper(unsigned long cmd, struct fb_info *info,
int sbusfb_ioctl_helper(unsigned long cmd, unsigned long arg,
struct fb_info *info,
int type, int fb_depth, unsigned long fb_size)
{
switch(cmd) {
......@@ -106,7 +108,7 @@ int sbusfb_ioctl_helper(unsigned long cmd, struct fb_info *info,
struct fb_cmap cmap;
u16 red, green, blue;
unsigned char *ured, *ugreen, *ublue;
int index, count, i, err;
int index, count, i;
if (get_user(index, &c->index) ||
__get_user(count, &c->count) ||
......@@ -120,6 +122,8 @@ int sbusfb_ioctl_helper(unsigned long cmd, struct fb_info *info,
cmap.green = &green;
cmap.blue = &blue;
for (i = 0; i < count; i++) {
int err;
if (get_user(red, &ured[i]) ||
get_user(green, &ugreen[i]) ||
get_user(blue, &ublue[i]))
......@@ -128,15 +132,15 @@ int sbusfb_ioctl_helper(unsigned long cmd, struct fb_info *info,
cmap.start = index + i;
err = fb_set_cmap(&cmap, 0, info);
if (err)
break;
return err;
}
return err;
return 0;
}
case FBIOGETCMAP_SPARC: {
struct fbcmap *c = (struct fbcmap *) arg;
unsigned char *ured, *ugreen, *ublue;
struct fb_cmap *cmap = &info->cmap;
int index, count, i, err;
int index, count, i;
if (get_user(index, &c->index) ||
__get_user(count, &c->count) ||
......@@ -154,7 +158,7 @@ int sbusfb_ioctl_helper(unsigned long cmd, struct fb_info *info,
put_user(cmap->blue[index + i], &ublue[i]))
return -EFAULT;
}
return err;
return 0;
}
default:
return -EINVAL;
......
......@@ -17,7 +17,8 @@ extern int sbusfb_mmap_helper(struct sbus_mmap_map *map,
unsigned long physbase, unsigned long fbsize,
unsigned long iospace,
struct vm_area_struct *vma);
int sbusfb_ioctl_helper(unsigned long cmd, struct fb_info *info,
int sbusfb_ioctl_helper(unsigned long cmd, unsigned long arg,
struct fb_info *info,
int type, int fb_depth, unsigned long fb_size);
#endif /* _SBUSLIB_H */
......@@ -269,7 +269,7 @@ static int tcx_ioctl(struct inode *inode, struct file *file, unsigned int cmd,
{
struct tcx_par *par = (struct tcx_par *) info->par;
return sbusfb_ioctl_helper(cmd, info,
return sbusfb_ioctl_helper(cmd, arg, info,
FBTYPE_TCXCOLOR,
(par->lowdepth ? 8 : 24),
par->fbsize);
......
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