Changes in uspace/drv/bus/usb/uhcirh/main.c [0c0f823b:89e061d] in mainline
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/drv/bus/usb/uhcirh/main.c
r0c0f823b r89e061d 36 36 #include <ddf/driver.h> 37 37 #include <devman.h> 38 #include <device/hw_res .h>38 #include <device/hw_res_parsed.h> 39 39 #include <errno.h> 40 40 #include <str_error.h> … … 136 136 { 137 137 assert(dev); 138 138 139 139 async_sess_t *parent_sess = 140 140 devman_parent_device_connect(EXCHANGE_SERIALIZE, dev->handle, … … 142 142 if (!parent_sess) 143 143 return ENOMEM; 144 145 hw_resource_list_t hw_resources; 146 const int ret = hw_res_get_resource_list(parent_sess, &hw_resources); 144 145 hw_res_list_parsed_t hw_res; 146 hw_res_list_parsed_init(&hw_res); 147 const int ret = hw_res_get_list_parsed(parent_sess, &hw_res, 0); 148 async_hangup(parent_sess); 147 149 if (ret != EOK) { 148 async_hangup(parent_sess);149 150 return ret; 150 151 } 151 152 uintptr_t io_address = 0; 153 size_t io_size = 0; 154 bool io_found = false; 155 156 size_t i = 0; 157 for (; i < hw_resources.count; i++) { 158 hw_resource_t *res = &hw_resources.resources[i]; 159 if (res->type == IO_RANGE) { 160 io_address = res->res.io_range.address; 161 io_size = res->res.io_range.size; 162 io_found = true; 163 } 164 152 153 if (hw_res.io_ranges.count != 1) { 154 hw_res_list_parsed_clean(&hw_res); 155 return EINVAL; 165 156 } 166 async_hangup(parent_sess); 167 168 if (!io_found) 169 return ENOENT; 170 157 171 158 if (io_reg_address != NULL) 172 *io_reg_address = io_address;173 159 *io_reg_address = hw_res.io_ranges.ranges[0].address; 160 174 161 if (io_reg_size != NULL) 175 *io_reg_size = io_size; 176 162 *io_reg_size = hw_res.io_ranges.ranges[0].size; 163 164 hw_res_list_parsed_clean(&hw_res); 177 165 return EOK; 178 166 }
Note:
See TracChangeset
for help on using the changeset viewer.