Changes in uspace/drv/char/xtkbd/xtkbd.c [56fd7cf:9d58539] in mainline
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/drv/char/xtkbd/xtkbd.c
r56fd7cf r9d58539 34 34 35 35 #include <errno.h> 36 #include <devman.h> 36 37 #include <ddf/log.h> 37 38 #include <io/keycode.h> … … 206 207 assert(dev); 207 208 kbd->client_sess = NULL; 208 kbd->parent_sess = ddf_dev_parent_sess_create(dev, EXCHANGE_SERIALIZE); 209 kbd->parent_sess = devman_parent_device_connect(EXCHANGE_SERIALIZE, 210 dev->handle, IPC_FLAG_BLOCKING); 209 211 if (!kbd->parent_sess) 210 212 return ENOMEM; … … 212 214 kbd->kbd_fun = ddf_fun_create(dev, fun_exposed, "kbd"); 213 215 if (!kbd->kbd_fun) { 214 return ENOMEM; 215 } 216 ddf_fun_set_ops(kbd->kbd_fun, &kbd_ops); 216 async_hangup(kbd->parent_sess); 217 return ENOMEM; 218 } 219 kbd->kbd_fun->ops = &kbd_ops; 220 kbd->kbd_fun->driver_data = kbd; 217 221 218 222 int ret = ddf_fun_bind(kbd->kbd_fun); 219 223 if (ret != EOK) { 224 async_hangup(kbd->parent_sess); 225 kbd->kbd_fun->driver_data = NULL; 220 226 ddf_fun_destroy(kbd->kbd_fun); 221 227 return ENOMEM; … … 224 230 ret = ddf_fun_add_to_category(kbd->kbd_fun, "keyboard"); 225 231 if (ret != EOK) { 232 async_hangup(kbd->parent_sess); 226 233 ddf_fun_unbind(kbd->kbd_fun); 234 kbd->kbd_fun->driver_data = NULL; 227 235 ddf_fun_destroy(kbd->kbd_fun); 228 236 return ENOMEM; … … 231 239 kbd->polling_fibril = fibril_create(polling, kbd); 232 240 if (!kbd->polling_fibril) { 241 async_hangup(kbd->parent_sess); 233 242 ddf_fun_unbind(kbd->kbd_fun); 243 kbd->kbd_fun->driver_data = NULL; 234 244 ddf_fun_destroy(kbd->kbd_fun); 235 245 return ENOMEM; … … 309 319 ipc_callid_t icallid, ipc_call_t *icall) 310 320 { 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 311 327 const sysarg_t method = IPC_GET_IMETHOD(*icall); 312 xt_kbd_t *kbd = ddf_dev_data_get(ddf_fun_get_dev(fun));328 xt_kbd_t *kbd = fun->driver_data; 313 329 314 330 switch (method) {
Note:
See TracChangeset
for help on using the changeset viewer.