Changeset bda60d9 in mainline for uspace/srv/drivers/root/root.c
- Timestamp:
- 2010-03-19T14:40:14Z (15 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- d347b53
- Parents:
- 7707954
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/srv/drivers/root/root.c
r7707954 rbda60d9 44 44 #include <string.h> 45 45 #include <ctype.h> 46 #include <macros.h> 46 47 47 48 #include <driver.h> … … 63 64 }; 64 65 66 static bool add_platform_child(device_t *parent) { 67 printf(NAME ": adding new child for platform device.\n"); 68 69 device_t *platform = NULL; 70 match_id_t *match_id = NULL; 71 72 // create new device 73 if (NULL == (platform = create_device())) { 74 goto failure; 75 } 76 77 // TODO - replace this with some better solution 78 platform->name = STRING(UARCH); 79 printf(NAME ": the new device's name is %s.\n", platform->name); 80 81 // initialize match id list 82 if (NULL == (match_id = create_match_id())) { 83 goto failure; 84 } 85 match_id->id = platform->name; 86 match_id->score = 100; 87 add_match_id(&platform->match_ids, match_id); 88 89 // register child device 90 if (!child_device_register(platform, parent)) { 91 goto failure; 92 } 93 94 return true; 95 96 failure: 97 if (NULL != match_id) { 98 match_id->id = NULL; 99 } 100 101 if (NULL != platform) { 102 platform->name = NULL; 103 delete_device(platform); 104 } 105 106 return false; 107 } 108 65 109 static bool root_add_device(device_t *dev) 66 110 { 67 printf(NAME ": root_add_device, device handle = %s", dev->handle); 68 // TODO add root device and register its children 111 printf(NAME ": root_add_device, device handle = %d\n", dev->handle); 112 113 // register root device's children 114 if (!add_platform_child(dev)) { 115 return false; 116 } 117 69 118 return true; 70 119 } … … 90 139 * @} 91 140 */ 141
Note:
See TracChangeset
for help on using the changeset viewer.