Changeset 1c6c3e1d in mainline for uspace/srv/hw/char/s3c24xx_uart/s3c24xx_uart.c
- Timestamp:
- 2023-10-22T17:55:33Z (14 months ago)
- Branches:
- ticket/834-toolchain-update
- Children:
- 350ec74
- Parents:
- 315d487 (diff), 133461c (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the(diff)
links above to see all the changes relative to each parent. - File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/srv/hw/char/s3c24xx_uart/s3c24xx_uart.c
r315d487 r1c6c3e1d 1 1 /* 2 * Copyright (c) 20 10Jiri Svoboda2 * Copyright (c) 2023 Jiri Svoboda 3 3 * All rights reserved. 4 4 * … … 80 80 int main(int argc, char *argv[]) 81 81 { 82 loc_srv_t *srv; 83 82 84 printf("%s: S3C24xx on-chip UART driver\n", NAME); 83 85 84 86 async_set_fallback_port_handler(s3c24xx_uart_connection, uart); 85 errno_t rc = loc_server_register(NAME );87 errno_t rc = loc_server_register(NAME, &srv); 86 88 if (rc != EOK) { 87 89 printf("%s: Unable to register server.\n", NAME); … … 90 92 91 93 uart = malloc(sizeof(s3c24xx_uart_t)); 92 if (uart == NULL) 93 return -1; 94 95 if (s3c24xx_uart_init(uart) != EOK) 96 return -1; 97 98 rc = loc_service_register(NAMESPACE "/" NAME, &uart->service_id); 94 if (uart == NULL) { 95 loc_server_unregister(srv); 96 return -1; 97 } 98 99 if (s3c24xx_uart_init(uart) != EOK) { 100 free(uart); 101 loc_server_unregister(srv); 102 return -1; 103 } 104 105 rc = loc_service_register(srv, NAMESPACE "/" NAME, &uart->service_id); 99 106 if (rc != EOK) { 107 // XXX s3c24xx_uart_fini(uart); 108 free(uart); 109 loc_server_unregister(srv); 100 110 printf(NAME ": Unable to register device %s.\n", 101 111 NAMESPACE "/" NAME);
Note:
See TracChangeset
for help on using the changeset viewer.