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