Changeset 4c6fd56 in mainline for uspace/srv/hw/char/s3c24xx_uart/s3c24xx_uart.c
- Timestamp:
- 2023-09-16T19:58:18Z (16 months ago)
- Branches:
- master, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 7d7f5e3
- Parents:
- 6a0b2cc
- git-author:
- Jiri Svoboda <jiri@…> (2023-09-16 19:48:07)
- git-committer:
- Jiri Svoboda <jiri@…> (2023-09-16 19:58:18)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/srv/hw/char/s3c24xx_uart/s3c24xx_uart.c
r6a0b2cc r4c6fd56 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.