Changeset 7eaeec1 in mainline for uspace/drv/char/xtkbd/xtkbd.c
- Timestamp:
- 2012-08-20T21:27:38Z (12 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 6a97f2e
- Parents:
- f3a37e28 (diff), dd13349 (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/char/xtkbd/xtkbd.c
rf3a37e28 r7eaeec1 34 34 35 35 #include <errno.h> 36 #include <devman.h>37 36 #include <ddf/log.h> 38 37 #include <io/keycode.h> … … 207 206 assert(dev); 208 207 kbd->client_sess = NULL; 209 kbd->parent_sess = devman_parent_device_connect(EXCHANGE_SERIALIZE, 210 dev->handle, IPC_FLAG_BLOCKING); 208 kbd->parent_sess = ddf_dev_parent_sess_create(dev, EXCHANGE_SERIALIZE); 211 209 if (!kbd->parent_sess) 212 210 return ENOMEM; … … 214 212 kbd->kbd_fun = ddf_fun_create(dev, fun_exposed, "kbd"); 215 213 if (!kbd->kbd_fun) { 216 async_hangup(kbd->parent_sess); 217 return ENOMEM; 218 } 219 kbd->kbd_fun->ops = &kbd_ops; 220 kbd->kbd_fun->driver_data = kbd; 214 return ENOMEM; 215 } 216 ddf_fun_set_ops(kbd->kbd_fun, &kbd_ops); 221 217 222 218 int ret = ddf_fun_bind(kbd->kbd_fun); 223 219 if (ret != EOK) { 224 async_hangup(kbd->parent_sess);225 kbd->kbd_fun->driver_data = NULL;226 220 ddf_fun_destroy(kbd->kbd_fun); 227 221 return ENOMEM; … … 230 224 ret = ddf_fun_add_to_category(kbd->kbd_fun, "keyboard"); 231 225 if (ret != EOK) { 232 async_hangup(kbd->parent_sess);233 226 ddf_fun_unbind(kbd->kbd_fun); 234 kbd->kbd_fun->driver_data = NULL;235 227 ddf_fun_destroy(kbd->kbd_fun); 236 228 return ENOMEM; … … 239 231 kbd->polling_fibril = fibril_create(polling, kbd); 240 232 if (!kbd->polling_fibril) { 241 async_hangup(kbd->parent_sess);242 233 ddf_fun_unbind(kbd->kbd_fun); 243 kbd->kbd_fun->driver_data = NULL;244 234 ddf_fun_destroy(kbd->kbd_fun); 245 235 return ENOMEM; … … 319 309 ipc_callid_t icallid, ipc_call_t *icall) 320 310 { 321 if (fun == NULL || fun->driver_data == NULL) {322 ddf_msg(LVL_ERROR, "%s: Missing parameter.", __FUNCTION__);323 async_answer_0(icallid, EINVAL);324 return;325 }326 327 311 const sysarg_t method = IPC_GET_IMETHOD(*icall); 328 xt_kbd_t *kbd = fun->driver_data;312 xt_kbd_t *kbd = ddf_dev_data_get(ddf_fun_get_dev(fun)); 329 313 330 314 switch (method) {
Note:
See TracChangeset
for help on using the changeset viewer.