Changes in uspace/drv/ns8250/ns8250.c [77429d3:7e752b2] in mainline
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/drv/ns8250/ns8250.c
r77429d3 r7e752b2 53 53 54 54 #include <driver.h> 55 #include <ops/char_dev.h> 55 #include <char.h> 56 #include <resource.h> 56 57 57 58 #include <devman.h> … … 226 227 227 228 /** The character interface's callbacks. */ 228 static char_ dev_ops_t ns8250_char_dev_ops= {229 static char_iface_t ns8250_char_iface = { 229 230 .read = &ns8250_read, 230 231 .write = &ns8250_write … … 273 274 274 275 /* Gain control over port's registers. */ 275 if (pio_enable((void *) (uintptr_t)data->io_addr, REG_COUNT,276 if (pio_enable((void *) data->io_addr, REG_COUNT, 276 277 (void **) &data->port)) { 277 278 printf(NAME ": error - cannot gain the port %#" PRIx32 " for device " … … 341 342 printf(NAME ": failed to connect to the parent driver of the " 342 343 "device %s.\n", dev->name); 343 ret = dev->parent_phone;344 ret = EPARTY; /* FIXME: use another EC */ 344 345 goto failed; 345 346 } 346 347 347 348 /* Get hw resources. */ 348 ret = hw_res_get_resource_list(dev->parent_phone, &hw_resources); 349 if (ret != EOK) { 349 if (!get_hw_resources(dev->parent_phone, &hw_resources)) { 350 350 printf(NAME ": failed to get hw resources for the device " 351 351 "%s.\n", dev->name); 352 ret = EPARTY; /* FIXME: use another EC */ 352 353 goto failed; 353 354 } … … 373 374 printf(NAME ": i/o range assigned to the device " 374 375 "%s is too small.\n", dev->name); 375 ret = E LIMIT;376 ret = EPARTY; /* FIXME: use another EC */ 376 377 goto failed; 377 378 } … … 389 390 printf(NAME ": missing hw resource(s) for the device %s.\n", 390 391 dev->name); 391 ret = E NOENT;392 ret = EPARTY; /* FIXME: use another EC */ 392 393 goto failed; 393 394 } 394 395 395 hw_res_clean_resource_list(&hw_resources);396 clean_hw_resource_list(&hw_resources); 396 397 return ret; 397 398 398 399 failed: 399 400 ns8250_dev_cleanup(dev); 400 hw_res_clean_resource_list(&hw_resources);401 clean_hw_resource_list(&hw_resources); 401 402 return ret; 402 403 } … … 431 432 { 432 433 ns8250_dev_data_t *data = (ns8250_dev_data_t *) dev->driver_data; 434 int res; 435 436 /* Enable interrupt globally. */ 437 res = interrupt_enable(data->irq); 438 if (res != EOK) 439 return res; 433 440 434 441 /* Enable interrupt on the serial port. */ … … 720 727 { 721 728 printf(NAME ": ns8250_add_device %s (handle = %d)\n", 722 dev->name, (int)dev->handle);729 dev->name, dev->handle); 723 730 724 731 int res = ns8250_dev_initialize(dev); … … 880 887 ipc_call_t *call) 881 888 { 882 sysarg_t method = IPC_GET_IMETHOD(*call);889 ipcarg_t method = IPC_GET_METHOD(*call); 883 890 int ret; 884 891 unsigned int baud_rate, parity, word_length, stop_bits; … … 917 924 ns8250_dev_ops.close = &ns8250_close; 918 925 919 ns8250_dev_ops.interfaces[CHAR_DEV_IFACE] = &ns8250_char_ dev_ops;926 ns8250_dev_ops.interfaces[CHAR_DEV_IFACE] = &ns8250_char_iface; 920 927 ns8250_dev_ops.default_handler = &ns8250_default_handler; 921 928 }
Note:
See TracChangeset
for help on using the changeset viewer.