Fork us on GitHub Follow us on Facebook Follow us on Twitter

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


Ignore:
Timestamp:
2012-06-03T20:45:58Z (10 years ago)
Author:
Maurizio Lombardi <m.lombardi85@…>
Branches:
lfn, master
Children:
90478727
Parents:
f7e69f5 (diff), 3123d2a (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 mainline changes

File:
1 edited

Legend:

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

    rf7e69f5 re1e4192  
    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}
Note: See TracChangeset for help on using the changeset viewer.