diff options
author | Marcel Holtmann <marcel@holtmann.org> | 2013-10-17 17:24:19 -0700 |
---|---|---|
committer | Johan Hedberg <johan.hedberg@intel.com> | 2013-10-18 10:46:54 +0300 |
commit | bdc3e0f1d2019fbf89f150ed98860b1a7a762fe9 (patch) | |
tree | 8342c38bc031b2287f2934be740c6991feea5069 /net | |
parent | ffcecac6a7380af84d4c1d676a6c3c524d31eeda (diff) | |
download | op-kernel-dev-bdc3e0f1d2019fbf89f150ed98860b1a7a762fe9.zip op-kernel-dev-bdc3e0f1d2019fbf89f150ed98860b1a7a762fe9.tar.gz |
Bluetooth: Move device_add handling into hci_register_dev
The device_add handling can be done directly in hci_register_dev and
device_remove within hci_unregister_dev.
Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
Diffstat (limited to 'net')
-rw-r--r-- | net/bluetooth/hci_core.c | 6 | ||||
-rw-r--r-- | net/bluetooth/hci_sysfs.c | 18 |
2 files changed, 4 insertions, 20 deletions
diff --git a/net/bluetooth/hci_core.c b/net/bluetooth/hci_core.c index f7ba818..940da80 100644 --- a/net/bluetooth/hci_core.c +++ b/net/bluetooth/hci_core.c @@ -2482,7 +2482,9 @@ int hci_register_dev(struct hci_dev *hdev) if (!IS_ERR_OR_NULL(bt_debugfs)) hdev->debugfs = debugfs_create_dir(hdev->name, bt_debugfs); - error = hci_add_sysfs(hdev); + dev_set_name(&hdev->dev, "%s", hdev->name); + + error = device_add(&hdev->dev); if (error < 0) goto err_wqueue; @@ -2570,7 +2572,7 @@ void hci_unregister_dev(struct hci_dev *hdev) rfkill_destroy(hdev->rfkill); } - hci_del_sysfs(hdev); + device_del(&hdev->dev); debugfs_remove_recursive(hdev->debugfs); diff --git a/net/bluetooth/hci_sysfs.c b/net/bluetooth/hci_sysfs.c index 320a761..9cbf8fe 100644 --- a/net/bluetooth/hci_sysfs.c +++ b/net/bluetooth/hci_sysfs.c @@ -402,24 +402,6 @@ void hci_init_sysfs(struct hci_dev *hdev) device_initialize(dev); } -int hci_add_sysfs(struct hci_dev *hdev) -{ - struct device *dev = &hdev->dev; - - BT_DBG("%p name %s bus %d", hdev, hdev->name, hdev->bus); - - dev_set_name(dev, "%s", hdev->name); - - return device_add(dev); -} - -void hci_del_sysfs(struct hci_dev *hdev) -{ - BT_DBG("%p name %s bus %d", hdev, hdev->name, hdev->bus); - - device_del(&hdev->dev); -} - int __init bt_sysfs_init(void) { bt_class = class_create(THIS_MODULE, "bluetooth"); |