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

Changeset 2bdf92a5 in mainline


Ignore:
Timestamp:
2017-10-10T06:34:37Z (3 years ago)
Author:
Jiri Svoboda <jiri@…>
Branches:
master
Children:
cccd60c3
Parents:
05913fe7
Message:

Eliminate remaining cases of drivers directly calling devman_parent_device_connect.

Location:
uspace/lib
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • uspace/lib/usbdev/src/devdrv.c

    r05913fe7 r2bdf92a5  
    489489        int iface_no = -1;
    490490
    491         async_sess_t *sess = devman_parent_device_connect(
    492             ddf_dev_get_handle(ddf_dev), IPC_FLAG_BLOCKING);
     491        async_sess_t *sess = ddf_dev_parent_sess_get(ddf_dev);
    493492        if (sess == NULL)
    494493                return ENOMEM;
    495494        const int ret = usb_device_get_info(sess, &h, &iface_no);
    496         async_hangup(sess);
    497495        if (ret != EOK)
    498496                return ret;
  • uspace/lib/usbhost/src/ddf_helpers.c

    r05913fe7 r2bdf92a5  
    4646#include <ddf/interrupt.h>
    4747#include <device/hw_res_parsed.h>
    48 #include <devman.h>
    4948#include <errno.h>
    5049#include <fibril_synch.h>
     
    692691}
    693692
    694 //TODO: Move this to generic ddf?
     693//TODO: Cache parent session in HCD
    695694/** Call the parent driver with a request to enable interrupts
    696695 *
     
    700699int hcd_ddf_enable_interrupts(ddf_dev_t *device)
    701700{
    702         assert(device);
    703         async_sess_t *parent_sess =
    704             devman_parent_device_connect(ddf_dev_get_handle(device),
    705             IPC_FLAG_BLOCKING);
     701        async_sess_t *parent_sess = ddf_dev_parent_sess_get(device);
     702        if (parent_sess == NULL)
     703                return EIO;
     704
    706705        const bool enabled = hw_res_enable_interrupt(parent_sess);
    707         async_hangup(parent_sess);
    708706
    709707        return enabled ? EOK : EIO;
    710708}
    711709
    712 //TODO: Move this to generic ddf?
     710//TODO: Cache parent session in HCD
    713711int hcd_ddf_get_registers(ddf_dev_t *device, hw_res_list_parsed_t *hw_res)
    714712{
    715         assert(device);
    716         assert(hw_res);
    717 
    718         async_sess_t *parent_sess =
    719             devman_parent_device_connect(ddf_dev_get_handle(device),
    720             IPC_FLAG_BLOCKING);
     713        async_sess_t *parent_sess = ddf_dev_parent_sess_get(device);
     714        if (parent_sess == NULL)
     715                return EIO;
     716
    721717        hw_res_list_parsed_init(hw_res);
    722718        const int ret = hw_res_get_list_parsed(parent_sess, hw_res, 0);
    723         async_hangup(parent_sess);
    724719        if (ret != EOK)
    725720                hw_res_list_parsed_clean(hw_res);
Note: See TracChangeset for help on using the changeset viewer.