Changeset 703d19c in mainline
- Timestamp:
- 2010-11-30T14:21:47Z (14 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 2edcb63
- Parents:
- 5bee897
- Location:
- uspace
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/drv/test1/test1.c
r5bee897 r703d19c 49 49 }; 50 50 51 /** Register child and inform user about it. 52 * 53 * @param parent Parent device. 54 * @param message Message for the user. 55 * @param name Device name. 56 * @param match_id Device match id. 57 * @param score Device match score. 58 */ 59 static void register_child_verbose(device_t *parent, const char *message, 60 const char *name, const char *match_id, int match_score) 61 { 62 printf(NAME ": registering child device `%s': %s.\n", 63 name, message); 64 65 int rc = child_device_register_wrapper(parent, name, 66 match_id, match_score); 67 68 if (rc != EOK) { 69 printf(NAME ": failed to register child `%s' (%s).\n", 70 name, str_error(rc)); 71 } 72 } 73 51 74 /** Callback when new device is passed to this driver. 52 75 * This function is the body of the test: it shall register new child … … 68 91 static int add_device(device_t *dev) 69 92 { 70 int rc;71 93 printf(NAME ": add_device(name=\"%s\", handle=%d)\n", 72 94 dev->name, (int) dev->handle); 73 95 96 add_device_to_class(dev, "virtual"); 97 74 98 if (dev->parent == NULL) { 75 printf(NAME ": cloning myself ;-).\n"); 76 rc = child_device_register_wrapper(dev, "clone", 99 register_child_verbose(dev, "cloning myself ;-)", "clone", 77 100 "virtual&test1", 10); 78 if (rc != EOK) {79 printf(NAME ": failed to register clone (%s).\n",80 str_error(rc));81 }82 101 } else if (str_cmp(dev->name, "clone") == 0) { 83 printf(NAME ": registering child device run by the same task.\n"); 84 rc = child_device_register_wrapper(dev, "child", 102 register_child_verbose(dev, "run by the same task", "child", 85 103 "virtual&test1&child", 10); 86 if (rc != EOK) {87 printf(NAME ": failed to register child (%s).\n",88 str_error(rc));89 }90 104 } 91 105 -
uspace/srv/devman/devman.c
r5bee897 r703d19c 516 516 int phone; 517 517 518 printf(NAME ": pass_devices_to_driver \n");518 printf(NAME ": pass_devices_to_driver(`%s')\n", driver->name); 519 519 520 520 fibril_mutex_lock(&driver->driver_mutex); … … 586 586 void initialize_running_driver(driver_t *driver, dev_tree_t *tree) 587 587 { 588 printf(NAME ": initialize_running_driver \n");588 printf(NAME ": initialize_running_driver (`%s')\n", driver->name); 589 589 590 590 /*
Note:
See TracChangeset
for help on using the changeset viewer.