Changeset be942bc in mainline


Ignore:
Timestamp:
2010-12-21T11:43:44Z (13 years ago)
Author:
Jakub Jermar <jakub@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
b0a76d5
Parents:
78ffb70
Message:

Do not use EPARTY inappropriately.

Location:
uspace
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • uspace/drv/ns8250/ns8250.c

    r78ffb70 rbe942bc  
    342342                printf(NAME ": failed to connect to the parent driver of the "
    343343                    "device %s.\n", dev->name);
    344                 ret = EPARTY;   /* FIXME: use another EC */
     344                ret = dev->parent_phone;
    345345                goto failed;
    346346        }
    347347       
    348348        /* Get hw resources. */
    349         if (!get_hw_resources(dev->parent_phone, &hw_resources)) {
     349        ret = get_hw_resources(dev->parent_phone, &hw_resources);
     350        if (ret != EOK) {
    350351                printf(NAME ": failed to get hw resources for the device "
    351352                    "%s.\n", dev->name);
    352                 ret = EPARTY;   /* FIXME: use another EC */
    353353                goto failed;
    354354        }
     
    374374                                printf(NAME ": i/o range assigned to the device "
    375375                                    "%s is too small.\n", dev->name);
    376                                 ret = EPARTY;   /* FIXME: use another EC */
     376                                ret = ELIMIT;
    377377                                goto failed;
    378378                        }
     
    390390                printf(NAME ": missing hw resource(s) for the device %s.\n",
    391391                    dev->name);
    392                 ret = EPARTY;   /* FIXME: use another EC */
     392                ret = ENOENT;
    393393                goto failed;
    394394        }
  • uspace/drv/pciintel/pci.c

    r78ffb70 rbe942bc  
    452452static int pci_add_device(device_t *dev)
    453453{
     454        int rc;
     455
    454456        printf(NAME ": pci_add_device\n");
    455457       
     
    466468                    "parent's driver.\n");
    467469                delete_pci_bus_data(bus_data);
    468                 return EPARTY;  /* FIXME: use another EC */
     470                return dev->parent_phone;
    469471        }
    470472       
    471473        hw_resource_list_t hw_resources;
    472474       
    473         if (!get_hw_resources(dev->parent_phone, &hw_resources)) {
     475        rc = get_hw_resources(dev->parent_phone, &hw_resources);
     476        if (rc != EOK) {
    474477                printf(NAME ": pci_add_device failed to get hw resources for "
    475478                    "the device.\n");
    476479                delete_pci_bus_data(bus_data);
    477480                ipc_hangup(dev->parent_phone);
    478                 return EPARTY;  /* FIXME: use another EC */
     481                return rc;
    479482        }       
    480483       
  • uspace/lib/c/generic/device/hw_res.c

    r78ffb70 rbe942bc  
    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
  • uspace/lib/c/include/device/hw_res.h

    r78ffb70 rbe942bc  
    9595
    9696
    97 bool get_hw_resources(int dev_phone, hw_resource_list_t *hw_resources);
    98 
    99 bool enable_interrupt(int dev_phone);
     97extern int get_hw_resources(int, hw_resource_list_t *);
     98extern bool enable_interrupt(int);
    10099
    101100
  • uspace/srv/net/tl/tcp/tcp.c

    r78ffb70 rbe942bc  
    20852085        if (!fibril) {
    20862086                free(operation_timeout);
    2087                 return EPARTY;  /* FIXME: use another EC */
    2088         }
     2087                return ENOMEM;
     2088        }
     2089
    20892090//      fibril_mutex_lock(&socket_data->operation.mutex);
    20902091        /* Start the timeout fibril */
Note: See TracChangeset for help on using the changeset viewer.