HID: use kobj_to_dev()

Use kobj_to_dev() instead of open-coding it.

Signed-off-by: Geliang Tang <geliangtang@163.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
This commit is contained in:
Geliang Tang
2015-12-27 17:25:24 +08:00
committed by Jiri Kosina
parent d98ba98c4f
commit 2cf83833fc
10 changed files with 28 additions and 51 deletions

View File

@@ -1571,7 +1571,7 @@ read_report_descriptor(struct file *filp, struct kobject *kobj,
struct bin_attribute *attr,
char *buf, loff_t off, size_t count)
{
struct device *dev = container_of(kobj, struct device, kobj);
struct device *dev = kobj_to_dev(kobj);
struct hid_device *hdev = to_hid_device(dev);
if (off >= hdev->rsize)