diff options
author | Geliang Tang <geliangtang@163.com> | 2015-12-27 12:25:21 +0300 |
---|---|---|
committer | Jiri Kosina <jkosina@suse.cz> | 2015-12-28 15:41:44 +0300 |
commit | ee79a8f840a45d331bc33e55cbcc89bba417671c (patch) | |
tree | 9dc3d0fd485715c63999d0aaf339c2a7d26dce3f /drivers/hid/hid-sony.c | |
parent | d8ce9bf5551bfea431893bdd0a943f24a5170828 (diff) | |
download | linux-ee79a8f840a45d331bc33e55cbcc89bba417671c.tar.xz |
HID: use to_hid_device()
Use to_hid_device() instead of container_of().
Signed-off-by: Geliang Tang <geliangtang@163.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
Diffstat (limited to 'drivers/hid/hid-sony.c')
-rw-r--r-- | drivers/hid/hid-sony.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/drivers/hid/hid-sony.c b/drivers/hid/hid-sony.c index 774cd2210566..9bbf5a725139 100644 --- a/drivers/hid/hid-sony.c +++ b/drivers/hid/hid-sony.c @@ -1549,7 +1549,7 @@ static void sony_led_set_brightness(struct led_classdev *led, enum led_brightness value) { struct device *dev = led->dev->parent; - struct hid_device *hdev = container_of(dev, struct hid_device, dev); + struct hid_device *hdev = to_hid_device(dev); struct sony_sc *drv_data; int n; @@ -1591,7 +1591,7 @@ static void sony_led_set_brightness(struct led_classdev *led, static enum led_brightness sony_led_get_brightness(struct led_classdev *led) { struct device *dev = led->dev->parent; - struct hid_device *hdev = container_of(dev, struct hid_device, dev); + struct hid_device *hdev = to_hid_device(dev); struct sony_sc *drv_data; int n; @@ -1614,7 +1614,7 @@ static int sony_led_blink_set(struct led_classdev *led, unsigned long *delay_on, unsigned long *delay_off) { struct device *dev = led->dev->parent; - struct hid_device *hdev = container_of(dev, struct hid_device, dev); + struct hid_device *hdev = to_hid_device(dev); struct sony_sc *drv_data = hid_get_drvdata(hdev); int n; __u8 new_on, new_off; |