diff --git a/drivers/hid/usbhid/hid-tmff.c b/drivers/hid/usbhid/hid-tmff.c index 69882a726e99d8cc19b6fda183e2b0f9ca8de240..144578b1a00c832a32ae7a65659ae5316b6d087e 100644 --- a/drivers/hid/usbhid/hid-tmff.c +++ b/drivers/hid/usbhid/hid-tmff.c @@ -137,7 +137,8 @@ static int hid_tmff_play(struct input_dev *dev, void *data, struct ff_effect *ef int hid_tmff_init(struct hid_device *hid) { struct tmff_device *tmff; - struct list_head *pos; + struct hid_report *report; + struct list_head *report_list; struct hid_input *hidinput = list_entry(hid->inputs.next, struct hid_input, list); struct input_dev *input_dev = hidinput->input; const signed short *ff_bits = ff_joystick; @@ -149,8 +150,8 @@ int hid_tmff_init(struct hid_device *hid) return -ENOMEM; /* Find the report to use */ - list_for_each(pos, &hid->report_enum[HID_OUTPUT_REPORT].report_list) { - struct hid_report *report = (struct hid_report *)pos; + report_list = &hid->report_enum[HID_OUTPUT_REPORT].report_list; + list_for_each_entry(report, report_list, list) { int fieldnum; for (fieldnum = 0; fieldnum < report->maxfield; ++fieldnum) {