Changeset 2b0db98 in mainline for uspace/lib/c/generic/device/hw_res.c
- Timestamp:
- 2011-01-07T14:02:56Z (14 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 6986418
- Parents:
- d99120f (diff), 0f191a2 (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. - File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/c/generic/device/hw_res.c
rd99120f r2b0db98 38 38 #include <malloc.h> 39 39 40 boolget_hw_resources(int dev_phone, hw_resource_list_t *hw_resources)40 int get_hw_resources(int dev_phone, hw_resource_list_t *hw_resources) 41 41 { 42 42 sysarg_t count = 0; 43 43 int rc = async_req_1_1(dev_phone, DEV_IFACE_ID(HW_RES_DEV_IFACE), GET_RESOURCE_LIST, &count); 44 44 hw_resources->count = count; 45 if (EOK != rc) { 46 return false; 47 } 45 if (rc != EOK) 46 return rc; 48 47 49 48 size_t size = count * sizeof(hw_resource_t); 50 49 hw_resources->resources = (hw_resource_t *)malloc(size); 51 if (NULL == hw_resources->resources) { 52 return false; 53 } 50 if (!hw_resources->resources) 51 return ENOMEM; 54 52 55 53 rc = async_data_read_start(dev_phone, hw_resources->resources, size); 56 if ( EOK != rc) {54 if (rc != EOK) { 57 55 free(hw_resources->resources); 58 56 hw_resources->resources = NULL; 59 return false;57 return rc; 60 58 } 61 59 62 return true;60 return EOK; 63 61 } 64 62
Note:
See TracChangeset
for help on using the changeset viewer.