diff options
author | Geliang Tang <geliangtang@163.com> | 2015-12-27 04:25:21 -0500 |
---|---|---|
committer | Jiri Kosina <jkosina@suse.cz> | 2015-12-28 07:41:44 -0500 |
commit | ee79a8f840a45d331bc33e55cbcc89bba417671c (patch) | |
tree | 9dc3d0fd485715c63999d0aaf339c2a7d26dce3f /drivers/hid/hid-prodikeys.c | |
parent | d8ce9bf5551bfea431893bdd0a943f24a5170828 (diff) |
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-prodikeys.c')
-rw-r--r-- | drivers/hid/hid-prodikeys.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/drivers/hid/hid-prodikeys.c b/drivers/hid/hid-prodikeys.c index 3a207c0ac0e3..f095bf8a3aa9 100644 --- a/drivers/hid/hid-prodikeys.c +++ b/drivers/hid/hid-prodikeys.c | |||
@@ -103,7 +103,7 @@ MODULE_PARM_DESC(enable, "Enable for the PC-MIDI virtual audio driver"); | |||
103 | static ssize_t show_channel(struct device *dev, | 103 | static ssize_t show_channel(struct device *dev, |
104 | struct device_attribute *attr, char *buf) | 104 | struct device_attribute *attr, char *buf) |
105 | { | 105 | { |
106 | struct hid_device *hdev = container_of(dev, struct hid_device, dev); | 106 | struct hid_device *hdev = to_hid_device(dev); |
107 | struct pk_device *pk = hid_get_drvdata(hdev); | 107 | struct pk_device *pk = hid_get_drvdata(hdev); |
108 | 108 | ||
109 | dbg_hid("pcmidi sysfs read channel=%u\n", pk->pm->midi_channel); | 109 | dbg_hid("pcmidi sysfs read channel=%u\n", pk->pm->midi_channel); |
@@ -116,7 +116,7 @@ static ssize_t show_channel(struct device *dev, | |||
116 | static ssize_t store_channel(struct device *dev, | 116 | static ssize_t store_channel(struct device *dev, |
117 | struct device_attribute *attr, const char *buf, size_t count) | 117 | struct device_attribute *attr, const char *buf, size_t count) |
118 | { | 118 | { |
119 | struct hid_device *hdev = container_of(dev, struct hid_device, dev); | 119 | struct hid_device *hdev = to_hid_device(dev); |
120 | struct pk_device *pk = hid_get_drvdata(hdev); | 120 | struct pk_device *pk = hid_get_drvdata(hdev); |
121 | 121 | ||
122 | unsigned channel = 0; | 122 | unsigned channel = 0; |
@@ -140,7 +140,7 @@ static struct device_attribute *sysfs_device_attr_channel = { | |||
140 | static ssize_t show_sustain(struct device *dev, | 140 | static ssize_t show_sustain(struct device *dev, |
141 | struct device_attribute *attr, char *buf) | 141 | struct device_attribute *attr, char *buf) |
142 | { | 142 | { |
143 | struct hid_device *hdev = container_of(dev, struct hid_device, dev); | 143 | struct hid_device *hdev = to_hid_device(dev); |
144 | struct pk_device *pk = hid_get_drvdata(hdev); | 144 | struct pk_device *pk = hid_get_drvdata(hdev); |
145 | 145 | ||
146 | dbg_hid("pcmidi sysfs read sustain=%u\n", pk->pm->midi_sustain); | 146 | dbg_hid("pcmidi sysfs read sustain=%u\n", pk->pm->midi_sustain); |
@@ -153,7 +153,7 @@ static ssize_t show_sustain(struct device *dev, | |||
153 | static ssize_t store_sustain(struct device *dev, | 153 | static ssize_t store_sustain(struct device *dev, |
154 | struct device_attribute *attr, const char *buf, size_t count) | 154 | struct device_attribute *attr, const char *buf, size_t count) |
155 | { | 155 | { |
156 | struct hid_device *hdev = container_of(dev, struct hid_device, dev); | 156 | struct hid_device *hdev = to_hid_device(dev); |
157 | struct pk_device *pk = hid_get_drvdata(hdev); | 157 | struct pk_device *pk = hid_get_drvdata(hdev); |
158 | 158 | ||
159 | unsigned sustain = 0; | 159 | unsigned sustain = 0; |
@@ -179,7 +179,7 @@ static struct device_attribute *sysfs_device_attr_sustain = { | |||
179 | static ssize_t show_octave(struct device *dev, | 179 | static ssize_t show_octave(struct device *dev, |
180 | struct device_attribute *attr, char *buf) | 180 | struct device_attribute *attr, char *buf) |
181 | { | 181 | { |
182 | struct hid_device *hdev = container_of(dev, struct hid_device, dev); | 182 | struct hid_device *hdev = to_hid_device(dev); |
183 | struct pk_device *pk = hid_get_drvdata(hdev); | 183 | struct pk_device *pk = hid_get_drvdata(hdev); |
184 | 184 | ||
185 | dbg_hid("pcmidi sysfs read octave=%d\n", pk->pm->midi_octave); | 185 | dbg_hid("pcmidi sysfs read octave=%d\n", pk->pm->midi_octave); |
@@ -192,7 +192,7 @@ static ssize_t show_octave(struct device *dev, | |||
192 | static ssize_t store_octave(struct device *dev, | 192 | static ssize_t store_octave(struct device *dev, |
193 | struct device_attribute *attr, const char *buf, size_t count) | 193 | struct device_attribute *attr, const char *buf, size_t count) |
194 | { | 194 | { |
195 | struct hid_device *hdev = container_of(dev, struct hid_device, dev); | 195 | struct hid_device *hdev = to_hid_device(dev); |
196 | struct pk_device *pk = hid_get_drvdata(hdev); | 196 | struct pk_device *pk = hid_get_drvdata(hdev); |
197 | 197 | ||
198 | int octave = 0; | 198 | int octave = 0; |