Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 104573
b: refs/heads/master
c: 44c389a
h: refs/heads/master
i:
  104571: 08b681f
v: v3
  • Loading branch information
Alan Cox authored and Greg Kroah-Hartman committed Jul 21, 2008
1 parent 703cf4a commit 82dd9bb
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 15 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: 0391c828ce75cc71ae301946699a6f2d515fd99d
refs/heads/master: 44c389a00ff7229ab2f2aab22ce03ae0c9037df7
23 changes: 13 additions & 10 deletions trunk/drivers/usb/gadget/inode.c
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
#include <asm/uaccess.h>
#include <linux/slab.h>
#include <linux/poll.h>
#include <linux/smp_lock.h>

#include <linux/device.h>
#include <linux/moduleparam.h>
Expand Down Expand Up @@ -483,8 +484,7 @@ ep_release (struct inode *inode, struct file *fd)
return 0;
}

static int ep_ioctl (struct inode *inode, struct file *fd,
unsigned code, unsigned long value)
static long ep_ioctl(struct file *fd, unsigned code, unsigned long value)
{
struct ep_data *data = fd->private_data;
int status;
Expand Down Expand Up @@ -740,7 +740,7 @@ static const struct file_operations ep_io_operations = {

.read = ep_read,
.write = ep_write,
.ioctl = ep_ioctl,
.unlocked_ioctl = ep_ioctl,
.release = ep_release,

.aio_read = ep_aio_read,
Expand Down Expand Up @@ -1294,15 +1294,18 @@ ep0_poll (struct file *fd, poll_table *wait)
return mask;
}

static int dev_ioctl (struct inode *inode, struct file *fd,
unsigned code, unsigned long value)
static long dev_ioctl (struct file *fd, unsigned code, unsigned long value)
{
struct dev_data *dev = fd->private_data;
struct usb_gadget *gadget = dev->gadget;
long ret = -ENOTTY;

if (gadget->ops->ioctl)
return gadget->ops->ioctl (gadget, code, value);
return -ENOTTY;
if (gadget->ops->ioctl) {
lock_kernel();
ret = gadget->ops->ioctl (gadget, code, value);
unlock_kernel();
}
return ret;
}

/* used after device configuration */
Expand All @@ -1314,7 +1317,7 @@ static const struct file_operations ep0_io_operations = {
.write = ep0_write,
.fasync = ep0_fasync,
.poll = ep0_poll,
.ioctl = dev_ioctl,
.unlocked_ioctl = dev_ioctl,
.release = dev_release,
};

Expand Down Expand Up @@ -1964,7 +1967,7 @@ static const struct file_operations dev_init_operations = {
.open = dev_open,
.write = dev_config,
.fasync = ep0_fasync,
.ioctl = dev_ioctl,
.unlocked_ioctl = dev_ioctl,
.release = dev_release,
};

Expand Down
7 changes: 3 additions & 4 deletions trunk/drivers/usb/gadget/printer.c
Original file line number Diff line number Diff line change
Expand Up @@ -828,9 +828,8 @@ printer_poll(struct file *fd, poll_table *wait)
return status;
}

static int
printer_ioctl(struct inode *inode, struct file *fd, unsigned int code,
unsigned long arg)
static long
printer_ioctl(struct file *fd, unsigned int code, unsigned long arg)
{
struct printer_dev *dev = fd->private_data;
unsigned long flags;
Expand Down Expand Up @@ -869,7 +868,7 @@ static struct file_operations printer_io_operations = {
.write = printer_write,
.fsync = printer_fsync,
.poll = printer_poll,
.ioctl = printer_ioctl,
.unlocked_ioctl = printer_ioctl,
.release = printer_close
};

Expand Down

0 comments on commit 82dd9bb

Please sign in to comment.