Skip to content

Commit

Permalink
HID: hid-input: fix compile for !HID_BATTERY_STRENGTH
Browse files Browse the repository at this point in the history
As reported by Stephen Rothwell:
drivers/hid/hid-input.c: In function 'hidinput_hid_event':
drivers/hid/hid-input.c:865:6: error: 'struct hid_device' has no member
named 'battery_val'
drivers/hid/hid-input.c:866:3: error: 'struct hid_device' has no member
named 'battery_min'
drivers/hid/hid-input.c:866:3: error: 'struct hid_device' has no member
named 'battery_max'

Signed-off-by: Jeremy Fitzhardinge <[email protected]>
Reported-by: Stephen Rothwell <[email protected]>
Signed-off-by: Jiri Kosina <[email protected]>
  • Loading branch information
jsgf authored and Jiri Kosina committed Nov 30, 2011
1 parent 4f5ca83 commit 6720079
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion drivers/hid/hid-input.c
Original file line number Diff line number Diff line change
Expand Up @@ -861,13 +861,14 @@ void hidinput_hid_event(struct hid_device *hid, struct hid_field *field, struct

input = field->hidinput->input;

#ifdef CONFIG_HID_BATTERY_STRENGTH
if (usage->hid == HID_DC_BATTERYSTRENGTH) {
hid->battery_val = value;
hid_dbg(hid, "battery value is %d (range %d-%d)\n",
value, hid->battery_min, hid->battery_max);
return;
}

#endif
if (!usage->type)
return;

Expand Down

0 comments on commit 6720079

Please sign in to comment.