kobj_to_dev has been around since 3.6, so there is no point not having
it in the 3.17 code

Signed-off-by: Benjamin Tissoires <benjamin.tissoi...@redhat.com>
---
 3.17/wacom_sys.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/3.17/wacom_sys.c b/3.17/wacom_sys.c
index 6257a78..9f4f2a6 100644
--- a/3.17/wacom_sys.c
+++ b/3.17/wacom_sys.c
@@ -1635,7 +1635,7 @@ static ssize_t wacom_show_remote_mode(struct kobject 
*kobj,
                                      struct kobj_attribute *kattr,
                                      char *buf, int index)
 {
-       struct device *dev = container_of(kobj->parent, struct device, kobj);
+       struct device *dev = kobj_to_dev(kobj->parent);
        struct hid_device *hdev = to_hid_device(dev);
        struct wacom *wacom = hid_get_drvdata(hdev);
        u8 mode;
@@ -1719,7 +1719,7 @@ static ssize_t wacom_store_unpair_remote(struct kobject 
*kobj,
                                         const char *buf, size_t count)
 {
        unsigned char selector = 0;
-       struct device *dev = container_of(kobj->parent, struct device, kobj);
+       struct device *dev = kobj_to_dev(kobj->parent);
        struct hid_device *hdev = to_hid_device(dev);
        struct wacom *wacom = hid_get_drvdata(hdev);
        int err;
-- 
2.14.3


------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Linuxwacom-devel mailing list
Linuxwacom-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linuxwacom-devel

Reply via email to