Changeset df747b9c in mainline for uspace/srv/drivers/pciintel/pci.c


Ignore:
Timestamp:
2010-04-23T11:30:25Z (14 years ago)
Author:
Lenka Trochtova <trochtova.lenka@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
5af21c5
Parents:
a78fa2a
Message:

added device states (usable, invalid, not present, not initialized); add_device driver callback method returns integer (errno) instead of bool

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/srv/drivers/pciintel/pci.c

    ra78fa2a rdf747b9c  
    8585
    8686
    87 static bool pci_add_device(device_t *dev);
     87static int pci_add_device(device_t *dev);
    8888
    8989/** The pci bus driver's standard operations.
     
    402402                        create_pci_match_ids(dev);
    403403                       
    404                         if (!child_device_register(dev, parent)) {                             
     404                        if (EOK != child_device_register(dev, parent)) {                               
    405405                                pci_clean_resource_list(dev);                           
    406406                                clean_match_ids(&dev->match_ids);
     
    433433}
    434434
    435 static bool pci_add_device(device_t *dev)
     435static int pci_add_device(device_t *dev)
    436436{
    437437        printf(NAME ": pci_add_device\n");
     
    440440        if (NULL == bus_data) {
    441441                printf(NAME ": pci_add_device allocation failed.\n");
    442                 return false;
     442                return ENOMEM;
    443443        }       
    444444       
     
    447447                printf(NAME ": pci_add_device failed to connect to the parent's driver.\n");
    448448                delete_pci_bus_data(bus_data);
    449                 return false;
     449                return EPARTY;
    450450        }
    451451       
     
    456456                delete_pci_bus_data(bus_data);
    457457                ipc_hangup(dev->parent_phone);
    458                 return false;           
     458                return EPARTY;         
    459459        }       
    460460       
     
    472472                ipc_hangup(dev->parent_phone);
    473473                clean_hw_resource_list(&hw_resources);
    474                 return false;                                   
     474                return EADDRNOTAVAIL;                                   
    475475        }
    476476        bus_data->conf_data_port = (char *)bus_data->conf_addr_port + 4;
     
    484484        clean_hw_resource_list(&hw_resources);
    485485       
    486         return true;
     486        return EOK;
    487487}
    488488
Note: See TracChangeset for help on using the changeset viewer.