| 130 | } |
| 131 | |
| 132 | STATIC |
| 133 | DTEntry |
| 134 | FindChild ( |
| 135 | IN DTEntry Cur, |
| 136 | IN CHAR8 *Buf |
| 137 | ) |
| 138 | { |
| 139 | DTEntry Child; |
| 140 | UINTN Index; |
| 141 | CHAR8 *Str; |
| 142 | UINT32 Dummy; |
| 143 | |
| 144 | if (Cur->NumChildren == 0) { |
| 145 | return NULL; |
| 146 | } |
| 147 | |
| 148 | Index = 1; |
| 149 | Child = GetFirstChild (Cur); |
| 150 | while (1) { |
| 151 | if (EFI_ERROR(DTGetProperty(Child, "name", (VOID **)&Str, &Dummy))) { |
| 152 | break; |
| 153 | } |
| 154 | |
| 155 | if (AsciiStrCmp(Str, Buf) == 0) { |
| 156 | return Child; |
| 157 | } |
| 158 | |
| 159 | if (Index >= Cur->NumChildren) { |
| 160 | break; |
| 161 | } |
| 162 | |
| 163 | Child = GetNextChild (Child); |
| 164 | ++Index; |
| 165 | } |
| 166 | |
| 167 | return NULL; |
| 168 | } |
| 169 | |
| 170 | // |
| 171 | // External Routines. |
no test coverage detected