Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 290950
b: refs/heads/master
c: 3dc0732
h: refs/heads/master
v: v3
  • Loading branch information
David Herrmann authored and Johan Hedberg committed Feb 13, 2012
1 parent 26771a7 commit d7ef6d5
Show file tree
Hide file tree
Showing 3 changed files with 6 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: 155961e8001719af6d87cbcc961111e8ce477843
refs/heads/master: 3dc07322b1ce3c8477690d54ebbf15a165f43066
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 @@ -623,6 +623,7 @@ static inline struct hci_dev *hci_dev_hold(struct hci_dev *d)
#define hci_dev_unlock(d) mutex_unlock(&d->lock)

#define to_hci_dev(d) container_of(d, struct hci_dev, dev)
#define to_hci_conn(c) container_of(c, struct hci_conn, dev)

static inline void *hci_get_drvdata(struct hci_dev *hdev)
{
Expand Down
10 changes: 4 additions & 6 deletions trunk/net/bluetooth/hci_sysfs.c
Original file line number Diff line number Diff line change
Expand Up @@ -33,19 +33,19 @@ static inline char *link_typetostr(int type)

static ssize_t show_link_type(struct device *dev, struct device_attribute *attr, char *buf)
{
struct hci_conn *conn = dev_get_drvdata(dev);
struct hci_conn *conn = to_hci_conn(dev);
return sprintf(buf, "%s\n", link_typetostr(conn->type));
}

static ssize_t show_link_address(struct device *dev, struct device_attribute *attr, char *buf)
{
struct hci_conn *conn = dev_get_drvdata(dev);
struct hci_conn *conn = to_hci_conn(dev);
return sprintf(buf, "%s\n", batostr(&conn->dst));
}

static ssize_t show_link_features(struct device *dev, struct device_attribute *attr, char *buf)
{
struct hci_conn *conn = dev_get_drvdata(dev);
struct hci_conn *conn = to_hci_conn(dev);

return sprintf(buf, "0x%02x%02x%02x%02x%02x%02x%02x%02x\n",
conn->features[0], conn->features[1],
Expand Down Expand Up @@ -79,7 +79,7 @@ static const struct attribute_group *bt_link_groups[] = {

static void bt_link_release(struct device *dev)
{
void *data = dev_get_drvdata(dev);
void *data = to_hci_conn(dev);
kfree(data);
}

Expand Down Expand Up @@ -120,8 +120,6 @@ void hci_conn_add_sysfs(struct hci_conn *conn)

dev_set_name(&conn->dev, "%s:%d", hdev->name, conn->handle);

dev_set_drvdata(&conn->dev, conn);

if (device_add(&conn->dev) < 0) {
BT_ERR("Failed to register connection device");
return;
Expand Down

0 comments on commit d7ef6d5

Please sign in to comment.