aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndi Kleen <ak@linux.intel.com>2010-06-01 17:04:41 -0400
committerGreg Kroah-Hartman <gregkh@suse.de>2010-08-10 17:35:35 -0400
commitc532b29a6f6d31e84a7c88f995eebdc75ebd4248 (patch)
tree5b8dbfae37f6c3c1530ee3651c9d28e00bd15f5e
parent6e12ea4658487ba9c746e95b31014cb89f63703b (diff)
USB-BKL: Convert usb_driver ioctl to unlocked_ioctl
And audit all the users. None needed the BKL. That was easy because there was only very few around. Tested with allmodconfig build on x86-64 Signed-off-by: Andi Kleen <ak@linux.intel.com> Cc: Arnd Bergmann <arnd@arndb.de> From: Andi Kleen <ak@linux.intel.com>
-rw-r--r--drivers/usb/core/devio.c7
-rw-r--r--drivers/usb/core/hub.c3
-rw-r--r--drivers/usb/misc/usbtest.c3
-rw-r--r--include/linux/usb.h2
4 files changed, 7 insertions, 8 deletions
diff --git a/drivers/usb/core/devio.c b/drivers/usb/core/devio.c
index c2f62a3993d2..f1aaff6202a5 100644
--- a/drivers/usb/core/devio.c
+++ b/drivers/usb/core/devio.c
@@ -1668,13 +1668,10 @@ static int proc_ioctl(struct dev_state *ps, struct usbdevfs_ioctl *ctl)
1668 default: 1668 default:
1669 if (intf->dev.driver) 1669 if (intf->dev.driver)
1670 driver = to_usb_driver(intf->dev.driver); 1670 driver = to_usb_driver(intf->dev.driver);
1671 if (driver == NULL || driver->ioctl == NULL) { 1671 if (driver == NULL || driver->unlocked_ioctl == NULL) {
1672 retval = -ENOTTY; 1672 retval = -ENOTTY;
1673 } else { 1673 } else {
1674 /* keep API that guarantees BKL */ 1674 retval = driver->unlocked_ioctl(intf, ctl->ioctl_code, buf);
1675 lock_kernel();
1676 retval = driver->ioctl(intf, ctl->ioctl_code, buf);
1677 unlock_kernel();
1678 if (retval == -ENOIOCTLCMD) 1675 if (retval == -ENOIOCTLCMD)
1679 retval = -ENOTTY; 1676 retval = -ENOTTY;
1680 } 1677 }
diff --git a/drivers/usb/core/hub.c b/drivers/usb/core/hub.c
index 9cd77a2af821..d337ef80bf43 100644
--- a/drivers/usb/core/hub.c
+++ b/drivers/usb/core/hub.c
@@ -1294,6 +1294,7 @@ descriptor_error:
1294 return -ENODEV; 1294 return -ENODEV;
1295} 1295}
1296 1296
1297/* No BKL needed */
1297static int 1298static int
1298hub_ioctl(struct usb_interface *intf, unsigned int code, void *user_data) 1299hub_ioctl(struct usb_interface *intf, unsigned int code, void *user_data)
1299{ 1300{
@@ -3465,7 +3466,7 @@ static struct usb_driver hub_driver = {
3465 .reset_resume = hub_reset_resume, 3466 .reset_resume = hub_reset_resume,
3466 .pre_reset = hub_pre_reset, 3467 .pre_reset = hub_pre_reset,
3467 .post_reset = hub_post_reset, 3468 .post_reset = hub_post_reset,
3468 .ioctl = hub_ioctl, 3469 .unlocked_ioctl = hub_ioctl,
3469 .id_table = hub_id_table, 3470 .id_table = hub_id_table,
3470 .supports_autosuspend = 1, 3471 .supports_autosuspend = 1,
3471}; 3472};
diff --git a/drivers/usb/misc/usbtest.c b/drivers/usb/misc/usbtest.c
index 16dffe99d9f1..0cfbd789ddf2 100644
--- a/drivers/usb/misc/usbtest.c
+++ b/drivers/usb/misc/usbtest.c
@@ -1548,6 +1548,7 @@ fail:
1548 * off just killing the userspace task and waiting for it to exit. 1548 * off just killing the userspace task and waiting for it to exit.
1549 */ 1549 */
1550 1550
1551/* No BKL needed */
1551static int 1552static int
1552usbtest_ioctl (struct usb_interface *intf, unsigned int code, void *buf) 1553usbtest_ioctl (struct usb_interface *intf, unsigned int code, void *buf)
1553{ 1554{
@@ -2170,7 +2171,7 @@ static struct usb_driver usbtest_driver = {
2170 .name = "usbtest", 2171 .name = "usbtest",
2171 .id_table = id_table, 2172 .id_table = id_table,
2172 .probe = usbtest_probe, 2173 .probe = usbtest_probe,
2173 .ioctl = usbtest_ioctl, 2174 .unlocked_ioctl = usbtest_ioctl,
2174 .disconnect = usbtest_disconnect, 2175 .disconnect = usbtest_disconnect,
2175 .suspend = usbtest_suspend, 2176 .suspend = usbtest_suspend,
2176 .resume = usbtest_resume, 2177 .resume = usbtest_resume,
diff --git a/include/linux/usb.h b/include/linux/usb.h
index d5922a877994..e6cbc34901f4 100644
--- a/include/linux/usb.h
+++ b/include/linux/usb.h
@@ -843,7 +843,7 @@ struct usb_driver {
843 843
844 void (*disconnect) (struct usb_interface *intf); 844 void (*disconnect) (struct usb_interface *intf);
845 845
846 int (*ioctl) (struct usb_interface *intf, unsigned int code, 846 int (*unlocked_ioctl) (struct usb_interface *intf, unsigned int code,
847 void *buf); 847 void *buf);
848 848
849 int (*suspend) (struct usb_interface *intf, pm_message_t message); 849 int (*suspend) (struct usb_interface *intf, pm_message_t message);