mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Dave Young <hidave.darkstar@gmail.com>
To: Marcel Holtmann <marcel@holtmann.org>
Cc: LKML <linux-kernel@vger.kernel.org>, bluez-devel@lists.sourceforge.net
Subject: [PATCH]bluetooth: hci_sysfs connection bus_id add support for diffrent hci device
Date: Wed, 31 Oct 2007 10:30:17 +0800	[thread overview]
Message-ID: <20071031023017.GA3896@darkstar.te-china.tietoenator.com> (raw)

For multi hci devices host, connection from/to same destination
bluetooth device, add_conn will failed due to sysfs duplicate name.

sysfs: duplicate filename 'acl0018C5B6B456' can not be created
WARNING: at fs/sysfs/dir.c:424 sysfs_add_one()
 [<c01c0120>] sysfs_add_one+0xa0/0xe0
 [<c01c0d7b>] sysfs_create_link+0x9b/0x140
 [<c01c1671>] create_files+0x31/0x60
 [<c02b537b>] bus_add_device+0x5b/0xf0
 [<c02b391c>] device_add+0x11c/0x350
 [<f8951410>] add_conn+0x0/0x90 [bluetooth]
 [<f895141f>] add_conn+0xf/0x90 [bluetooth]
 [<c013baee>] run_workqueue+0x5e/0x110
 [<c013bc4c>] worker_thread+0xac/0x100
 [<c0140000>] autoremove_wake_function+0x0/0x50
 [<c0140000>] autoremove_wake_function+0x0/0x50
 [<c013bba0>] worker_thread+0x0/0x100
 [<c013fa39>] kthread+0x59/0xa0
 [<c013f9e0>] kthread+0x0/0xa0
 [<c0104f83>] kernel_thread_helper+0x7/0x14
 =======================
add_conn: Failed to register connection device

Add prefix hdev->name to bus_id to fix this problem.

Signed-off-by: Dave Young <hidave.darkstar@gmail.com> 

---
net/bluetooth/hci_sysfs.c |    3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)

diff -upr linux/net/bluetooth/hci_sysfs.c linux.new/net/bluetooth/hci_sysfs.c
--- linux/net/bluetooth/hci_sysfs.c	2007-10-31 10:21:00.000000000 +0800
+++ linux.new/net/bluetooth/hci_sysfs.c	2007-10-31 10:21:55.000000000 +0800
@@ -302,7 +302,8 @@ void hci_conn_add_sysfs(struct hci_conn 
 	conn->dev.release = bt_release;
 
 	snprintf(conn->dev.bus_id, BUS_ID_SIZE,
-			"%s%2.2X%2.2X%2.2X%2.2X%2.2X%2.2X",
+			"%s%s%2.2X%2.2X%2.2X%2.2X%2.2X%2.2X",
+			hdev->name,
 			conn->type == ACL_LINK ? "acl" : "sco",
 			ba->b[5], ba->b[4], ba->b[3],
 			ba->b[2], ba->b[1], ba->b[0]);

             reply	other threads:[~2007-10-31  2:23 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-10-31  2:30 Dave Young [this message]
2007-10-31  7:01 ` David Miller
2007-10-31  7:56   ` Marcel Holtmann
2007-10-31  9:13     ` Dave Young
2007-10-31  9:59       ` Marcel Holtmann
2007-11-01  1:05         ` Dave Young
2007-11-01  2:20           ` Dave Young
2007-11-01  4:56             ` Marcel Holtmann
2007-10-31  9:06   ` Dave Young

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=20071031023017.GA3896@darkstar.te-china.tietoenator.com \
    --to=hidave.darkstar@gmail.com \
    --cc=bluez-devel@lists.sourceforge.net \
    --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

all inboxes | Powered by JetHome®