Changeset 4b4e163 in mainline


Ignore:
Timestamp:
2011-03-07T10:50:01Z (14 years ago)
Author:
Jan Vesely <jano.vesely@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
2ab6875
Parents:
4ed80ce8
Message:

Refactoring

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/drv/uhci-hcd/pci.c

    r4ed80ce8 r4b4e163  
    8282        for (i = 0; i < hw_resources.count; i++) {
    8383                hw_resource_t *res = &hw_resources.resources[i];
    84                 switch (res->type) {
    85                         case INTERRUPT:
    86                                 irq = res->res.interrupt.irq;
    87                                 irq_found = true;
    88                                 usb_log_debug2("Found interrupt: %d.\n", irq);
    89                                 break;
    90                         case IO_RANGE:
    91                                 io_address = res->res.io_range.address;
    92                                 io_size = res->res.io_range.size;
    93                                 usb_log_debug2("Found io: %llx %zu.\n",
    94                                     res->res.io_range.address, res->res.io_range.size);
    95                                 io_found = true;
    96                                 break;
    97                         default:
    98                                 break;
     84                switch (res->type)
     85                {
     86                case INTERRUPT:
     87                        irq = res->res.interrupt.irq;
     88                        irq_found = true;
     89                        usb_log_debug2("Found interrupt: %d.\n", irq);
     90                        break;
     91
     92                case IO_RANGE:
     93                        io_address = res->res.io_range.address;
     94                        io_size = res->res.io_range.size;
     95                        usb_log_debug2("Found io: %llx %zu.\n",
     96                            res->res.io_range.address, res->res.io_range.size);
     97                        io_found = true;
     98
     99                default:
     100                        break;
    99101                }
    100102        }
    101103
    102         if (!io_found) {
    103                 rc = ENOENT;
    104                 goto leave;
    105         }
    106 
    107         if (!irq_found) {
     104        if (!io_found || !irq_found) {
    108105                rc = ENOENT;
    109106                goto leave;
     
    133130{
    134131        assert(device);
    135         int parent_phone = devman_parent_device_connect(device->handle,
    136                 IPC_FLAG_BLOCKING);
     132        int parent_phone =
     133            devman_parent_device_connect(device->handle, IPC_FLAG_BLOCKING);
    137134        if (parent_phone < 0) {
    138135                return parent_phone;
     
    144141        sysarg_t value = 0x8f00;
    145142
    146   int rc = async_req_3_0(parent_phone, DEV_IFACE_ID(PCI_DEV_IFACE),
     143        int rc = async_req_3_0(parent_phone, DEV_IFACE_ID(PCI_DEV_IFACE),
    147144            IPC_M_CONFIG_SPACE_WRITE_16, address, value);
    148145        async_hangup(parent_phone);
    149146
    150   return rc;
     147        return rc;
    151148}
    152149/*----------------------------------------------------------------------------*/
Note: See TracChangeset for help on using the changeset viewer.