Skip to content

Commit 13ea401

Browse files
David HerrmannGustavo F. Padovan
authored andcommitted
Bluetooth: Ignore hci_unregister_dev return value
Make all bluetooth drivers ignore the return value of hci_unregister_dev as it always returns 0. In the next step, hci_unregister_dev can be modified to return void. Some of the drivers already ignore the return value (including btusb), hence, this will increase consitency in the bluetooth drivers. Signed-off-by: David Herrmann <dh.herrmann@googlemail.com> Acked-by: Marcel Holtmann <marcel@holtmann.org> Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi>
1 parent 96af739 commit 13ea401

6 files changed

Lines changed: 6 additions & 19 deletions

File tree

‎drivers/bluetooth/bfusb.c‎

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -750,9 +750,7 @@ static void bfusb_disconnect(struct usb_interface *intf)
750750

751751
bfusb_close(hdev);
752752

753-
if (hci_unregister_dev(hdev) < 0)
754-
BT_ERR("Can't unregister HCI device %s", hdev->name);
755-
753+
hci_unregister_dev(hdev);
756754
hci_free_dev(hdev);
757755
}
758756

‎drivers/bluetooth/bluecard_cs.c‎

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -844,9 +844,7 @@ static int bluecard_close(bluecard_info_t *info)
844844
/* Turn FPGA off */
845845
outb(0x80, iobase + 0x30);
846846

847-
if (hci_unregister_dev(hdev) < 0)
848-
BT_ERR("Can't unregister HCI device %s", hdev->name);
849-
847+
hci_unregister_dev(hdev);
850848
hci_free_dev(hdev);
851849

852850
return 0;

‎drivers/bluetooth/bt3c_cs.c‎

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -636,9 +636,7 @@ static int bt3c_close(bt3c_info_t *info)
636636

637637
bt3c_hci_close(hdev);
638638

639-
if (hci_unregister_dev(hdev) < 0)
640-
BT_ERR("Can't unregister HCI device %s", hdev->name);
641-
639+
hci_unregister_dev(hdev);
642640
hci_free_dev(hdev);
643641

644642
return 0;

‎drivers/bluetooth/btuart_cs.c‎

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -565,9 +565,7 @@ static int btuart_close(btuart_info_t *info)
565565

566566
spin_unlock_irqrestore(&(info->lock), flags);
567567

568-
if (hci_unregister_dev(hdev) < 0)
569-
BT_ERR("Can't unregister HCI device %s", hdev->name);
570-
568+
hci_unregister_dev(hdev);
571569
hci_free_dev(hdev);
572570

573571
return 0;

‎drivers/bluetooth/dtl1_cs.c‎

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -551,9 +551,7 @@ static int dtl1_close(dtl1_info_t *info)
551551

552552
spin_unlock_irqrestore(&(info->lock), flags);
553553

554-
if (hci_unregister_dev(hdev) < 0)
555-
BT_ERR("Can't unregister HCI device %s", hdev->name);
556-
554+
hci_unregister_dev(hdev);
557555
hci_free_dev(hdev);
558556

559557
return 0;

‎drivers/bluetooth/hci_vhci.c‎

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -264,10 +264,7 @@ static int vhci_release(struct inode *inode, struct file *file)
264264
struct vhci_data *data = file->private_data;
265265
struct hci_dev *hdev = data->hdev;
266266

267-
if (hci_unregister_dev(hdev) < 0) {
268-
BT_ERR("Can't unregister HCI device %s", hdev->name);
269-
}
270-
267+
hci_unregister_dev(hdev);
271268
hci_free_dev(hdev);
272269

273270
file->private_data = NULL;

0 commit comments

Comments
 (0)