Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 277687
b: refs/heads/master
c: 0ac7e70
h: refs/heads/master
i:
  277685: 030ee2d
  277683: e529ed6
  277679: ca26964
v: v3
  • Loading branch information
David Herrmann authored and Gustavo F. Padovan committed Oct 14, 2011
1 parent b987a93 commit 2970326
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 7 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 928abaa777501ddab94b1b49aae485a2c730d303
refs/heads/master: 0ac7e7002c4d0841197e9ccb8cfecc5b8c58b200
1 change: 1 addition & 0 deletions trunk/include/net/bluetooth/hci_core.h
Original file line number Diff line number Diff line change
Expand Up @@ -608,6 +608,7 @@ int hci_recv_frame(struct sk_buff *skb);
int hci_recv_fragment(struct hci_dev *hdev, int type, void *data, int count);
int hci_recv_stream_fragment(struct hci_dev *hdev, void *data, int count);

void hci_init_sysfs(struct hci_dev *hdev);
int hci_register_sysfs(struct hci_dev *hdev);
void hci_unregister_sysfs(struct hci_dev *hdev);
void hci_conn_init_sysfs(struct hci_conn *conn);
Expand Down
1 change: 1 addition & 0 deletions trunk/net/bluetooth/hci_core.c
Original file line number Diff line number Diff line change
Expand Up @@ -912,6 +912,7 @@ struct hci_dev *hci_alloc_dev(void)
if (!hdev)
return NULL;

hci_init_sysfs(hdev);
skb_queue_head_init(&hdev->driver_init);

return hdev;
Expand Down
18 changes: 12 additions & 6 deletions trunk/net/bluetooth/hci_sysfs.c
Original file line number Diff line number Diff line change
Expand Up @@ -542,22 +542,28 @@ static int auto_accept_delay_get(void *data, u64 *val)
DEFINE_SIMPLE_ATTRIBUTE(auto_accept_delay_fops, auto_accept_delay_get,
auto_accept_delay_set, "%llu\n");

void hci_init_sysfs(struct hci_dev *hdev)
{
struct device *dev = &hdev->dev;

dev->type = &bt_host;
dev->class = bt_class;

dev_set_drvdata(dev, hdev);
device_initialize(dev);
}

int hci_register_sysfs(struct hci_dev *hdev)
{
struct device *dev = &hdev->dev;
int err;

BT_DBG("%p name %s bus %d", hdev, hdev->name, hdev->bus);

dev->type = &bt_host;
dev->class = bt_class;
dev->parent = hdev->parent;

dev_set_name(dev, "%s", hdev->name);

dev_set_drvdata(dev, hdev);

err = device_register(dev);
err = device_add(dev);
if (err < 0)
return err;

Expand Down

0 comments on commit 2970326

Please sign in to comment.