linux/net/bluetooth
David Herrmann b1b813d477 Bluetooth: Move device initialization to hci_alloc_dev()
We currently initialize locks, lists, works, etc. in hci_register_dev()
(hci_alloc_dev() was added later) which is bogus because an hdev is in an
invalid state if it is not registered.
This patch moves all memory initialization to hci_alloc_dev(). Device
registering and registration of sub-modules is still left in
hci_register_dev() as it belongs there.

The benefit is (despite cleaning up the code-base) we can now always be
sure that an hdev is a valid object and can be locked and worked on even
though it may not be registered.

This patch also reorders the initialization to be easier to understand.
First the memory is initialized, then all generic structures and as last
step the sub-init functions are called. This guarantees that all
dependencies are initialized in the right order and makes it also easier
to find a specific line. We previously initialized it in the same order as
the "struct hci_dev" is declared which seems pretty random.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
2012-05-09 01:40:40 -03:00
..
bnep Remove all #inclusions of asm/system.h 2012-03-28 18:30:03 +01:00
cmtp Remove all #inclusions of asm/system.h 2012-03-28 18:30:03 +01:00
hidp Bluetooth: Use kernel int types instead of ones from stdint.h 2012-02-27 12:34:39 +02:00
rfcomm Remove all #inclusions of asm/system.h 2012-03-28 18:30:03 +01:00
af_bluetooth.c
hci_conn.c Remove all #inclusions of asm/system.h 2012-03-28 18:30:03 +01:00
hci_core.c Bluetooth: Move device initialization to hci_alloc_dev() 2012-05-09 01:40:40 -03:00
hci_event.c Bluetooth: mgmt: Fix missing connect failed event for LE 2012-05-09 00:41:38 -03:00
hci_sock.c Merge branch 'x86-x32-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip 2012-03-29 18:12:23 -07:00
hci_sysfs.c Bluetooth: trivial: Correct types 2012-05-09 00:41:31 -03:00
Kconfig Bluetooth: Fix Kconfig help description 2012-02-29 18:50:25 +02:00
l2cap_core.c Bluetooth: Don't distribute keys in case of Encryption Failure 2012-05-09 01:40:36 -03:00
l2cap_sock.c Bluetooth: Split error handling for L2CAP listen sockets 2012-05-09 01:40:37 -03:00
lib.c
Makefile
mgmt.c Bluetooth: mgmt: Fix address type while loading Long Term Key 2012-05-09 01:40:33 -03:00
sco.c Bluetooth: Restrict to one SCO listening socket 2012-05-09 01:40:39 -03:00
smp.c Bluetooth: Correct ediv in SMP 2012-05-09 00:41:30 -03:00