Changeset ebcb05a in mainline for uspace/drv
- Timestamp:
- 2011-04-01T19:00:51Z (15 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 969585f, ea53529
- Parents:
- bdbb6f6
- Location:
- uspace/drv
- Files:
-
- 8 edited
-
isa/isa.c (modified) (12 diffs)
-
ns8250/ns8250.c (modified) (21 diffs)
-
pciintel/pci.c (modified) (15 diffs)
-
root/root.c (modified) (11 diffs)
-
rootpc/rootpc.c (modified) (4 diffs)
-
rootvirt/rootvirt.c (modified) (4 diffs)
-
test1/test1.c (modified) (6 diffs)
-
test2/test2.c (modified) (8 diffs)
Legend:
- Unmodified
- Added
- Removed
-
uspace/drv/isa/isa.c
rbdbb6f6 rebcb05a 135 135 fd = open(conf_path, O_RDONLY); 136 136 if (fd < 0) { 137 ddf_msg(LVL_ERROR, "Unable to open %s \n", conf_path);137 ddf_msg(LVL_ERROR, "Unable to open %s", conf_path); 138 138 goto cleanup; 139 139 } … … 144 144 lseek(fd, 0, SEEK_SET); 145 145 if (len == 0) { 146 ddf_msg(LVL_ERROR, "Configuration file '%s' is empty. \n",146 ddf_msg(LVL_ERROR, "Configuration file '%s' is empty.", 147 147 conf_path); 148 148 goto cleanup; … … 151 151 buf = malloc(len + 1); 152 152 if (buf == NULL) { 153 ddf_msg(LVL_ERROR, "Memory allocation failed. \n");153 ddf_msg(LVL_ERROR, "Memory allocation failed."); 154 154 goto cleanup; 155 155 } 156 156 157 157 if (0 >= read(fd, buf, len)) { 158 ddf_msg(LVL_ERROR, "Unable to read file '%s'. \n", conf_path);158 ddf_msg(LVL_ERROR, "Unable to read file '%s'.", conf_path); 159 159 goto cleanup; 160 160 } … … 252 252 fun->hw_resources.count++; 253 253 254 ddf_msg(LVL_NOTE, "Added irq 0x%x to function %s \n", irq,254 ddf_msg(LVL_NOTE, "Added irq 0x%x to function %s", irq, 255 255 fun->fnode->name); 256 256 } … … 271 271 272 272 ddf_msg(LVL_NOTE, "Added io range (addr=0x%x, size=0x%x) to " 273 "function %s \n", (unsigned int) addr, (unsigned int) len,273 "function %s", (unsigned int) addr, (unsigned int) len, 274 274 fun->fnode->name); 275 275 } … … 332 332 if (val == end) { 333 333 ddf_msg(LVL_ERROR, "Cannot read match score for function " 334 "%s. \n", fun->fnode->name);334 "%s.", fun->fnode->name); 335 335 return; 336 336 } … … 339 339 get_match_id(&id, val); 340 340 if (id == NULL) { 341 ddf_msg(LVL_ERROR, "Cannot read match ID for function %s. \n",341 ddf_msg(LVL_ERROR, "Cannot read match ID for function %s.", 342 342 fun->fnode->name); 343 343 return; … … 345 345 346 346 ddf_msg(LVL_DEBUG, "Adding match id '%s' with score %d to " 347 "function %s \n", id, score, fun->fnode->name);347 "function %s", id, score, fun->fnode->name); 348 348 349 349 rc = ddf_fun_add_match_id(fun->fnode, id, score); 350 350 if (rc != EOK) { 351 ddf_msg(LVL_ERROR, "Failed adding match ID: %s \n",351 ddf_msg(LVL_ERROR, "Failed adding match ID: %s", 352 352 str_error(rc)); 353 353 } … … 379 379 !prop_parse(fun, line, "match", &fun_parse_match_id)) { 380 380 381 ddf_msg(LVL_ERROR, "Undefined device property at line '%s' \n",381 ddf_msg(LVL_ERROR, "Undefined device property at line '%s'", 382 382 line); 383 383 } … … 441 441 fun->fnode->ops = &isa_fun_ops; 442 442 443 ddf_msg(LVL_DEBUG, "Binding function %s. \n", fun->fnode->name);443 ddf_msg(LVL_DEBUG, "Binding function %s.", fun->fnode->name); 444 444 445 445 /* XXX Handle error */ … … 469 469 static int isa_add_device(ddf_dev_t *dev) 470 470 { 471 ddf_msg(LVL_DEBUG, "isa_add_device, device handle = %d \n",471 ddf_msg(LVL_DEBUG, "isa_add_device, device handle = %d", 472 472 (int) dev->handle); 473 473 474 474 /* Make the bus device more visible. Does not do anything. */ 475 ddf_msg(LVL_DEBUG, "Adding a 'ctl' function \n");475 ddf_msg(LVL_DEBUG, "Adding a 'ctl' function"); 476 476 477 477 ddf_fun_t *ctl = ddf_fun_create(dev, fun_exposed, "ctl"); 478 478 if (ctl == NULL) { 479 ddf_msg(LVL_ERROR, "Failed creating control function. \n");479 ddf_msg(LVL_ERROR, "Failed creating control function."); 480 480 return EXDEV; 481 481 } 482 482 483 483 if (ddf_fun_bind(ctl) != EOK) { 484 ddf_msg(LVL_ERROR, "Failed binding control function. \n");484 ddf_msg(LVL_ERROR, "Failed binding control function."); 485 485 return EXDEV; 486 486 } … … 488 488 /* Add functions as specified in the configuration file. */ 489 489 isa_functions_add(dev); 490 ddf_msg(LVL_NOTE, "Finished enumerating legacy functions \n");490 ddf_msg(LVL_NOTE, "Finished enumerating legacy functions"); 491 491 492 492 return EOK; -
uspace/drv/ns8250/ns8250.c
rbdbb6f6 rebcb05a 276 276 static bool ns8250_pio_enable(ns8250_t *ns) 277 277 { 278 ddf_msg(LVL_DEBUG, "ns8250_pio_enable %s \n", ns->dev->name);278 ddf_msg(LVL_DEBUG, "ns8250_pio_enable %s", ns->dev->name); 279 279 280 280 /* Gain control over port's registers. */ … … 282 282 (void **) &ns->port)) { 283 283 ddf_msg(LVL_ERROR, "Cannot map the port %#" PRIx32 284 " for device %s. \n", ns->io_addr, ns->dev->name);284 " for device %s.", ns->io_addr, ns->dev->name); 285 285 return false; 286 286 } … … 296 296 static bool ns8250_dev_probe(ns8250_t *ns) 297 297 { 298 ddf_msg(LVL_DEBUG, "ns8250_dev_probe %s \n", ns->dev->name);298 ddf_msg(LVL_DEBUG, "ns8250_dev_probe %s", ns->dev->name); 299 299 300 300 ioport8_t *port_addr = ns->port; … … 315 315 316 316 if (!res) { 317 ddf_msg(LVL_DEBUG, "Device %s is not present. \n",317 ddf_msg(LVL_DEBUG, "Device %s is not present.", 318 318 ns->dev->name); 319 319 } … … 329 329 static int ns8250_dev_initialize(ns8250_t *ns) 330 330 { 331 ddf_msg(LVL_DEBUG, "ns8250_dev_initialize %s \n", ns->dev->name);331 ddf_msg(LVL_DEBUG, "ns8250_dev_initialize %s", ns->dev->name); 332 332 333 333 int ret = EOK; … … 341 341 if (ns->dev->parent_phone < 0) { 342 342 ddf_msg(LVL_ERROR, "Failed to connect to parent driver of " 343 "device %s. \n", ns->dev->name);343 "device %s.", ns->dev->name); 344 344 ret = ns->dev->parent_phone; 345 345 goto failed; … … 350 350 if (ret != EOK) { 351 351 ddf_msg(LVL_ERROR, "Failed to get HW resources for device " 352 "%s. \n", ns->dev->name);352 "%s.", ns->dev->name); 353 353 goto failed; 354 354 } … … 365 365 ns->irq = res->res.interrupt.irq; 366 366 irq = true; 367 ddf_msg(LVL_NOTE, "Device %s was asigned irq = 0x%x. \n",367 ddf_msg(LVL_NOTE, "Device %s was asigned irq = 0x%x.", 368 368 ns->dev->name, ns->irq); 369 369 break; … … 373 373 if (res->res.io_range.size < REG_COUNT) { 374 374 ddf_msg(LVL_ERROR, "I/O range assigned to " 375 "device %s is too small. \n", ns->dev->name);375 "device %s is too small.", ns->dev->name); 376 376 ret = ELIMIT; 377 377 goto failed; … … 379 379 ioport = true; 380 380 ddf_msg(LVL_NOTE, "Device %s was asigned I/O address = " 381 "0x%x. \n", ns->dev->name, ns->io_addr);382 break;381 "0x%x.", ns->dev->name, ns->io_addr); 382 break; 383 383 384 384 default: … … 388 388 389 389 if (!irq || !ioport) { 390 ddf_msg(LVL_ERROR, "Missing HW resource(s) for device %s. \n",390 ddf_msg(LVL_ERROR, "Missing HW resource(s) for device %s.", 391 391 ns->dev->name); 392 392 ret = ENOENT; … … 473 473 474 474 if (baud_rate < 50 || MAX_BAUD_RATE % baud_rate != 0) { 475 ddf_msg(LVL_ERROR, "Invalid baud rate %d requested. \n",475 ddf_msg(LVL_ERROR, "Invalid baud rate %d requested.", 476 476 baud_rate); 477 477 return EINVAL; … … 658 658 if (!buf_push_back(&ns->input_buffer, val)) { 659 659 ddf_msg(LVL_WARN, "Buffer overflow on " 660 "%s. \n", ns->dev->name);660 "%s.", ns->dev->name); 661 661 } else { 662 662 ddf_msg(LVL_DEBUG2, "Character %c saved " 663 "to the buffer of %s. \n",663 "to the buffer of %s.", 664 664 val, ns->dev->name); 665 665 } … … 717 717 int rc; 718 718 719 ddf_msg(LVL_DEBUG, "ns8250_add_device %s (handle = %d) \n",719 ddf_msg(LVL_DEBUG, "ns8250_add_device %s (handle = %d)", 720 720 dev->name, (int) dev->handle); 721 721 … … 752 752 /* Register interrupt handler. */ 753 753 if (ns8250_register_interrupt_handler(ns) != EOK) { 754 ddf_msg(LVL_ERROR, "Failed to register interrupt handler. \n");754 ddf_msg(LVL_ERROR, "Failed to register interrupt handler."); 755 755 rc = EADDRNOTAVAIL; 756 756 goto fail; … … 761 761 if (rc != EOK) { 762 762 ddf_msg(LVL_ERROR, "Failed to enable the interrupt. Error code = " 763 "%d. \n", rc);763 "%d.", rc); 764 764 goto fail; 765 765 } … … 767 767 fun = ddf_fun_create(dev, fun_exposed, "a"); 768 768 if (fun == NULL) { 769 ddf_msg(LVL_ERROR, "Failed creating function. \n");769 ddf_msg(LVL_ERROR, "Failed creating function."); 770 770 goto fail; 771 771 } … … 775 775 rc = ddf_fun_bind(fun); 776 776 if (rc != EOK) { 777 ddf_msg(LVL_ERROR, "Failed binding function. \n");777 ddf_msg(LVL_ERROR, "Failed binding function."); 778 778 goto fail; 779 779 } … … 783 783 ddf_fun_add_to_class(fun, "serial"); 784 784 785 ddf_msg(LVL_NOTE, "Device %s successfully initialized. \n",785 ddf_msg(LVL_NOTE, "Device %s successfully initialized.", 786 786 dev->name); 787 787 … … 866 866 867 867 ddf_msg(LVL_DEBUG, "ns8250_get_props: baud rate %d, parity 0x%x, word " 868 "length %d, stop bits %d \n", *baud_rate, *parity, *word_length,868 "length %d, stop bits %d", *baud_rate, *parity, *word_length, 869 869 *stop_bits); 870 870 } … … 883 883 { 884 884 ddf_msg(LVL_DEBUG, "ns8250_set_props: baud rate %d, parity 0x%x, word " 885 "length %d, stop bits %d \n", baud_rate, parity, word_length,885 "length %d, stop bits %d", baud_rate, parity, word_length, 886 886 stop_bits); 887 887 -
uspace/drv/pciintel/pci.c
rbdbb6f6 rebcb05a 226 226 227 227 if (match_id_str == NULL) { 228 ddf_msg(LVL_ERROR, "Out of memory creating match ID. \n");228 ddf_msg(LVL_ERROR, "Out of memory creating match ID."); 229 229 return; 230 230 } … … 232 232 rc = ddf_fun_add_match_id(fun->fnode, match_id_str, 90); 233 233 if (rc != EOK) { 234 ddf_msg(LVL_ERROR, "Failed adding match ID: %s \n",234 ddf_msg(LVL_ERROR, "Failed adding match ID: %s", 235 235 str_error(rc)); 236 236 } … … 325 325 if (range_addr != 0) { 326 326 ddf_msg(LVL_DEBUG, "Function %s : address = %" PRIx64 327 ", size = %x \n", fun->fnode->name, range_addr,327 ", size = %x", fun->fnode->name, range_addr, 328 328 (unsigned int) range_size); 329 329 } … … 351 351 hw_res_list->count++; 352 352 353 ddf_msg(LVL_NOTE, "Function %s uses irq %x. \n", fun->fnode->name, irq);353 ddf_msg(LVL_NOTE, "Function %s uses irq %x.", fun->fnode->name, irq); 354 354 } 355 355 … … 407 407 char *fun_name = pci_fun_create_name(fun); 408 408 if (fun_name == NULL) { 409 ddf_msg(LVL_ERROR, "Out of memory. \n");409 ddf_msg(LVL_ERROR, "Out of memory."); 410 410 return; 411 411 } … … 413 413 fnode = ddf_fun_create(bus->dnode, fun_inner, fun_name); 414 414 if (fnode == NULL) { 415 ddf_msg(LVL_ERROR, "Failed creating function. \n");415 ddf_msg(LVL_ERROR, "Failed creating function."); 416 416 return; 417 417 } … … 427 427 fnode->driver_data = fun; 428 428 429 ddf_msg(LVL_DEBUG, "Adding new function %s. \n",429 ddf_msg(LVL_DEBUG, "Adding new function %s.", 430 430 fnode->name); 431 431 … … 445 445 PCI_BRIDGE_SEC_BUS_NUM); 446 446 ddf_msg(LVL_DEBUG, "Device is pci-to-pci " 447 "bridge, secondary bus number = %d. \n",447 "bridge, secondary bus number = %d.", 448 448 bus_num); 449 449 if (child_bus > bus_num) … … 468 468 int rc; 469 469 470 ddf_msg(LVL_DEBUG, "pci_add_device \n");470 ddf_msg(LVL_DEBUG, "pci_add_device"); 471 471 dnode->parent_phone = -1; 472 472 473 473 bus = pci_bus_new(); 474 474 if (bus == NULL) { 475 ddf_msg(LVL_ERROR, "pci_add_device allocation failed. \n");475 ddf_msg(LVL_ERROR, "pci_add_device allocation failed."); 476 476 rc = ENOMEM; 477 477 goto fail; … … 484 484 if (dnode->parent_phone < 0) { 485 485 ddf_msg(LVL_ERROR, "pci_add_device failed to connect to the " 486 "parent's driver. \n");486 "parent's driver."); 487 487 rc = dnode->parent_phone; 488 488 goto fail; … … 494 494 if (rc != EOK) { 495 495 ddf_msg(LVL_ERROR, "pci_add_device failed to get hw resources " 496 "for the device. \n");496 "for the device."); 497 497 goto fail; 498 498 } 499 499 got_res = true; 500 500 501 ddf_msg(LVL_DEBUG, "conf_addr = %" PRIx64 ". \n",501 ddf_msg(LVL_DEBUG, "conf_addr = %" PRIx64 ".", 502 502 hw_resources.resources[0].res.io_range.address); 503 503 … … 511 511 if (pio_enable((void *)(uintptr_t)bus->conf_io_addr, 8, 512 512 &bus->conf_addr_port)) { 513 ddf_msg(LVL_ERROR, "Failed to enable configuration ports. \n");513 ddf_msg(LVL_ERROR, "Failed to enable configuration ports."); 514 514 rc = EADDRNOTAVAIL; 515 515 goto fail; … … 518 518 519 519 /* Make the bus device more visible. It has no use yet. */ 520 ddf_msg(LVL_DEBUG, "Adding a 'ctl' function \n");520 ddf_msg(LVL_DEBUG, "Adding a 'ctl' function"); 521 521 522 522 ctl = ddf_fun_create(bus->dnode, fun_exposed, "ctl"); 523 523 if (ctl == NULL) { 524 printf(NAME ": error creating control function.\n");524 ddf_msg(LVL_ERROR, "Failed creating control function."); 525 525 rc = ENOMEM; 526 526 goto fail; … … 529 529 rc = ddf_fun_bind(ctl); 530 530 if (rc != EOK) { 531 printf(NAME ": error binding control function.\n");531 ddf_msg(LVL_ERROR, "Failed binding control function."); 532 532 goto fail; 533 533 } 534 534 535 535 /* Enumerate functions. */ 536 ddf_msg(LVL_DEBUG, "Scanning the bus \n");536 ddf_msg(LVL_DEBUG, "Scanning the bus"); 537 537 pci_bus_scan(bus, 0); 538 538 … … 634 634 int main(int argc, char *argv[]) 635 635 { 636 printf(NAME ": HelenOS pci bus driver (intel method 1).\n");636 printf(NAME ": HelenOS PCI bus driver (Intel method 1).\n"); 637 637 pciintel_init(); 638 638 return ddf_driver_main(&pci_driver); -
uspace/drv/root/root.c
rbdbb6f6 rebcb05a 91 91 92 92 ddf_msg(LVL_DEBUG, "Adding new function for virtual devices. " 93 "Function node is `%s' (%d %s) \n", name,93 "Function node is `%s' (%d %s)", name, 94 94 VIRTUAL_FUN_MATCH_SCORE, VIRTUAL_FUN_MATCH_ID); 95 95 96 96 fun = ddf_fun_create(dev, fun_inner, name); 97 97 if (fun == NULL) { 98 ddf_msg(LVL_ERROR, "Failed creating function %s \n", name);98 ddf_msg(LVL_ERROR, "Failed creating function %s", name); 99 99 return ENOMEM; 100 100 } … … 103 103 VIRTUAL_FUN_MATCH_SCORE); 104 104 if (rc != EOK) { 105 ddf_msg(LVL_ERROR, "Failed adding match IDs to function %s\n", name); 105 ddf_msg(LVL_ERROR, "Failed adding match IDs to function %s", 106 name); 106 107 ddf_fun_destroy(fun); 107 108 return rc; … … 110 111 rc = ddf_fun_bind(fun); 111 112 if (rc != EOK) { 112 ddf_msg(LVL_ERROR, "Failed binding function %s: %s \n", name,113 ddf_msg(LVL_ERROR, "Failed binding function %s: %s", name, 113 114 str_error(rc)); 114 115 ddf_fun_destroy(fun); … … 137 138 platform = sysinfo_get_data("platform", &platform_size); 138 139 if (platform == NULL) { 139 ddf_msg(LVL_ERROR, "Failed to obtain platform name. \n");140 ddf_msg(LVL_ERROR, "Failed to obtain platform name."); 140 141 return ENOENT; 141 142 } … … 144 145 platform = realloc(platform, platform_size + 1); 145 146 if (platform == NULL) { 146 ddf_msg(LVL_ERROR, "Memory allocation failed. \n");147 ddf_msg(LVL_ERROR, "Memory allocation failed."); 147 148 return ENOMEM; 148 149 } … … 152 153 /* Construct match ID. */ 153 154 if (asprintf(&match_id, PLATFORM_FUN_MATCH_ID_FMT, platform) == -1) { 154 ddf_msg(LVL_ERROR, "Memory allocation failed. \n");155 ddf_msg(LVL_ERROR, "Memory allocation failed."); 155 156 return ENOMEM; 156 157 } … … 158 159 /* Add function. */ 159 160 ddf_msg(LVL_DEBUG, "Adding platform function. Function node is `%s' " 160 " (%d %s) \n", PLATFORM_FUN_NAME, PLATFORM_FUN_MATCH_SCORE,161 " (%d %s)", PLATFORM_FUN_NAME, PLATFORM_FUN_MATCH_SCORE, 161 162 match_id); 162 163 163 164 fun = ddf_fun_create(dev, fun_inner, name); 164 165 if (fun == NULL) { 165 ddf_msg(LVL_ERROR, "Error creating function %s \n", name);166 ddf_msg(LVL_ERROR, "Error creating function %s", name); 166 167 return ENOMEM; 167 168 } … … 169 170 rc = ddf_fun_add_match_id(fun, match_id, PLATFORM_FUN_MATCH_SCORE); 170 171 if (rc != EOK) { 171 ddf_msg(LVL_ERROR, "Failed adding match IDs to function %s \n",172 ddf_msg(LVL_ERROR, "Failed adding match IDs to function %s", 172 173 name); 173 174 ddf_fun_destroy(fun); … … 177 178 rc = ddf_fun_bind(fun); 178 179 if (rc != EOK) { 179 ddf_msg(LVL_ERROR, "Failed binding function %s: %s \n", name,180 ddf_msg(LVL_ERROR, "Failed binding function %s: %s", name, 180 181 str_error(rc)); 181 182 ddf_fun_destroy(fun); … … 193 194 static int root_add_device(ddf_dev_t *dev) 194 195 { 195 ddf_msg(LVL_DEBUG, "root_add_device, device handle=%" PRIun "\n",196 ddf_msg(LVL_DEBUG, "root_add_device, device handle=%" PRIun, 196 197 dev->handle); 197 198 … … 206 207 int res = add_platform_fun(dev); 207 208 if (EOK != res) 208 ddf_msg(LVL_ERROR, "Failed adding child device for platform. \n");209 ddf_msg(LVL_ERROR, "Failed adding child device for platform."); 209 210 210 211 return res; -
uspace/drv/rootpc/rootpc.c
rbdbb6f6 rebcb05a 120 120 rootpc_fun_t *fun) 121 121 { 122 ddf_msg(LVL_DEBUG, "Adding new function '%s'. \n", name);122 ddf_msg(LVL_DEBUG, "Adding new function '%s'.", name); 123 123 124 124 ddf_fun_t *fnode = NULL; … … 146 146 /* Register function. */ 147 147 if (ddf_fun_bind(fnode) != EOK) { 148 ddf_msg(LVL_ERROR, "Failed binding function %s. \n", name);148 ddf_msg(LVL_ERROR, "Failed binding function %s.", name); 149 149 goto failure; 150 150 } … … 159 159 ddf_fun_destroy(fnode); 160 160 161 ddf_msg(LVL_ERROR, "Failed adding function '%s'. \n", name);161 ddf_msg(LVL_ERROR, "Failed adding function '%s'.", name); 162 162 163 163 return false; … … 177 177 static int rootpc_add_device(ddf_dev_t *dev) 178 178 { 179 ddf_msg(LVL_DEBUG, "rootpc_add_device, device handle = %d \n",179 ddf_msg(LVL_DEBUG, "rootpc_add_device, device handle = %d", 180 180 (int)dev->handle); 181 181 182 182 /* Register functions. */ 183 183 if (!rootpc_add_functions(dev)) { 184 ddf_msg(LVL_ERROR, "Failed to add functions for PC platform. \n");184 ddf_msg(LVL_ERROR, "Failed to add functions for PC platform."); 185 185 } 186 186 -
uspace/drv/rootvirt/rootvirt.c
rbdbb6f6 rebcb05a 84 84 int rc; 85 85 86 ddf_msg(LVL_DEBUG, "Registering function `%s' (match \"%s\") \n",86 ddf_msg(LVL_DEBUG, "Registering function `%s' (match \"%s\")", 87 87 vfun->name, vfun->match_id); 88 88 89 89 fun = ddf_fun_create(vdev, fun_inner, vfun->name); 90 90 if (fun == NULL) { 91 ddf_msg(LVL_ERROR, "Failed creating function %s \n", vfun->name);91 ddf_msg(LVL_ERROR, "Failed creating function %s", vfun->name); 92 92 return ENOMEM; 93 93 } … … 95 95 rc = ddf_fun_add_match_id(fun, vfun->match_id, 10); 96 96 if (rc != EOK) { 97 ddf_msg(LVL_ERROR, "Failed adding match IDs to function %s \n",97 ddf_msg(LVL_ERROR, "Failed adding match IDs to function %s", 98 98 vfun->name); 99 99 ddf_fun_destroy(fun); … … 103 103 rc = ddf_fun_bind(fun); 104 104 if (rc != EOK) { 105 ddf_msg(LVL_ERROR, "Failed binding function %s: %s \n", vfun->name,106 str_error(rc));105 ddf_msg(LVL_ERROR, "Failed binding function %s: %s", 106 vfun->name, str_error(rc)); 107 107 ddf_fun_destroy(fun); 108 108 return rc; 109 109 } 110 110 111 ddf_msg(LVL_NOTE, "Registered child device `%s' \n", vfun->name);111 ddf_msg(LVL_NOTE, "Registered child device `%s'", vfun->name); 112 112 return EOK; 113 113 } … … 125 125 } 126 126 127 ddf_msg(LVL_DEBUG, "add_device(handle=%d) \n", (int)dev->handle);127 ddf_msg(LVL_DEBUG, "add_device(handle=%d)", (int)dev->handle); 128 128 129 129 /* -
uspace/drv/test1/test1.c
rbdbb6f6 rebcb05a 65 65 int rc; 66 66 67 ddf_msg(LVL_DEBUG, "Registering function `%s': %s. \n", name, message);67 ddf_msg(LVL_DEBUG, "Registering function `%s': %s.", name, message); 68 68 69 69 fun = ddf_fun_create(parent, fun_inner, name); 70 70 if (fun == NULL) { 71 ddf_msg(LVL_ERROR, "Failed creating function %s \n", name);71 ddf_msg(LVL_ERROR, "Failed creating function %s", name); 72 72 rc = ENOMEM; 73 73 goto leave; … … 76 76 rc = ddf_fun_add_match_id(fun, str_dup(match_id), match_score); 77 77 if (rc != EOK) { 78 ddf_msg(LVL_ERROR, "Failed adding match IDs to function %s \n",78 ddf_msg(LVL_ERROR, "Failed adding match IDs to function %s", 79 79 name); 80 80 goto leave; … … 83 83 rc = ddf_fun_bind(fun); 84 84 if (rc != EOK) { 85 ddf_msg(LVL_ERROR, "Failed binding function %s: %s \n", name,85 ddf_msg(LVL_ERROR, "Failed binding function %s: %s", name, 86 86 str_error(rc)); 87 87 goto leave; 88 88 } 89 89 90 ddf_msg(LVL_NOTE, "Registered child device `%s' \n", name);90 ddf_msg(LVL_NOTE, "Registered child device `%s'", name); 91 91 rc = EOK; 92 92 … … 128 128 int rc; 129 129 130 ddf_msg(LVL_DEBUG, "add_device(name=\"%s\", handle=%d) \n",130 ddf_msg(LVL_DEBUG, "add_device(name=\"%s\", handle=%d)", 131 131 dev->name, (int) dev->handle); 132 132 133 133 fun_a = ddf_fun_create(dev, fun_exposed, "a"); 134 134 if (fun_a == NULL) { 135 ddf_msg(LVL_ERROR, "Failed creating function 'a'. \n");135 ddf_msg(LVL_ERROR, "Failed creating function 'a'."); 136 136 return ENOMEM; 137 137 } … … 139 139 rc = ddf_fun_bind(fun_a); 140 140 if (rc != EOK) { 141 ddf_msg(LVL_ERROR, "Failed binding function 'a'. \n");141 ddf_msg(LVL_ERROR, "Failed binding function 'a'."); 142 142 return rc; 143 143 } … … 161 161 } 162 162 163 ddf_msg(LVL_DEBUG, "Device `%s' accepted. \n", dev->name);163 ddf_msg(LVL_DEBUG, "Device `%s' accepted.", dev->name); 164 164 165 165 return EOK; -
uspace/drv/test2/test2.c
rbdbb6f6 rebcb05a 65 65 int rc; 66 66 67 ddf_msg(LVL_DEBUG, "Registering function `%s': %s. \n", name, message);67 ddf_msg(LVL_DEBUG, "Registering function `%s': %s.", name, message); 68 68 69 69 fun = ddf_fun_create(parent, fun_inner, name); 70 70 if (fun == NULL) { 71 ddf_msg(LVL_ERROR, "Failed creating function %s \n", name);71 ddf_msg(LVL_ERROR, "Failed creating function %s", name); 72 72 return ENOMEM; 73 73 } … … 75 75 rc = ddf_fun_add_match_id(fun, match_id, match_score); 76 76 if (rc != EOK) { 77 ddf_msg(LVL_ERROR, "Failed adding match IDs to function %s \n",77 ddf_msg(LVL_ERROR, "Failed adding match IDs to function %s", 78 78 name); 79 79 ddf_fun_destroy(fun); … … 83 83 rc = ddf_fun_bind(fun); 84 84 if (rc != EOK) { 85 ddf_msg(LVL_ERROR, "Failed binding function %s: %s \n", name,85 ddf_msg(LVL_ERROR, "Failed binding function %s: %s", name, 86 86 str_error(rc)); 87 87 ddf_fun_destroy(fun); … … 89 89 } 90 90 91 ddf_msg(LVL_NOTE, "Registered child device `%s' \n", name);91 ddf_msg(LVL_NOTE, "Registered child device `%s'", name); 92 92 return EOK; 93 93 } … … 113 113 fun_a = ddf_fun_create(dev, fun_exposed, "a"); 114 114 if (fun_a == NULL) { 115 ddf_msg(LVL_ERROR, "Failed creating function 'a'. \n");115 ddf_msg(LVL_ERROR, "Failed creating function 'a'."); 116 116 return ENOMEM; 117 117 } … … 119 119 rc = ddf_fun_bind(fun_a); 120 120 if (rc != EOK) { 121 ddf_msg(LVL_ERROR, "Failed binding function 'a'. \n");121 ddf_msg(LVL_ERROR, "Failed binding function 'a'."); 122 122 return rc; 123 123 } … … 130 130 static int test2_add_device(ddf_dev_t *dev) 131 131 { 132 ddf_msg(LVL_DEBUG, "test2_add_device(name=\"%s\", handle=%d) \n",132 ddf_msg(LVL_DEBUG, "test2_add_device(name=\"%s\", handle=%d)", 133 133 dev->name, (int) dev->handle); 134 134 … … 136 136 fid_t postpone = fibril_create(postponed_birth, dev); 137 137 if (postpone == 0) { 138 ddf_msg(LVL_ERROR, "fibril_create() failed. \n");138 ddf_msg(LVL_ERROR, "fibril_create() failed."); 139 139 return ENOMEM; 140 140 }
Note:
See TracChangeset
for help on using the changeset viewer.
