Fedora kernel-2.6.17-1.2142_FC4 patched with stable patch-2.6.17.4-vs2.0.2-rc26.diff
[linux-2.6.git] / drivers / usb / input / hid-tmff.c
index 8f6a0a6..534425c 100644 (file)
@@ -111,12 +111,12 @@ int hid_tmff_init(struct hid_device *hid)
        struct tmff_device *private;
        struct list_head *pos;
        struct hid_input *hidinput = list_entry(hid->inputs.next, struct hid_input, list);
+       struct input_dev *input_dev = hidinput->input;
 
-       private = kmalloc(sizeof(struct tmff_device), GFP_KERNEL);
+       private = kzalloc(sizeof(struct tmff_device), GFP_KERNEL);
        if (!private)
                return -ENOMEM;
 
-       memset(private, 0, sizeof(struct tmff_device));
        hid->ff_private = private;
 
        /* Find the report to use */
@@ -155,7 +155,7 @@ int hid_tmff_init(struct hid_device *hid)
                                        private->report = report;
                                        private->rumble = field;
 
-                                       set_bit(FF_RUMBLE, hidinput->input.ffbit);
+                                       set_bit(FF_RUMBLE, input_dev->ffbit);
                                        break;
 
                                default:
@@ -164,11 +164,11 @@ int hid_tmff_init(struct hid_device *hid)
                        }
 
                        /* Fallthrough to here only when a valid usage is found */
-                       hidinput->input.upload_effect = hid_tmff_upload_effect;
-                       hidinput->input.flush = hid_tmff_flush;
+                       input_dev->upload_effect = hid_tmff_upload_effect;
+                       input_dev->flush = hid_tmff_flush;
 
-                       set_bit(EV_FF, hidinput->input.evbit);
-                       hidinput->input.ff_effects_max = TMFF_EFFECTS;
+                       set_bit(EV_FF, input_dev->evbit);
+                       input_dev->ff_effects_max = TMFF_EFFECTS;
                }
        }