Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 95164
b: refs/heads/master
c: bdf183a
h: refs/heads/master
v: v3
  • Loading branch information
Alan Cox authored and Linus Torvalds committed Apr 30, 2008
1 parent 6f4396a commit f79eba8
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 10 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: eb1745529622f204733139bde2201eb4ee994c03
refs/heads/master: bdf183aa47dcb46782e22ebd4d1061e47ad74b14
27 changes: 18 additions & 9 deletions trunk/drivers/char/rocket.c
Original file line number Diff line number Diff line change
Expand Up @@ -1433,29 +1433,38 @@ static int rp_ioctl(struct tty_struct *tty, struct file *file,
{
struct r_port *info = (struct r_port *) tty->driver_data;
void __user *argp = (void __user *)arg;
int ret = 0;

if (cmd != RCKP_GET_PORTS && rocket_paranoia_check(info, "rp_ioctl"))
return -ENXIO;

lock_kernel();

switch (cmd) {
case RCKP_GET_STRUCT:
if (copy_to_user(argp, info, sizeof (struct r_port)))
return -EFAULT;
return 0;
ret = -EFAULT;
break;
case RCKP_GET_CONFIG:
return get_config(info, argp);
ret = get_config(info, argp);
break;
case RCKP_SET_CONFIG:
return set_config(info, argp);
ret = set_config(info, argp);
break;
case RCKP_GET_PORTS:
return get_ports(info, argp);
ret = get_ports(info, argp);
break;
case RCKP_RESET_RM2:
return reset_rm2(info, argp);
ret = reset_rm2(info, argp);
break;
case RCKP_GET_VERSION:
return get_version(info, argp);
ret = get_version(info, argp);
break;
default:
return -ENOIOCTLCMD;
ret = -ENOIOCTLCMD;
}
return 0;
unlock_kernel();
return ret;
}

static void rp_send_xchar(struct tty_struct *tty, char ch)
Expand Down

0 comments on commit f79eba8

Please sign in to comment.