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

Changeset 5f7d96e in mainline for uspace/lib/c/generic/device/hw_res.c


Ignore:
Timestamp:
2010-12-27T18:18:03Z (11 years ago)
Author:
Matus Dekanek <smekideki@…>
Branches:
lfn, master
Children:
43c3937
Parents:
e080332 (diff), e84d65a (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 from development

File:
1 edited

Legend:

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

    re080332 r5f7d96e  
    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.