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


Ignore:
Timestamp:
2017-10-17T13:11:35Z (8 years ago)
Author:
Ondřej Hlavatý <aearsis@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
60af4cdb
Parents:
dbf32b1 (diff), a416d070 (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

File:
1 edited

Legend:

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

    rdbf32b1 r95c675b  
    599599}
    600600
    601 /** Create session with the parent function.
    602  *
    603  * The session will be automatically closed when @a dev is destroyed.
    604  *
    605  * @param dev Device
    606  *
    607  * @return New session or NULL if session could not be created
    608  *
    609  */
    610 async_sess_t *ddf_dev_parent_sess_create(ddf_dev_t *dev)
    611 {
    612         assert(dev->parent_sess == NULL);
    613         dev->parent_sess = devman_parent_device_connect(dev->handle,
    614             IPC_FLAG_BLOCKING);
    615 
    616         return dev->parent_sess;
    617 }
    618 
    619601/** Return existing session with the parent function.
    620602 *
    621603 * @param dev   Device
    622  * @return      Existing session or NULL if there is no session
     604 * @return      Session with parent function or NULL upon failure
    623605 */
    624606async_sess_t *ddf_dev_parent_sess_get(ddf_dev_t *dev)
    625607{
     608        if (dev->parent_sess == NULL) {
     609                dev->parent_sess = devman_parent_device_connect(dev->handle,
     610                    IPC_FLAG_BLOCKING);
     611        }
     612
    626613        return dev->parent_sess;
    627614}
     
    943930        int rc = async_create_port(INTERFACE_DDF_DRIVER, driver_connection_driver,
    944931            NULL, &port);
    945         if (rc != EOK)
     932        if (rc != EOK) {
     933                printf("Error: Failed to create driver port.\n");
    946934                return rc;
     935        }
    947936       
    948937        rc = async_create_port(INTERFACE_DDF_DEVMAN, driver_connection_devman,
    949938            NULL, &port);
    950         if (rc != EOK)
     939        if (rc != EOK) {
     940                printf("Error: Failed to create devman port.\n");
    951941                return rc;
     942        }
    952943       
    953944        async_set_fallback_port_handler(driver_connection_client, NULL);
     
    964955        /* Return success from the task since server has started. */
    965956        rc = task_retval(0);
    966         if (rc != EOK)
     957        if (rc != EOK) {
     958                printf("Error: Failed returning task value.\n");
    967959                return rc;
     960        }
    968961       
    969962        async_manager();
Note: See TracChangeset for help on using the changeset viewer.