]> git.proxmox.com Git - mirror_ubuntu-artful-kernel.git/blobdiff - drivers/hid/hid-roccat-koneplus.c
Merge branch 'drm-rockchip-next-fixes-2016-01-22' of https://github.com/markyzq/kerne...
[mirror_ubuntu-artful-kernel.git] / drivers / hid / hid-roccat-koneplus.c
index 5e99fcdc71b9cf0631cb7adcc8b61a22c36ae728..09e8fc72aa1d4a683f2e467baf3c9a5d5abe6518 100644 (file)
@@ -87,8 +87,7 @@ static ssize_t koneplus_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)->parent->parent;
+       struct device *dev = kobj_to_dev(kobj)->parent->parent;
        struct koneplus_device *koneplus = hid_get_drvdata(dev_get_drvdata(dev));
        struct usb_device *usb_dev = interface_to_usbdev(to_usb_interface(dev));
        int retval;
@@ -113,8 +112,7 @@ static ssize_t koneplus_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)->parent->parent;
+       struct device *dev = kobj_to_dev(kobj)->parent->parent;
        struct koneplus_device *koneplus = hid_get_drvdata(dev_get_drvdata(dev));
        struct usb_device *usb_dev = interface_to_usbdev(to_usb_interface(dev));
        int retval;
@@ -193,8 +191,7 @@ static ssize_t koneplus_sysfs_read_profilex_settings(struct file *fp,
                struct kobject *kobj, struct bin_attribute *attr, char *buf,
                loff_t off, size_t count)
 {
-       struct device *dev =
-                       container_of(kobj, struct device, kobj)->parent->parent;
+       struct device *dev = kobj_to_dev(kobj)->parent->parent;
        struct usb_device *usb_dev = interface_to_usbdev(to_usb_interface(dev));
        ssize_t retval;
 
@@ -212,8 +209,7 @@ static ssize_t koneplus_sysfs_read_profilex_buttons(struct file *fp,
                struct kobject *kobj, struct bin_attribute *attr, char *buf,
                loff_t off, size_t count)
 {
-       struct device *dev =
-                       container_of(kobj, struct device, kobj)->parent->parent;
+       struct device *dev = kobj_to_dev(kobj)->parent->parent;
        struct usb_device *usb_dev = interface_to_usbdev(to_usb_interface(dev));
        ssize_t retval;