Ignore:
Timestamp:
2023-10-22T17:55:33Z (15 months ago)
Author:
Jiří Zárevúcky <zarevucky.jiri@…>
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.
Message:

Merge branch 'master' into ticket

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/srv/hid/s3c24xx_ts/s3c24xx_ts.c

    r315d487 r1c6c3e1d  
    11/*
    2  * Copyright (c) 2010 Jiri Svoboda
     2 * Copyright (c) 2023 Jiri Svoboda
    33 * All rights reserved.
    44 *
     
    8181int main(int argc, char *argv[])
    8282{
     83        loc_srv_t *srv;
     84
    8385        printf("%s: S3C24xx touchscreen driver\n", NAME);
    8486
    8587        async_set_fallback_port_handler(s3c24xx_ts_connection, NULL);
    86         errno_t rc = loc_server_register(NAME);
     88        errno_t rc = loc_server_register(NAME, &srv);
    8789        if (rc != EOK) {
    8890                printf("%s: Unable to register driver.\n", NAME);
     
    9193
    9294        ts = malloc(sizeof(s3c24xx_ts_t));
    93         if (ts == NULL)
     95        if (ts == NULL) {
     96                loc_server_unregister(srv);
    9497                return -1;
    95 
    96         if (s3c24xx_ts_init(ts) != EOK)
     98        }
     99
     100        if (s3c24xx_ts_init(ts) != EOK) {
     101                free(ts);
     102                loc_server_unregister(srv);
    97103                return -1;
    98 
    99         rc = loc_service_register(NAMESPACE "/mouse", &ts->service_id);
     104        }
     105
     106        rc = loc_service_register(srv, NAMESPACE "/mouse", &ts->service_id);
    100107        if (rc != EOK) {
     108                // XXX s3c24xx_ts_fini();
     109                free(ts);
     110                loc_server_unregister(srv);
    101111                printf(NAME ": Unable to register device %s.\n",
    102112                    NAMESPACE "/mouse");
Note: See TracChangeset for help on using the changeset viewer.