The Linux Kernel Mailing List
 help / color / mirror / Atom feed
From: Thadeu Lima de Souza Cascardo <cascardo@holoscopio.com>
To: linux-bluetooth@vger.kernel.org
Cc: linux-kernel@vger.kernel.org, marcel@holtmann.org,
	Thadeu Lima de Souza Cascardo <cascardo@holoscopio.com>
Subject: [PATCH] bluetooth: remove useless variable in virtual hci driver
Date: Fri, 23 Oct 2009 21:29:35 -0200	[thread overview]
Message-ID: <1256340575-19359-1-git-send-email-cascardo@holoscopio.com> (raw)

Commit ac28494c has removed the option to give a minor number as
parameter for VHCI driver. Remove the variable used for that parameter.
Print the error code when registering the device fails, instead of the
requested minor number (which would always be MISC_DYNAMIC_MINOR).

Signed-off-by: Thadeu Lima de Souza Cascardo <cascardo@holoscopio.com>
---
 drivers/bluetooth/hci_vhci.c |   17 ++++++++++-------
 1 files changed, 10 insertions(+), 7 deletions(-)

diff --git a/drivers/bluetooth/hci_vhci.c b/drivers/bluetooth/hci_vhci.c
index d5cde6d..74c094c 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;
 
@@ -292,7 +290,7 @@ static const struct file_operations vhci_fops = {
 	.release	= vhci_release,
 };
 
-static struct miscdevice vhci_miscdev= {
+static struct miscdevice vhci_miscdev = {
 	.name	= "vhci",
 	.fops	= &vhci_fops,
 	.minor	= MISC_DYNAMIC_MINOR,
@@ -300,10 +298,13 @@ static struct miscdevice vhci_miscdev= {
 
 static int __init vhci_init(void)
 {
+	int r;
+
 	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);
+	r = misc_register(&vhci_miscdev);
+	if (r < 0) {
+		BT_ERR("Can't register misc device: %d", r);
 		return -EIO;
 	}
 
@@ -312,8 +313,10 @@ static int __init vhci_init(void)
 
 static void __exit vhci_exit(void)
 {
-	if (misc_deregister(&vhci_miscdev) < 0)
-		BT_ERR("Can't unregister misc device with minor %d", minor);
+	int r;
+	r = misc_deregister(&vhci_miscdev);
+	if (r < 0)
+		BT_ERR("Can't unregister misc device: %d", r);
 }
 
 module_init(vhci_init);
-- 
1.6.3.3


             reply	other threads:[~2009-10-23 23:29 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-10-23 23:29 Thadeu Lima de Souza Cascardo [this message]
2009-10-24  8:41 ` [PATCH] bluetooth: remove useless variable in virtual hci driver Marcel Holtmann
  -- strict thread matches above, loose matches on Subject: below --
2009-10-26 15:59 Thadeu Lima de Souza Cascardo

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1256340575-19359-1-git-send-email-cascardo@holoscopio.com \
    --to=cascardo@holoscopio.com \
    --cc=linux-bluetooth@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=marcel@holtmann.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox