All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/2] Bluetooth: Ignore hci_unregister_dev return value
@ 2011-10-26  8:43 David Herrmann
  2011-10-26  8:43 ` [PATCH 2/2] Bluetooth: Make hci_unregister_dev return void David Herrmann
  2011-10-26  8:55 ` [PATCH 1/2] Bluetooth: Ignore hci_unregister_dev return value Marcel Holtmann
  0 siblings, 2 replies; 5+ messages in thread
From: David Herrmann @ 2011-10-26  8:43 UTC (permalink / raw)
  To: linux-bluetooth; +Cc: padovan, marcel, David Herrmann

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>
---
 drivers/bluetooth/bfusb.c       |    4 +---
 drivers/bluetooth/bluecard_cs.c |    4 +---
 drivers/bluetooth/bt3c_cs.c     |    4 +---
 drivers/bluetooth/btuart_cs.c   |    4 +---
 drivers/bluetooth/dtl1_cs.c     |    4 +---
 drivers/bluetooth/hci_vhci.c    |    5 +----
 6 files changed, 6 insertions(+), 19 deletions(-)

diff --git a/drivers/bluetooth/bfusb.c b/drivers/bluetooth/bfusb.c
index 005919a..6580d50 100644
--- a/drivers/bluetooth/bfusb.c
+++ b/drivers/bluetooth/bfusb.c
@@ -750,9 +750,7 @@ static void bfusb_disconnect(struct usb_interface *intf)
 
 	bfusb_close(hdev);
 
-	if (hci_unregister_dev(hdev) < 0)
-		BT_ERR("Can't unregister HCI device %s", hdev->name);
-
+	hci_unregister_dev(hdev);
 	hci_free_dev(hdev);
 }
 
diff --git a/drivers/bluetooth/bluecard_cs.c b/drivers/bluetooth/bluecard_cs.c
index aed1904..c6a0c61 100644
--- a/drivers/bluetooth/bluecard_cs.c
+++ b/drivers/bluetooth/bluecard_cs.c
@@ -844,9 +844,7 @@ static int bluecard_close(bluecard_info_t *info)
 	/* Turn FPGA off */
 	outb(0x80, iobase + 0x30);
 
-	if (hci_unregister_dev(hdev) < 0)
-		BT_ERR("Can't unregister HCI device %s", hdev->name);
-
+	hci_unregister_dev(hdev);
 	hci_free_dev(hdev);
 
 	return 0;
diff --git a/drivers/bluetooth/bt3c_cs.c b/drivers/bluetooth/bt3c_cs.c
index 4fc0194..0c97e5d 100644
--- a/drivers/bluetooth/bt3c_cs.c
+++ b/drivers/bluetooth/bt3c_cs.c
@@ -636,9 +636,7 @@ static int bt3c_close(bt3c_info_t *info)
 
 	bt3c_hci_close(hdev);
 
-	if (hci_unregister_dev(hdev) < 0)
-		BT_ERR("Can't unregister HCI device %s", hdev->name);
-
+	hci_unregister_dev(hdev);
 	hci_free_dev(hdev);
 
 	return 0;
diff --git a/drivers/bluetooth/btuart_cs.c b/drivers/bluetooth/btuart_cs.c
index 526b618..200b3a2 100644
--- a/drivers/bluetooth/btuart_cs.c
+++ b/drivers/bluetooth/btuart_cs.c
@@ -565,9 +565,7 @@ static int btuart_close(btuart_info_t *info)
 
 	spin_unlock_irqrestore(&(info->lock), flags);
 
-	if (hci_unregister_dev(hdev) < 0)
-		BT_ERR("Can't unregister HCI device %s", hdev->name);
-
+	hci_unregister_dev(hdev);
 	hci_free_dev(hdev);
 
 	return 0;
diff --git a/drivers/bluetooth/dtl1_cs.c b/drivers/bluetooth/dtl1_cs.c
index 5e4c2de..969bb22 100644
--- a/drivers/bluetooth/dtl1_cs.c
+++ b/drivers/bluetooth/dtl1_cs.c
@@ -551,9 +551,7 @@ static int dtl1_close(dtl1_info_t *info)
 
 	spin_unlock_irqrestore(&(info->lock), flags);
 
-	if (hci_unregister_dev(hdev) < 0)
-		BT_ERR("Can't unregister HCI device %s", hdev->name);
-
+	hci_unregister_dev(hdev);
 	hci_free_dev(hdev);
 
 	return 0;
diff --git a/drivers/bluetooth/hci_vhci.c b/drivers/bluetooth/hci_vhci.c
index 67c180c..2e302a1 100644
--- a/drivers/bluetooth/hci_vhci.c
+++ b/drivers/bluetooth/hci_vhci.c
@@ -264,10 +264,7 @@ static int vhci_release(struct inode *inode, struct file *file)
 	struct vhci_data *data = file->private_data;
 	struct hci_dev *hdev = data->hdev;
 
-	if (hci_unregister_dev(hdev) < 0) {
-		BT_ERR("Can't unregister HCI device %s", hdev->name);
-	}
-
+	hci_unregister_dev(hdev);
 	hci_free_dev(hdev);
 
 	file->private_data = NULL;
-- 
1.7.7.1

^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [PATCH 2/2] Bluetooth: Make hci_unregister_dev return void
  2011-10-26  8:43 [PATCH 1/2] Bluetooth: Ignore hci_unregister_dev return value David Herrmann
@ 2011-10-26  8:43 ` David Herrmann
  2011-10-26  8:55   ` Marcel Holtmann
  2011-10-31 19:46   ` Gustavo Padovan
  2011-10-26  8:55 ` [PATCH 1/2] Bluetooth: Ignore hci_unregister_dev return value Marcel Holtmann
  1 sibling, 2 replies; 5+ messages in thread
From: David Herrmann @ 2011-10-26  8:43 UTC (permalink / raw)
  To: linux-bluetooth; +Cc: padovan, marcel, David Herrmann

hci_unregister_dev cannot fail and always returns 0. The drivers already ignore
the return value so we can safely make it return void.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
---
 include/net/bluetooth/hci_core.h |    2 +-
 net/bluetooth/hci_core.c         |    4 +---
 2 files changed, 2 insertions(+), 4 deletions(-)

diff --git a/include/net/bluetooth/hci_core.h b/include/net/bluetooth/hci_core.h
index 119b795..967e18f7 100644
--- a/include/net/bluetooth/hci_core.h
+++ b/include/net/bluetooth/hci_core.h
@@ -554,7 +554,7 @@ struct hci_dev *hci_get_route(bdaddr_t *src, bdaddr_t *dst);
 struct hci_dev *hci_alloc_dev(void);
 void hci_free_dev(struct hci_dev *hdev);
 int hci_register_dev(struct hci_dev *hdev);
-int hci_unregister_dev(struct hci_dev *hdev);
+void hci_unregister_dev(struct hci_dev *hdev);
 int hci_suspend_dev(struct hci_dev *hdev);
 int hci_resume_dev(struct hci_dev *hdev);
 int hci_dev_open(__u16 dev);
diff --git a/net/bluetooth/hci_core.c b/net/bluetooth/hci_core.c
index fdcbf8f..557ff90 100644
--- a/net/bluetooth/hci_core.c
+++ b/net/bluetooth/hci_core.c
@@ -1541,7 +1541,7 @@ err:
 EXPORT_SYMBOL(hci_register_dev);
 
 /* Unregister HCI device */
-int hci_unregister_dev(struct hci_dev *hdev)
+void hci_unregister_dev(struct hci_dev *hdev)
 {
 	int i;
 
@@ -1583,8 +1583,6 @@ int hci_unregister_dev(struct hci_dev *hdev)
 	hci_dev_unlock_bh(hdev);
 
 	__hci_dev_put(hdev);
-
-	return 0;
 }
 EXPORT_SYMBOL(hci_unregister_dev);
 
-- 
1.7.7.1

^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH 1/2] Bluetooth: Ignore hci_unregister_dev return value
  2011-10-26  8:43 [PATCH 1/2] Bluetooth: Ignore hci_unregister_dev return value David Herrmann
  2011-10-26  8:43 ` [PATCH 2/2] Bluetooth: Make hci_unregister_dev return void David Herrmann
@ 2011-10-26  8:55 ` Marcel Holtmann
  1 sibling, 0 replies; 5+ messages in thread
From: Marcel Holtmann @ 2011-10-26  8:55 UTC (permalink / raw)
  To: David Herrmann; +Cc: linux-bluetooth, padovan

Hi David,

> 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>
> ---
>  drivers/bluetooth/bfusb.c       |    4 +---
>  drivers/bluetooth/bluecard_cs.c |    4 +---
>  drivers/bluetooth/bt3c_cs.c     |    4 +---
>  drivers/bluetooth/btuart_cs.c   |    4 +---
>  drivers/bluetooth/dtl1_cs.c     |    4 +---
>  drivers/bluetooth/hci_vhci.c    |    5 +----
>  6 files changed, 6 insertions(+), 19 deletions(-)

I am totally fine with this.

Acked-by: Marcel Holtmann <marcel@holtmann.org>

Regards

Marcel



^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH 2/2] Bluetooth: Make hci_unregister_dev return void
  2011-10-26  8:43 ` [PATCH 2/2] Bluetooth: Make hci_unregister_dev return void David Herrmann
@ 2011-10-26  8:55   ` Marcel Holtmann
  2011-10-31 19:46   ` Gustavo Padovan
  1 sibling, 0 replies; 5+ messages in thread
From: Marcel Holtmann @ 2011-10-26  8:55 UTC (permalink / raw)
  To: David Herrmann; +Cc: linux-bluetooth, padovan

Hi David,

> hci_unregister_dev cannot fail and always returns 0. The drivers already ignore
> the return value so we can safely make it return void.
> 
> Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
> ---
>  include/net/bluetooth/hci_core.h |    2 +-
>  net/bluetooth/hci_core.c         |    4 +---
>  2 files changed, 2 insertions(+), 4 deletions(-)

Acked-by: Marcel Holtmann <marcel@holtmann.org>

Regards

Marcel



^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH 2/2] Bluetooth: Make hci_unregister_dev return void
  2011-10-26  8:43 ` [PATCH 2/2] Bluetooth: Make hci_unregister_dev return void David Herrmann
  2011-10-26  8:55   ` Marcel Holtmann
@ 2011-10-31 19:46   ` Gustavo Padovan
  1 sibling, 0 replies; 5+ messages in thread
From: Gustavo Padovan @ 2011-10-31 19:46 UTC (permalink / raw)
  To: David Herrmann; +Cc: linux-bluetooth, marcel

Hi David,

* David Herrmann <dh.herrmann@googlemail.com> [2011-10-26 10:43:19 +0200]:

> hci_unregister_dev cannot fail and always returns 0. The drivers already ignore
> the return value so we can safely make it return void.
> 
> Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
> ---
>  include/net/bluetooth/hci_core.h |    2 +-
>  net/bluetooth/hci_core.c         |    4 +---
>  2 files changed, 2 insertions(+), 4 deletions(-)

Nice work, both patches have been applied. Thanks.

	Gustavo

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2011-10-31 19:46 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-10-26  8:43 [PATCH 1/2] Bluetooth: Ignore hci_unregister_dev return value David Herrmann
2011-10-26  8:43 ` [PATCH 2/2] Bluetooth: Make hci_unregister_dev return void David Herrmann
2011-10-26  8:55   ` Marcel Holtmann
2011-10-31 19:46   ` Gustavo Padovan
2011-10-26  8:55 ` [PATCH 1/2] Bluetooth: Ignore hci_unregister_dev return value Marcel Holtmann

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.