Skip to content

Commit

Permalink
Bluetooth: Use proper datatypes in release-callbacks
Browse files Browse the repository at this point in the history
This enhances code readability a lot and avoids using void* even though
we know the type of the variable.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
Acked-by: Marcel Holtmann <marcel@holtmann.org>
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
  • Loading branch information
David Herrmann authored and Johan Hedberg committed Feb 13, 2012
1 parent 3dc0732 commit 2dd1068
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions net/bluetooth/hci_sysfs.c
Original file line number Diff line number Diff line change
Expand Up @@ -79,8 +79,8 @@ static const struct attribute_group *bt_link_groups[] = {

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

static struct device_type bt_link = {
Expand Down Expand Up @@ -368,8 +368,8 @@ static const struct attribute_group *bt_host_groups[] = {

static void bt_host_release(struct device *dev)
{
void *data = to_hci_dev(dev);
kfree(data);
struct hci_dev *hdev = to_hci_dev(dev);
kfree(hdev);
module_put(THIS_MODULE);
}

Expand Down

0 comments on commit 2dd1068

Please sign in to comment.