Changeset f928a8a in mainline
- Timestamp:
- 2010-04-22T11:00:40Z (14 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 1f8657b
- Parents:
- 5fe1c32
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/srv/drivers/isa/isa.c
r5fe1c32 rf928a8a 131 131 132 132 static char * read_dev_conf(const char *conf_path) 133 { 134 printf(NAME ": read_dev_conf conf_path = %s.\n", conf_path); 135 133 { 136 134 bool suc = false; 137 135 char *buf = NULL; … … 182 180 } 183 181 184 static char * str_get_line(char *str, char **next) { 182 static char * str_get_line(char *str, char **next) { 185 183 char *line = str; 184 185 if (NULL == str) { 186 *next = NULL; 187 return NULL; 188 } 189 186 190 while (0 != *str && '\n' != *str) { 187 191 str++; … … 192 196 } else { 193 197 *next = NULL; 194 } 195 196 *str = 0; 198 } 199 200 *str = 0; 197 201 198 202 return line; … … 254 258 255 259 data->hw_resources.count++; 260 261 printf(NAME ": added irq 0x%x to device %s\n", irq, dev->name); 256 262 } 257 263 } … … 268 274 resources[count].res.io_range.address = addr; 269 275 resources[count].res.io_range.size = len; 270 resources[count].res.io_range.endianness = LITTLE_ENDIAN; 276 resources[count].res.io_range.endianness = LITTLE_ENDIAN; 277 271 278 data->hw_resources.count++; 279 280 printf(NAME ": added io range (addr=0x%x, size=0x%x) to device %s\n", addr, len, dev->name); 272 281 } 273 282 } … … 314 323 while (!isspace(*end)) { 315 324 end++; 316 } 317 *end = 0; 318 319 size_t size = str_size(val) + 1; 325 } 326 size_t size = end - val + 1; 320 327 *id = (char *)malloc(size); 321 328 str_cpy(*id, size, val); … … 353 360 match_id->score = score; 354 361 355 printf(NAME ": adding match id %swith score %d to device %s\n", id, score, dev->name);362 printf(NAME ": adding match id '%s' with score %d to device %s\n", id, score, dev->name); 356 363 add_match_id(&dev->match_ids, match_id); 357 364 } … … 372 379 static void get_dev_prop(device_t *dev, char *line) 373 380 { 374 printf(NAME " get_dev_prop from line '%s'\n", line);375 381 // skip leading spaces 376 382 line = skip_spaces(line); … … 380 386 !read_dev_prop(dev, line, "match", &get_dev_match_id) 381 387 ) { 382 printf(NAME " error undefined device property at line %s\n", line);388 printf(NAME " error undefined device property at line '%s'\n", line); 383 389 } 384 390 } … … 411 417 } 412 418 413 printf(NAME ": next line ='%s'\n", dev_conf);414 printf(NAME ": current line ='%s'\n", line);415 416 419 // get device name 417 420 dev_name = get_device_name(line); … … 432 435 // get properties of the device (match ids, irq and io range) 433 436 while (true) { 434 line = str_get_line(dev_conf, &dev_conf); 437 line = str_get_line(dev_conf, &dev_conf); 435 438 436 439 if (line_empty(line)) { … … 442 445 get_dev_prop(dev, line); 443 446 444 printf(NAME ": next line ='%s'\n", dev_conf);445 printf(NAME ": current line ='%s'\n", line);447 //printf(NAME ": next line ='%s'\n", dev_conf); 448 //printf(NAME ": current line ='%s'\n", line); 446 449 } 447 450 … … 449 452 dev->class = &isa_child_class; 450 453 454 printf(NAME ": child_device_register(dev, parent); device is %s.\n", dev->name); 451 455 child_device_register(dev, parent); 452 456 … … 456 460 static char * parse_dev_conf(char *conf, device_t *parent) 457 461 { 458 while (NULL != conf ) {462 while (NULL != conf && 0 != *conf) { 459 463 conf = read_isa_dev_info(conf, parent); 460 464 }
Note:
See TracChangeset
for help on using the changeset viewer.