Changes in uspace/drv/usbmouse/main.c [a6add7a:adfe5ec] in mainline
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/drv/usbmouse/main.c
ra6add7a radfe5ec 44 44 * @return Error code. 45 45 */ 46 static int usbmouse_add_device( ddf_dev_t *dev)46 static int usbmouse_add_device(usb_device_t *dev) 47 47 { 48 48 int rc = usb_mouse_create(dev); … … 53 53 } 54 54 55 fid_t poll_fibril = fibril_create(usb_mouse_polling_fibril, dev); 56 if (poll_fibril == 0) { 57 usb_log_error("Failed to initialize polling fibril.\n"); 58 /* FIXME: free allocated resources. */ 59 return ENOMEM; 55 usb_log_debug("Polling pipe at endpoint %d.\n", dev->pipes[0].pipe->endpoint_no); 56 57 rc = usb_device_auto_poll(dev, 0, 58 usb_mouse_polling_callback, dev->pipes[0].pipe->max_packet_size, 59 usb_mouse_polling_ended_callback, dev->driver_data); 60 61 if (rc != EOK) { 62 usb_log_error("Failed to start polling fibril: %s.\n", 63 str_error(rc)); 64 return rc; 60 65 } 61 66 62 fibril_add_ready(poll_fibril);63 64 67 usb_log_info("controlling new mouse (handle %llu).\n", 65 dev-> handle);68 dev->ddf_dev->handle); 66 69 67 70 return EOK; … … 69 72 70 73 /** USB mouse driver ops. */ 71 static driver_ops_t mouse_driver_ops = {74 static usb_driver_ops_t mouse_driver_ops = { 72 75 .add_device = usbmouse_add_device, 73 76 }; 74 77 78 static usb_endpoint_description_t *endpoints[] = { 79 &poll_endpoint_description, 80 NULL 81 }; 82 75 83 /** USB mouse driver. */ 76 static driver_t mouse_driver = {84 static usb_driver_t mouse_driver = { 77 85 .name = NAME, 78 .driver_ops = &mouse_driver_ops 86 .ops = &mouse_driver_ops, 87 .endpoints = endpoints 79 88 }; 80 89 … … 83 92 usb_log_enable(USB_LOG_LEVEL_DEBUG, NAME); 84 93 85 return ddf_driver_main(&mouse_driver);94 return usb_driver_main(&mouse_driver); 86 95 } 87 96
Note:
See TracChangeset
for help on using the changeset viewer.