Changeset 5e718d9 in mainline for uspace/drv/bus/usb/usbhid/mouse/mousedev.c
- Timestamp:
- 2012-08-21T10:04:16Z (13 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 67edca6
- Parents:
- 0da6c04 (diff), 6a97f2e (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the(diff)
links above to see all the changes relative to each parent. - File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/drv/bus/usb/usbhid/mouse/mousedev.c
r0da6c04 r5e718d9 34 34 * USB Mouse driver API. 35 35 */ 36 37 /* XXX Fix this */ 38 #define _DDF_DATA_IMPLANT 36 39 37 40 #include <usb/debug.h> … … 115 118 ipc_callid_t icallid, ipc_call_t *icall) 116 119 { 117 usb_mouse_t *mouse_dev = fun->driver_data;120 usb_mouse_t *mouse_dev = ddf_fun_data_get(fun); 118 121 119 122 if (mouse_dev == NULL) { … … 123 126 } 124 127 125 usb_log_debug("%s: fun->name: %s\n", __FUNCTION__, fun->name);128 usb_log_debug("%s: fun->name: %s\n", __FUNCTION__, ddf_fun_get_name(fun)); 126 129 usb_log_debug("%s: mouse_sess: %p\n", 127 130 __FUNCTION__, mouse_dev->mouse_sess); … … 133 136 mouse_dev->mouse_sess = sess; 134 137 usb_log_debug("Console session to %s set ok (%p).\n", 135 fun->name, sess);138 ddf_fun_get_name(fun), sess); 136 139 async_answer_0(icallid, EOK); 137 140 } else { 138 141 usb_log_error("Console session to %s already set.\n", 139 fun->name);142 ddf_fun_get_name(fun)); 140 143 async_answer_0(icallid, ELIMIT); 141 144 async_hangup(sess); … … 249 252 if (fun) { \ 250 253 if (ddf_fun_unbind((fun)) == EOK) { \ 251 (fun)->driver_data = NULL; \252 254 ddf_fun_destroy((fun)); \ 253 255 } else { \ 254 256 usb_log_error("Could not unbind function `%s', it " \ 255 "will not be destroyed.\n", (fun)->name); \257 "will not be destroyed.\n", ddf_fun_get_name(fun)); \ 256 258 } \ 257 259 } else (void)0 … … 272 274 } 273 275 274 fun->ops = &ops;275 fun->driver_data = mouse;276 ddf_fun_set_ops(fun, &ops); 277 ddf_fun_data_implant(fun, mouse); 276 278 277 279 int rc = ddf_fun_bind(fun); 278 280 if (rc != EOK) { 279 281 usb_log_error("Could not bind DDF function `%s': %s.\n", 280 fun->name, str_error(rc)); 281 fun->driver_data = NULL; 282 ddf_fun_get_name(fun), str_error(rc)); 282 283 ddf_fun_destroy(fun); 283 284 return rc; … … 285 286 286 287 usb_log_debug("Adding DDF function `%s' to category %s...\n", 287 fun->name, HID_MOUSE_CATEGORY);288 ddf_fun_get_name(fun), HID_MOUSE_CATEGORY); 288 289 rc = ddf_fun_add_to_category(fun, HID_MOUSE_CATEGORY); 289 290 if (rc != EOK) { … … 419 420 420 421 free(mouse_dev->buttons); 421 free(mouse_dev);422 422 } 423 423
Note:
See TracChangeset
for help on using the changeset viewer.