Lines Matching defs:tm_wheel

118 struct tm_wheel {
214 struct tm_wheel *tm_wheel = hid_get_drvdata(hdev);
224 if (tm_wheel->response->type == cpu_to_le16(0x49))
225 model = le16_to_cpu(tm_wheel->response->data.a.model);
226 else if (tm_wheel->response->type == cpu_to_le16(0x47))
227 model = le16_to_cpu(tm_wheel->response->data.b.model);
229 hid_err(hdev, "Unknown packet type 0x%x, unable to proceed further with wheel init\n", tm_wheel->response->type);
244 tm_wheel->change_request->wValue = cpu_to_le16(twi->switch_value);
246 tm_wheel->urb,
247 tm_wheel->usb_dev,
248 usb_sndctrlpipe(tm_wheel->usb_dev, 0),
249 (char *)tm_wheel->change_request,
255 ret = usb_submit_urb(tm_wheel->urb, GFP_ATOMIC);
262 struct tm_wheel *tm_wheel = hid_get_drvdata(hdev);
264 usb_kill_urb(tm_wheel->urb);
266 kfree(tm_wheel->change_request);
267 kfree(tm_wheel->response);
268 kfree(tm_wheel->model_request);
269 usb_free_urb(tm_wheel->urb);
270 kfree(tm_wheel);
277 * This function starts the hid dev, tries to allocate the tm_wheel data structure and
284 struct tm_wheel *tm_wheel = NULL;
301 // Now we allocate the tm_wheel
302 tm_wheel = kzalloc(sizeof(struct tm_wheel), GFP_KERNEL);
303 if (!tm_wheel) {
308 tm_wheel->urb = usb_alloc_urb(0, GFP_ATOMIC);
309 if (!tm_wheel->urb) {
314 tm_wheel->model_request = kmemdup(&model_request,
317 if (!tm_wheel->model_request) {
322 tm_wheel->response = kzalloc(sizeof(struct tm_wheel_response), GFP_KERNEL);
323 if (!tm_wheel->response) {
328 tm_wheel->change_request = kmemdup(&change_request,
331 if (!tm_wheel->change_request) {
336 tm_wheel->usb_dev = interface_to_usbdev(to_usb_interface(hdev->dev.parent));
337 hid_set_drvdata(hdev, tm_wheel);
342 tm_wheel->urb,
343 tm_wheel->usb_dev,
344 usb_rcvctrlpipe(tm_wheel->usb_dev, 0),
345 (char *)tm_wheel->model_request,
346 tm_wheel->response,
352 ret = usb_submit_urb(tm_wheel->urb, GFP_ATOMIC);
360 error6: kfree(tm_wheel->change_request);
361 error5: kfree(tm_wheel->response);
362 error4: kfree(tm_wheel->model_request);
363 error3: usb_free_urb(tm_wheel->urb);
364 error2: kfree(tm_wheel);