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

Changeset 84439d7 in mainline for uspace/lib/drv/generic/driver.c


Ignore:
Timestamp:
2010-12-05T09:34:46Z (11 years ago)
Author:
Vojtech Horky <vojtechhorky@…>
Branches:
lfn, master
Children:
75732da
Parents:
56b962d (diff), 35537a7 (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 with development/

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/lib/drv/generic/driver.c

    r56b962d r84439d7  
    4848#include <ctype.h>
    4949#include <errno.h>
     50#include <inttypes.h>
    5051
    5152#include <ipc/driver.h>
     
    164165       
    165166        devman_handle_t dev_handle =  IPC_GET_ARG1(*icall);
     167        devman_handle_t parent_dev_handle = IPC_GET_ARG2(*icall);
     168   
    166169        device_t *dev = create_device();
    167170        dev->handle = dev_handle;
     
    171174       
    172175        add_to_devices_list(dev);
     176        dev->parent = driver_get_device(&devices, parent_dev_handle);
     177       
    173178        res = driver->driver_ops->add_device(dev);
    174179        if (0 == res) {
    175                 printf("%s: new device with handle = %x was added.\n",
     180                printf("%s: new device with handle=%" PRIun " was added.\n",
    176181                    driver->name, dev_handle);
    177182        } else {
    178                 printf("%s: failed to add a new device with handle = %d.\n",
     183                printf("%s: failed to add a new device with handle = %" PRIun ".\n",
    179184                    driver->name, dev_handle);
    180185                remove_from_devices_list(dev);
     
    203208                        break;
    204209                default:
    205                         if (!(callid & IPC_CALLID_NOTIFICATION))
    206                                 ipc_answer_0(callid, ENOENT);
     210                        ipc_answer_0(callid, ENOENT);
    207211                }
    208212        }
     
    226230        if (dev == NULL) {
    227231                printf("%s: driver_connection_gen error - no device with handle"
    228                     " %x was found.\n", driver->name, handle);
     232                    " %" PRIun " was found.\n", driver->name, handle);
    229233                ipc_answer_0(iid, ENOENT);
    230234                return;
     
    290294                                printf("%s: driver_connection_gen error - ",
    291295                                    driver->name);
    292                                 printf("device with handle %d has no interface "
     296                                printf("device with handle %" PRIun " has no interface "
    293297                                    "with id %d.\n", handle, iface_idx);
    294298                                ipc_answer_0(callid, ENOTSUP);
Note: See TracChangeset for help on using the changeset viewer.