From 5990108cfcd3eb2d365c9ea6f82318be80c4e9d3 Mon Sep 17 00:00:00 2001 From: Thomas Gleixner Date: Thu, 15 Oct 2009 20:28:53 +0000 Subject: Bluetooth: Remove stub ioctl in hci_vhci Remove the empty ioctl which just returns -EINVAL. vfs_ioctl() will return -ENOTTY instead, but I doubt that any application will notice the difference :) Signed-off-by: Thomas Gleixner Signed-off-by: Marcel Holtmann --- drivers/bluetooth/hci_vhci.c | 7 ------- 1 file changed, 7 deletions(-) (limited to 'drivers/bluetooth/hci_vhci.c') diff --git a/drivers/bluetooth/hci_vhci.c b/drivers/bluetooth/hci_vhci.c index d5cde6d86f8..ff02e901ab8 100644 --- a/drivers/bluetooth/hci_vhci.c +++ b/drivers/bluetooth/hci_vhci.c @@ -218,12 +218,6 @@ static unsigned int vhci_poll(struct file *file, poll_table *wait) return POLLOUT | POLLWRNORM; } -static int vhci_ioctl(struct inode *inode, struct file *file, - unsigned int cmd, unsigned long arg) -{ - return -EINVAL; -} - static int vhci_open(struct inode *inode, struct file *file) { struct vhci_data *data; @@ -287,7 +281,6 @@ static const struct file_operations vhci_fops = { .read = vhci_read, .write = vhci_write, .poll = vhci_poll, - .ioctl = vhci_ioctl, .open = vhci_open, .release = vhci_release, }; -- cgit v1.2.3-70-g09d2 From 329ab1b3e6ceac3f77ab400206a97cc402624259 Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Thu, 3 Dec 2009 18:05:16 +0100 Subject: Bluetooth: Remove unused global minor variable After the removal of the module parameter for setting the minor number, this variable became unused. So just remove it. Signed-off-by: Marcel Holtmann --- drivers/bluetooth/hci_vhci.c | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) (limited to 'drivers/bluetooth/hci_vhci.c') diff --git a/drivers/bluetooth/hci_vhci.c b/drivers/bluetooth/hci_vhci.c index ff02e901ab8..c1d389f2cba 100644 --- a/drivers/bluetooth/hci_vhci.c +++ b/drivers/bluetooth/hci_vhci.c @@ -41,8 +41,6 @@ #define VERSION "1.3" -static int minor = MISC_DYNAMIC_MINOR; - struct vhci_data { struct hci_dev *hdev; @@ -295,18 +293,12 @@ static int __init vhci_init(void) { BT_INFO("Virtual HCI driver ver %s", VERSION); - if (misc_register(&vhci_miscdev) < 0) { - BT_ERR("Can't register misc device with minor %d", minor); - return -EIO; - } - - return 0; + return misc_register(&vhci_miscdev); } static void __exit vhci_exit(void) { - if (misc_deregister(&vhci_miscdev) < 0) - BT_ERR("Can't unregister misc device with minor %d", minor); + misc_deregister(&vhci_miscdev); } module_init(vhci_init); -- cgit v1.2.3-70-g09d2 From fed4c2508b7419d0a55958fead6151b32def1683 Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Thu, 3 Dec 2009 18:07:28 +0100 Subject: Bluetooth: Fix miscdev ops owner for virtual driver The /dev/vhci ops don't refer to the module and so it is possible to unload the module while the file descriptor is in use. This was an accidental removal after the cleanup. Signed-off-by: Marcel Holtmann --- drivers/bluetooth/hci_vhci.c | 1 + 1 file changed, 1 insertion(+) (limited to 'drivers/bluetooth/hci_vhci.c') diff --git a/drivers/bluetooth/hci_vhci.c b/drivers/bluetooth/hci_vhci.c index c1d389f2cba..7595274103f 100644 --- a/drivers/bluetooth/hci_vhci.c +++ b/drivers/bluetooth/hci_vhci.c @@ -276,6 +276,7 @@ static int vhci_release(struct inode *inode, struct file *file) } static const struct file_operations vhci_fops = { + .owner = THIS_MODULE, .read = vhci_read, .write = vhci_write, .poll = vhci_poll, -- cgit v1.2.3-70-g09d2