@@ -278,14 +278,12 @@ static int magicmouse_raw_event(struct hid_device
*hdev,
struct input_dev *input = msc->input;
int x = 0, y = 0, ii, clicks = 0, npoints;
+ /* Slightly paranoid, but "input" only gets set when our
+ * input_mapping sees the right field. */
+ if (!input)
+ return 0;
+
switch (data[0]) {
- case 0x10:
- if (size != 6)
- return 0;
- x = (__s16)(data[2] | data[3] << 8);
- y = (__s16)(data[4] | data[5] << 8);
- clicks = data[1];
- break;
case TRACKPAD_REPORT_ID:
/* Expect four bytes of prefix, and N*9 bytes of touch data. */