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


Ignore:
Timestamp:
2010-12-25T17:14:36Z (13 years ago)
Author:
Jakub Jermar <jakub@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
092e4f1
Parents:
59e9398b (diff), 3ac66f69 (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 mainline changes.

File:
1 edited

Legend:

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

    r59e9398b rb2d06fa  
    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.