Changes in uspace/lib/drv/generic/driver.c [0d6915f:9f6c5ef0] in mainline
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/drv/generic/driver.c
r0d6915f r9f6c5ef0 48 48 #include <ctype.h> 49 49 #include <errno.h> 50 #include <inttypes.h> 50 51 51 52 #include <ipc/driver.h> … … 177 178 res = driver->driver_ops->add_device(dev); 178 179 if (0 == res) { 179 printf("%s: new device with handle = %xwas added.\n",180 printf("%s: new device with handle=%" PRIun " was added.\n", 180 181 driver->name, dev_handle); 181 182 } else { 182 printf("%s: failed to add a new device with handle = % d.\n",183 printf("%s: failed to add a new device with handle = %" PRIun ".\n", 183 184 driver->name, dev_handle); 184 185 remove_from_devices_list(dev); … … 207 208 break; 208 209 default: 209 if (!(callid & IPC_CALLID_NOTIFICATION)) 210 ipc_answer_0(callid, ENOENT); 210 ipc_answer_0(callid, ENOENT); 211 211 } 212 212 } … … 230 230 if (dev == NULL) { 231 231 printf("%s: driver_connection_gen error - no device with handle" 232 " % xwas found.\n", driver->name, handle);232 " %" PRIun " was found.\n", driver->name, handle); 233 233 ipc_answer_0(iid, ENOENT); 234 234 return; … … 294 294 printf("%s: driver_connection_gen error - ", 295 295 driver->name); 296 printf("device with handle % dhas no interface "296 printf("device with handle %" PRIun " has no interface " 297 297 "with id %d.\n", handle, iface_idx); 298 298 ipc_answer_0(callid, ENOTSUP); … … 381 381 } 382 382 383 /** Wrapper for child_device_register for devices with single match id. 384 * 385 * @param parent Parent device. 386 * @param child_name Child device name. 387 * @param child_match_id Child device match id. 388 * @param child_match_score Child device match score. 389 * @return Error code. 390 */ 391 int child_device_register_wrapper(device_t *parent, const char *child_name, 392 const char *child_match_id, int child_match_score, 393 devman_handle_t *child_handle) 394 { 395 device_t *child = NULL; 396 match_id_t *match_id = NULL; 397 int rc; 398 399 child = create_device(); 400 if (child == NULL) { 401 rc = ENOMEM; 402 goto failure; 403 } 404 405 child->name = child_name; 406 407 match_id = create_match_id(); 408 if (match_id == NULL) { 409 rc = ENOMEM; 410 goto failure; 411 } 412 413 match_id->id = child_match_id; 414 match_id->score = child_match_score; 415 add_match_id(&child->match_ids, match_id); 416 417 rc = child_device_register(child, parent); 418 if (EOK != rc) 419 goto failure; 420 421 if (child_handle != NULL) { 422 *child_handle = child->handle; 423 } 424 return EOK; 425 426 failure: 427 if (match_id != NULL) { 428 match_id->id = NULL; 429 delete_match_id(match_id); 430 } 431 432 if (child != NULL) { 433 child->name = NULL; 434 delete_device(child); 435 } 436 437 return rc; 438 } 439 383 440 int driver_main(driver_t *drv) 384 441 {
Note:
See TracChangeset
for help on using the changeset viewer.