Changeset 8013637 in mainline for uspace/srv/bd/gxe_bd/gxe_bd.c


Ignore:
Timestamp:
2012-07-20T13:51:28Z (12 years ago)
Author:
Jan Vesely <jano.vesely@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
8fccd42
Parents:
c5bff3c (diff), 7030bc9 (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:

More mainline changes.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/srv/bd/gxe_bd/gxe_bd.c

    rc5bff3c r8013637  
    122122static int gxe_bd_init(void)
    123123{
     124        async_set_client_connection(gxe_bd_connection);
     125        int rc = loc_server_register(NAME);
     126        if (rc != EOK) {
     127                printf("%s: Unable to register driver.\n", NAME);
     128                return rc;
     129        }
     130       
    124131        void *vaddr;
    125         int rc, i;
    126         char name[16];
    127        
    128         async_set_client_connection(gxe_bd_connection);
    129         rc = loc_server_register(NAME);
    130         if (rc < 0) {
    131                 printf(NAME ": Unable to register driver.\n");
    132                 return rc;
    133         }
    134 
    135132        rc = pio_enable((void *) dev_physical, sizeof(gxe_bd_t), &vaddr);
    136133        if (rc != EOK) {
    137                 printf(NAME ": Could not initialize device I/O space.\n");
     134                printf("%s: Could not initialize device I/O space.\n", NAME);
    138135                return rc;
    139136        }
    140 
     137       
    141138        dev = vaddr;
    142 
    143         for (i = 0; i < MAX_DISKS; i++) {
    144                 snprintf(name, 16, "%s/disk%d", NAMESPACE, i);
     139       
     140        for (unsigned int i = 0; i < MAX_DISKS; i++) {
     141                char name[16];
     142               
     143                snprintf(name, 16, "%s/disk%u", NAMESPACE, i);
    145144                rc = loc_service_register(name, &service_id[i]);
    146145                if (rc != EOK) {
    147                         printf(NAME ": Unable to register device %s.\n", name);
     146                        printf("%s: Unable to register device %s.\n", NAME,
     147                            name);
    148148                        return rc;
    149149                }
     150               
    150151                fibril_mutex_initialize(&dev_lock[i]);
    151152        }
    152 
     153       
    153154        return EOK;
    154155}
     
    195196
    196197        (void) async_share_out_finalize(callid, &fs_va);
    197         if (fs_va == (void *) -1) {
     198        if (fs_va == AS_MAP_FAILED) {
    198199                async_answer_0(callid, EHANGUP);
    199200                return;
Note: See TracChangeset for help on using the changeset viewer.