From: Jeremy Fitzhardinge Date: Wed, 30 Nov 2011 13:42:04 +0000 (+0100) Subject: HID: hid-input: fix compile for !HID_BATTERY_STRENGTH X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=672007957846c3d556165bab635a9c9b855261fa;p=GitHub%2FLineageOS%2Fandroid_kernel_motorola_exynos9610.git HID: hid-input: fix compile for !HID_BATTERY_STRENGTH 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 Reported-by: Stephen Rothwell Signed-off-by: Jiri Kosina --- diff --git a/drivers/hid/hid-input.c b/drivers/hid/hid-input.c index 2d96b782b203..b9b8c75a6f9a 100644 --- a/drivers/hid/hid-input.c +++ b/drivers/hid/hid-input.c @@ -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;