Merge tag 'kvm-s390-master-4.5-1' of git://git.kernel.org/pub/scm/linux/kernel/git...
[deliverable/linux.git] / drivers / hid / hid-cp2112.c
index 7afc3fcc122c476a42e20f1e85e1ed409c93a734..7c38bfa05fac16a4e65e054239b6f6c28970dc53 100644 (file)
@@ -807,7 +807,7 @@ static ssize_t name##_store(struct device *kdev, \
                            struct device_attribute *attr, const char *buf, \
                            size_t count) \
 { \
-       struct hid_device *hdev = container_of(kdev, struct hid_device, dev); \
+       struct hid_device *hdev = to_hid_device(kdev); \
        struct cp2112_usb_config_report cfg; \
        int ret = cp2112_get_usb_config(hdev, &cfg); \
        if (ret) \
@@ -822,7 +822,7 @@ static ssize_t name##_store(struct device *kdev, \
 static ssize_t name##_show(struct device *kdev, \
                           struct device_attribute *attr, char *buf) \
 { \
-       struct hid_device *hdev = container_of(kdev, struct hid_device, dev); \
+       struct hid_device *hdev = to_hid_device(kdev); \
        struct cp2112_usb_config_report cfg; \
        int ret = cp2112_get_usb_config(hdev, &cfg); \
        if (ret) \
@@ -887,7 +887,7 @@ static ssize_t pstr_store(struct device *kdev,
                          struct device_attribute *kattr, const char *buf,
                          size_t count)
 {
-       struct hid_device *hdev = container_of(kdev, struct hid_device, dev);
+       struct hid_device *hdev = to_hid_device(kdev);
        struct cp2112_pstring_attribute *attr =
                container_of(kattr, struct cp2112_pstring_attribute, attr);
        struct cp2112_string_report report;
@@ -918,7 +918,7 @@ static ssize_t pstr_store(struct device *kdev,
 static ssize_t pstr_show(struct device *kdev,
                         struct device_attribute *kattr, char *buf)
 {
-       struct hid_device *hdev = container_of(kdev, struct hid_device, dev);
+       struct hid_device *hdev = to_hid_device(kdev);
        struct cp2112_pstring_attribute *attr =
                container_of(kattr, struct cp2112_pstring_attribute, attr);
        struct cp2112_string_report report;
This page took 0.04021 seconds and 5 git commands to generate.