aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/usb/gadget/inode.c23
-rw-r--r--drivers/usb/gadget/printer.c7
2 files changed, 16 insertions, 14 deletions
diff --git a/drivers/usb/gadget/inode.c b/drivers/usb/gadget/inode.c
index f132a9219e11..04692d59fc1c 100644
--- a/drivers/usb/gadget/inode.c
+++ b/drivers/usb/gadget/inode.c
@@ -32,6 +32,7 @@
32#include <asm/uaccess.h> 32#include <asm/uaccess.h>
33#include <linux/slab.h> 33#include <linux/slab.h>
34#include <linux/poll.h> 34#include <linux/poll.h>
35#include <linux/smp_lock.h>
35 36
36#include <linux/device.h> 37#include <linux/device.h>
37#include <linux/moduleparam.h> 38#include <linux/moduleparam.h>
@@ -483,8 +484,7 @@ ep_release (struct inode *inode, struct file *fd)
483 return 0; 484 return 0;
484} 485}
485 486
486static int ep_ioctl (struct inode *inode, struct file *fd, 487static long ep_ioctl(struct file *fd, unsigned code, unsigned long value)
487 unsigned code, unsigned long value)
488{ 488{
489 struct ep_data *data = fd->private_data; 489 struct ep_data *data = fd->private_data;
490 int status; 490 int status;
@@ -740,7 +740,7 @@ static const struct file_operations ep_io_operations = {
740 740
741 .read = ep_read, 741 .read = ep_read,
742 .write = ep_write, 742 .write = ep_write,
743 .ioctl = ep_ioctl, 743 .unlocked_ioctl = ep_ioctl,
744 .release = ep_release, 744 .release = ep_release,
745 745
746 .aio_read = ep_aio_read, 746 .aio_read = ep_aio_read,
@@ -1294,15 +1294,18 @@ out:
1294 return mask; 1294 return mask;
1295} 1295}
1296 1296
1297static int dev_ioctl (struct inode *inode, struct file *fd, 1297static long dev_ioctl (struct file *fd, unsigned code, unsigned long value)
1298 unsigned code, unsigned long value)
1299{ 1298{
1300 struct dev_data *dev = fd->private_data; 1299 struct dev_data *dev = fd->private_data;
1301 struct usb_gadget *gadget = dev->gadget; 1300 struct usb_gadget *gadget = dev->gadget;
1301 long ret = -ENOTTY;
1302 1302
1303 if (gadget->ops->ioctl) 1303 if (gadget->ops->ioctl) {
1304 return gadget->ops->ioctl (gadget, code, value); 1304 lock_kernel();
1305 return -ENOTTY; 1305 ret = gadget->ops->ioctl (gadget, code, value);
1306 unlock_kernel();
1307 }
1308 return ret;
1306} 1309}
1307 1310
1308/* used after device configuration */ 1311/* used after device configuration */
@@ -1314,7 +1317,7 @@ static const struct file_operations ep0_io_operations = {
1314 .write = ep0_write, 1317 .write = ep0_write,
1315 .fasync = ep0_fasync, 1318 .fasync = ep0_fasync,
1316 .poll = ep0_poll, 1319 .poll = ep0_poll,
1317 .ioctl = dev_ioctl, 1320 .unlocked_ioctl = dev_ioctl,
1318 .release = dev_release, 1321 .release = dev_release,
1319}; 1322};
1320 1323
@@ -1964,7 +1967,7 @@ static const struct file_operations dev_init_operations = {
1964 .open = dev_open, 1967 .open = dev_open,
1965 .write = dev_config, 1968 .write = dev_config,
1966 .fasync = ep0_fasync, 1969 .fasync = ep0_fasync,
1967 .ioctl = dev_ioctl, 1970 .unlocked_ioctl = dev_ioctl,
1968 .release = dev_release, 1971 .release = dev_release,
1969}; 1972};
1970 1973
diff --git a/drivers/usb/gadget/printer.c b/drivers/usb/gadget/printer.c
index ec8f2eb041ca..9caaec3ae9a3 100644
--- a/drivers/usb/gadget/printer.c
+++ b/drivers/usb/gadget/printer.c
@@ -828,9 +828,8 @@ printer_poll(struct file *fd, poll_table *wait)
828 return status; 828 return status;
829} 829}
830 830
831static int 831static long
832printer_ioctl(struct inode *inode, struct file *fd, unsigned int code, 832printer_ioctl(struct file *fd, unsigned int code, unsigned long arg)
833 unsigned long arg)
834{ 833{
835 struct printer_dev *dev = fd->private_data; 834 struct printer_dev *dev = fd->private_data;
836 unsigned long flags; 835 unsigned long flags;
@@ -869,7 +868,7 @@ static struct file_operations printer_io_operations = {
869 .write = printer_write, 868 .write = printer_write,
870 .fsync = printer_fsync, 869 .fsync = printer_fsync,
871 .poll = printer_poll, 870 .poll = printer_poll,
872 .ioctl = printer_ioctl, 871 .unlocked_ioctl = printer_ioctl,
873 .release = printer_close 872 .release = printer_close
874}; 873};
875 874