Changeset 2b0db98 in mainline for uspace/lib/c/generic/device/hw_res.c


Ignore:
Timestamp:
2011-01-07T14:02:56Z (14 years ago)
Author:
Lubos Slovak <lubos.slovak@…>
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.
Message:

Merged development into lelian/hidd

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/lib/c/generic/device/hw_res.c

    rd99120f r2b0db98  
    3838#include <malloc.h>
    3939
    40 bool get_hw_resources(int dev_phone, hw_resource_list_t *hw_resources)
     40int get_hw_resources(int dev_phone, hw_resource_list_t *hw_resources)
    4141{
    4242        sysarg_t count = 0;
    4343        int rc = async_req_1_1(dev_phone, DEV_IFACE_ID(HW_RES_DEV_IFACE), GET_RESOURCE_LIST, &count);
    4444        hw_resources->count = count;
    45         if (EOK != rc) {
    46                 return false;
    47         }
     45        if (rc != EOK)
     46                return rc;
    4847       
    4948        size_t size = count * sizeof(hw_resource_t);
    5049        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;
    5452       
    5553        rc = async_data_read_start(dev_phone, hw_resources->resources, size);
    56         if (EOK != rc) {
     54        if (rc != EOK) {
    5755                free(hw_resources->resources);
    5856                hw_resources->resources = NULL;
    59                 return false;
     57                return rc;
    6058        }
    6159                 
    62         return true;     
     60        return EOK;
    6361}
    6462
Note: See TracChangeset for help on using the changeset viewer.