diff options
author | Linus Torvalds <torvalds@woody.linux-foundation.org> | 2008-02-19 10:52:45 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@woody.linux-foundation.org> | 2008-02-19 10:52:45 -0500 |
commit | 07ce198a1eb3431d04a6d59ea9fb7b71f21e33b1 (patch) | |
tree | fe6e6208bdcdfb7bbb0c81923efcb75bf73a299b /net/bluetooth/hci_sysfs.c | |
parent | 4bc87e62775052aac0be7574d5f84ff06f61c6b4 (diff) | |
parent | a442585952f137bd4cdb1f2f3166e4157d383b82 (diff) |
Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-2.6
* git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-2.6: (60 commits)
[NIU]: Bump driver version and release date.
[NIU]: Fix BMAC alternate MAC address indexing.
net: fix kernel-doc warnings in header files
[IPV6]: Use BUG_ON instead of if + BUG in fib6_del_route.
[IPV6]: dst_entry leak in ip4ip6_err. (resend)
bluetooth: do not move child device other than rfcomm
bluetooth: put hci dev after del conn
[NET]: Elminate spurious print_mac() calls.
[BLUETOOTH] hci_sysfs.c: Kill build warning.
[NET]: Remove MAC_FMT
net/8021q/vlan_dev.c: Use print_mac.
[XFRM]: Fix ordering issue in xfrm_dst_hash_transfer().
[BLUETOOTH] net/bluetooth/hci_core.c: Use time_* macros
[IPV6]: Fix hardcoded removing of old module code
[NETLABEL]: Move some initialization code into __init section.
[NETLABEL]: Shrink the genl-ops registration code.
[AX25] ax25_out: check skb for NULL in ax25_kick()
[TCP]: Fix tcp_v4_send_synack() comment
[IPV4]: fix alignment of IP-Config output
Documentation: fix tcp.txt
...
Diffstat (limited to 'net/bluetooth/hci_sysfs.c')
-rw-r--r-- | net/bluetooth/hci_sysfs.c | 24 |
1 files changed, 15 insertions, 9 deletions
diff --git a/net/bluetooth/hci_sysfs.c b/net/bluetooth/hci_sysfs.c index e13cf5ef144c..84360c117d4e 100644 --- a/net/bluetooth/hci_sysfs.c +++ b/net/bluetooth/hci_sysfs.c | |||
@@ -320,28 +320,34 @@ void hci_conn_add_sysfs(struct hci_conn *conn) | |||
320 | queue_work(btaddconn, &conn->work); | 320 | queue_work(btaddconn, &conn->work); |
321 | } | 321 | } |
322 | 322 | ||
323 | /* | ||
324 | * The rfcomm tty device will possibly retain even when conn | ||
325 | * is down, and sysfs doesn't support move zombie device, | ||
326 | * so we should move the device before conn device is destroyed. | ||
327 | */ | ||
323 | static int __match_tty(struct device *dev, void *data) | 328 | static int __match_tty(struct device *dev, void *data) |
324 | { | 329 | { |
325 | /* The rfcomm tty device will possibly retain even when conn | 330 | return !strncmp(dev->bus_id, "rfcomm", 6); |
326 | * is down, and sysfs doesn't support move zombie device, | ||
327 | * so we should move the device before conn device is destroyed. | ||
328 | * Due to the only child device of hci_conn dev is rfcomm | ||
329 | * tty_dev, here just return 1 | ||
330 | */ | ||
331 | return 1; | ||
332 | } | 331 | } |
333 | 332 | ||
334 | static void del_conn(struct work_struct *work) | 333 | static void del_conn(struct work_struct *work) |
335 | { | 334 | { |
336 | struct device *dev; | ||
337 | struct hci_conn *conn = container_of(work, struct hci_conn, work); | 335 | struct hci_conn *conn = container_of(work, struct hci_conn, work); |
336 | struct hci_dev *hdev = conn->hdev; | ||
337 | |||
338 | while (1) { | ||
339 | struct device *dev; | ||
338 | 340 | ||
339 | while (dev = device_find_child(&conn->dev, NULL, __match_tty)) { | 341 | dev = device_find_child(&conn->dev, NULL, __match_tty); |
342 | if (!dev) | ||
343 | break; | ||
340 | device_move(dev, NULL); | 344 | device_move(dev, NULL); |
341 | put_device(dev); | 345 | put_device(dev); |
342 | } | 346 | } |
347 | |||
343 | device_del(&conn->dev); | 348 | device_del(&conn->dev); |
344 | put_device(&conn->dev); | 349 | put_device(&conn->dev); |
350 | hci_dev_put(hdev); | ||
345 | } | 351 | } |
346 | 352 | ||
347 | void hci_conn_del_sysfs(struct hci_conn *conn) | 353 | void hci_conn_del_sysfs(struct hci_conn *conn) |