提交 2dd10688 编写于 作者: D David Herrmann 提交者: Johan Hedberg

Bluetooth: Use proper datatypes in release-callbacks

This enhances code readability a lot and avoids using void* even though
we know the type of the variable.
Signed-off-by: NDavid Herrmann <dh.herrmann@googlemail.com>
Acked-by: NMarcel Holtmann <marcel@holtmann.org>
Signed-off-by: NJohan Hedberg <johan.hedberg@intel.com>
上级 3dc07322
...@@ -79,8 +79,8 @@ static const struct attribute_group *bt_link_groups[] = { ...@@ -79,8 +79,8 @@ static const struct attribute_group *bt_link_groups[] = {
static void bt_link_release(struct device *dev) static void bt_link_release(struct device *dev)
{ {
void *data = to_hci_conn(dev); struct hci_conn *conn = to_hci_conn(dev);
kfree(data); kfree(conn);
} }
static struct device_type bt_link = { static struct device_type bt_link = {
...@@ -368,8 +368,8 @@ static const struct attribute_group *bt_host_groups[] = { ...@@ -368,8 +368,8 @@ static const struct attribute_group *bt_host_groups[] = {
static void bt_host_release(struct device *dev) static void bt_host_release(struct device *dev)
{ {
void *data = to_hci_dev(dev); struct hci_dev *hdev = to_hci_dev(dev);
kfree(data); kfree(hdev);
module_put(THIS_MODULE); module_put(THIS_MODULE);
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册