Changeset cb41a5e in mainline for uspace/srv/rd/rd.c


Ignore:
Timestamp:
2009-05-21T07:03:38Z (16 years ago)
Author:
Martin Decky <martin@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
a095d20
Parents:
2246de6
Message:

improve devmap interface
remove spared device

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/srv/rd/rd.c

    r2246de6 rcb41a5e  
    113113        }
    114114       
    115         while (1) {
     115        while (true) {
    116116                callid = async_get_call(&call);
    117117                switch (IPC_GET_METHOD(call)) {
     
    205205        printf(NAME ": Found RAM disk at %p, %d bytes\n", rd_ph_addr, rd_size);
    206206       
    207         int driver_phone = devmap_driver_register(NAME, rd_connection);
    208         if (driver_phone < 0) {
    209                 printf(NAME ": Unable to register driver\n");
     207        int rc = devmap_driver_register(NAME, rd_connection);
     208        if (rc < 0) {
     209                printf(NAME ": Unable to register driver (%d)\n", rc);
    210210                return false;
    211211        }
    212212       
    213213        dev_handle_t dev_handle;
    214         if (devmap_device_register(driver_phone, "initrd", &dev_handle) != EOK) {
    215                 ipc_hangup(driver_phone);
    216                 printf(NAME ": Unable to register device\n");
    217                 return false;
    218         }
    219 
    220         /*
    221          * Create the second device.
    222          * We need at least two devices for the sake of testing of non-root
    223          * mounts. Of course it would be better to allow the second device
    224          * be created dynamically...
    225          */
    226         if (devmap_device_register(driver_phone, "spared", &dev_handle) != EOK) {
    227                 ipc_hangup(driver_phone);
     214        if (devmap_device_register("initrd", &dev_handle) != EOK) {
     215                devmap_hangup_phone(DEVMAP_DRIVER);
    228216                printf(NAME ": Unable to register device\n");
    229217                return false;
     
    249237/**
    250238 * @}
    251  */ 
     239 */
Note: See TracChangeset for help on using the changeset viewer.