summaryrefslogtreecommitdiffstats
path: root/drivers/hid/hid-roccat-lua.c
diff options
context:
space:
mode:
authorGeliang Tang <geliangtang@163.com>2015-12-27 17:25:24 +0800
committerJiri Kosina <jkosina@suse.cz>2015-12-28 13:41:51 +0100
commit2cf83833fc9cff04c50e402260b724b3f001d737 (patch)
tree6e0d76a5c4ab8d408665bacd2699cb9cd304aefb /drivers/hid/hid-roccat-lua.c
parentd98ba98c4fbff91abb37eef628ccce0c218b4185 (diff)
downloadlinux-2cf83833fc9cff04c50e402260b724b3f001d737.tar.bz2
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>
Diffstat (limited to 'drivers/hid/hid-roccat-lua.c')
-rw-r--r--drivers/hid/hid-roccat-lua.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/hid/hid-roccat-lua.c b/drivers/hid/hid-roccat-lua.c
index 65e2e76bf2fe..ac1a7313e259 100644
--- a/drivers/hid/hid-roccat-lua.c
+++ b/drivers/hid/hid-roccat-lua.c
@@ -30,7 +30,7 @@ static ssize_t lua_sysfs_read(struct file *fp, struct kobject *kobj,
char *buf, loff_t off, size_t count,
size_t real_size, uint command)
{
- struct device *dev = container_of(kobj, struct device, kobj);
+ struct device *dev = kobj_to_dev(kobj);
struct lua_device *lua = hid_get_drvdata(dev_get_drvdata(dev));
struct usb_device *usb_dev = interface_to_usbdev(to_usb_interface(dev));
int retval;
@@ -52,7 +52,7 @@ static ssize_t lua_sysfs_write(struct file *fp, struct kobject *kobj,
void const *buf, loff_t off, size_t count,
size_t real_size, uint command)
{
- struct device *dev = container_of(kobj, struct device, kobj);
+ struct device *dev = kobj_to_dev(kobj);
struct lua_device *lua = hid_get_drvdata(dev_get_drvdata(dev));
struct usb_device *usb_dev = interface_to_usbdev(to_usb_interface(dev));
int retval;