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


Ignore:
Timestamp:
2011-01-09T19:52:08Z (13 years ago)
Author:
Jiri Svoboda <jiri@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
36f2b3e
Parents:
8871dba
Message:

Rename iface to ops in driver.c

File:
1 edited

Legend:

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

    r8871dba rd35ac1d  
    140140}
    141141
    142 static device_t * driver_get_device(link_t *devices, devman_handle_t handle)
     142static device_t *driver_get_device(link_t *devices, devman_handle_t handle)
    143143{
    144144        device_t *dev = NULL;
     
    164164        int res = EOK;
    165165       
    166         devman_handle_t dev_handle =  IPC_GET_ARG1(*icall);
     166        devman_handle_t dev_handle = IPC_GET_ARG1(*icall);
    167167        devman_handle_t parent_dev_handle = IPC_GET_ARG2(*icall);
    168    
     168       
    169169        device_t *dev = create_device();
    170170        dev->handle = dev_handle;
     
    177177       
    178178        res = driver->driver_ops->add_device(dev);
    179         if (0 == res) {
     179        if (res == 0) {
    180180                printf("%s: new device with handle=%" PRIun " was added.\n",
    181181                    driver->name, dev_handle);
     
    246246                ret = (*dev->ops->open)(dev);
    247247       
    248         ipc_answer_0(iid, ret); 
     248        ipc_answer_0(iid, ret);
    249249        if (EOK != ret)
    250250                return;
     
    258258               
    259259                switch  (method) {
    260                 case IPC_M_PHONE_HUNGUP:               
     260                case IPC_M_PHONE_HUNGUP:
    261261                        /* close the device */
    262262                        if (NULL != dev->ops && NULL != dev->ops->close)
     
    264264                        ipc_answer_0(callid, EOK);
    265265                        return;
    266                 default:               
     266                default:
    267267                        /* convert ipc interface id to interface index */
    268268                       
     
    289289                        /* calling one of the device's interfaces */
    290290                       
    291                         /* get the device interface structure */
    292                         void *iface = device_get_iface(dev, iface_idx);
    293                         if (NULL == iface) {
     291                        /* Get the interface ops structure. */
     292                        void *ops = device_get_ops(dev, iface_idx);
     293                        if (ops == NULL) {
    294294                                printf("%s: driver_connection_gen error - ",
    295295                                    driver->name);
     
    304304                         * handling ("remote interface").
    305305                         */
    306                         remote_iface_t* rem_iface = get_remote_iface(iface_idx);
     306                        remote_iface_t *rem_iface = get_remote_iface(iface_idx);
    307307                        assert(NULL != rem_iface);
    308308
     
    325325                         * associated with the device by its driver.
    326326                         */
    327                         (*iface_method_ptr)(dev, iface, callid, &call);
     327                        (*iface_method_ptr)(dev, ops, callid, &call);
    328328                        break;
    329329                }
     
    377377        if (EOK == res)
    378378                return res;
    379         remove_from_devices_list(child);       
     379        remove_from_devices_list(child);
    380380        return res;
    381381}
Note: See TracChangeset for help on using the changeset viewer.