Changeset a1732929 in mainline for uspace/drv/hid/usbhid/mouse/mousedev.c
- Timestamp:
- 2018-01-15T17:04:34Z (6 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 9ff99e8
- Parents:
- c1a966e
- git-author:
- Ondřej Hlavatý <aearsis@…> (2018-01-15 17:04:32)
- git-committer:
- Ondřej Hlavatý <aearsis@…> (2018-01-15 17:04:34)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/drv/hid/usbhid/mouse/mousedev.c
rc1a966e ra1732929 118 118 119 119 if (mouse_dev == NULL) { 120 usb_log_debug("%s: Missing parameters. \n", __FUNCTION__);120 usb_log_debug("%s: Missing parameters.", __FUNCTION__); 121 121 async_answer_0(icallid, EINVAL); 122 122 return; 123 123 } 124 124 125 usb_log_debug("%s: fun->name: %s \n", __FUNCTION__, ddf_fun_get_name(fun));126 usb_log_debug("%s: mouse_sess: %p \n",125 usb_log_debug("%s: fun->name: %s", __FUNCTION__, ddf_fun_get_name(fun)); 126 usb_log_debug("%s: mouse_sess: %p", 127 127 __FUNCTION__, mouse_dev->mouse_sess); 128 128 … … 132 132 if (mouse_dev->mouse_sess == NULL) { 133 133 mouse_dev->mouse_sess = sess; 134 usb_log_debug("Console session to %s set ok (%p). \n",134 usb_log_debug("Console session to %s set ok (%p).", 135 135 ddf_fun_get_name(fun), sess); 136 136 async_answer_0(icallid, EOK); 137 137 } else { 138 usb_log_error("Console session to %s already set. \n",138 usb_log_error("Console session to %s already set.", 139 139 ddf_fun_get_name(fun)); 140 140 async_answer_0(icallid, ELIMIT); … … 142 142 } 143 143 } else { 144 usb_log_debug("%s: Invalid function. \n", __FUNCTION__);144 usb_log_debug("%s: Invalid function.", __FUNCTION__); 145 145 async_answer_0(icallid, EINVAL); 146 146 } … … 171 171 172 172 if (mouse_dev->mouse_sess == NULL) { 173 usb_log_warning(NAME " No console session. \n");173 usb_log_warning(NAME " No console session."); 174 174 return; 175 175 } … … 225 225 usb_hid_report_path_t *path = usb_hid_report_path(); 226 226 if (path == NULL) { 227 usb_log_warning("Failed to create USB HID report path. \n");227 usb_log_warning("Failed to create USB HID report path."); 228 228 return; 229 229 } … … 232 232 if (ret != EOK) { 233 233 usb_hid_report_path_free(path); 234 usb_log_warning("Failed to add buttons to report path. \n");234 usb_log_warning("Failed to add buttons to report path."); 235 235 return; 236 236 } … … 242 242 243 243 while (field != NULL) { 244 usb_log_debug2(NAME " VALUE(%X) USAGE(%X) \n", field->value,244 usb_log_debug2(NAME " VALUE(%X) USAGE(%X)", field->value, 245 245 field->usage); 246 246 assert(field->usage > field->usage_minimum); … … 331 331 332 332 if (mouse_dev->buttons == NULL) { 333 usb_log_error(NAME ": out of memory, giving up on device! \n");333 usb_log_error(NAME ": out of memory, giving up on device!"); 334 334 free(mouse_dev); 335 335 return ENOMEM; … … 344 344 int usb_mouse_init(usb_hid_dev_t *hid_dev, void **data) 345 345 { 346 usb_log_debug("Initializing HID/Mouse structure... \n");346 usb_log_debug("Initializing HID/Mouse structure..."); 347 347 348 348 if (hid_dev == NULL) { … … 353 353 354 354 /* Create the exposed function. */ 355 usb_log_debug("Creating DDF function %s... \n", HID_MOUSE_FUN_NAME);355 usb_log_debug("Creating DDF function %s...", HID_MOUSE_FUN_NAME); 356 356 ddf_fun_t *fun = usb_device_ddf_fun_create(hid_dev->usb_dev, 357 357 fun_exposed, HID_MOUSE_FUN_NAME); 358 358 if (fun == NULL) { 359 usb_log_error("Could not create DDF function node `%s'. \n",359 usb_log_error("Could not create DDF function node `%s'.", 360 360 HID_MOUSE_FUN_NAME); 361 361 return ENOMEM; … … 364 364 usb_mouse_t *mouse_dev = ddf_fun_data_alloc(fun, sizeof(usb_mouse_t)); 365 365 if (mouse_dev == NULL) { 366 usb_log_error("Failed to alloc HID mouse device structure. \n");366 usb_log_error("Failed to alloc HID mouse device structure."); 367 367 ddf_fun_destroy(fun); 368 368 return ENOMEM; … … 371 371 int ret = mouse_dev_init(mouse_dev, hid_dev); 372 372 if (ret != EOK) { 373 usb_log_error("Failed to init HID mouse device structure. \n");373 usb_log_error("Failed to init HID mouse device structure."); 374 374 return ret; 375 375 } … … 379 379 ret = ddf_fun_bind(fun); 380 380 if (ret != EOK) { 381 usb_log_error("Could not bind DDF function `%s': %s. \n",381 usb_log_error("Could not bind DDF function `%s': %s.", 382 382 ddf_fun_get_name(fun), str_error(ret)); 383 383 ddf_fun_destroy(fun); … … 385 385 } 386 386 387 usb_log_debug("Adding DDF function `%s' to category %s... \n",387 usb_log_debug("Adding DDF function `%s' to category %s...", 388 388 ddf_fun_get_name(fun), HID_MOUSE_CATEGORY); 389 389 ret = ddf_fun_add_to_category(fun, HID_MOUSE_CATEGORY); … … 444 444 445 445 if (rc != EOK) { 446 usb_log_error("Failed to parse boot report descriptor: %s \n",446 usb_log_error("Failed to parse boot report descriptor: %s", 447 447 str_error(rc)); 448 448 return rc;
Note:
See TracChangeset
for help on using the changeset viewer.