Changeset a1b7e80 in mainline for uspace/drv/bus/pci/pciintel/pci.c


Ignore:
Timestamp:
2011-09-02T16:54:18Z (13 years ago)
Author:
Jiri Svoboda <jiri@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
f480d7e
Parents:
7a72ce1a (diff), 224c0e7 (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 basic infrastructure for anticipated device removal from
lp:~jsvoboda/helenos/devrem

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/drv/bus/pci/pciintel/pci.c

    r7a72ce1a ra1b7e80  
    215215};
    216216
    217 static pci_bus_t *pci_bus_new(void)
    218 {
    219         pci_bus_t *bus;
    220        
    221         bus = (pci_bus_t *) calloc(1, sizeof(pci_bus_t));
    222         if (bus == NULL)
    223                 return NULL;
    224        
    225         fibril_mutex_initialize(&bus->conf_mutex);
    226         return bus;
    227 }
    228 
    229 static void pci_bus_delete(pci_bus_t *bus)
    230 {
    231         assert(bus != NULL);
    232         free(bus);
    233 }
    234 
    235217static void pci_conf_read(pci_fun_t *fun, int reg, uint8_t *buf, size_t len)
    236218{
     
    584566        dnode->parent_sess = NULL;
    585567       
    586         bus = pci_bus_new();
     568        bus = ddf_dev_data_alloc(dnode, sizeof(pci_bus_t));
    587569        if (bus == NULL) {
    588570                ddf_msg(LVL_ERROR, "pci_add_device allocation failed.");
     
    590572                goto fail;
    591573        }
     574        fibril_mutex_initialize(&bus->conf_mutex);
     575
    592576        bus->dnode = dnode;
    593577        dnode->driver_data = bus;
     
    655639       
    656640fail:
    657         if (bus != NULL)
    658                 pci_bus_delete(bus);
    659        
    660641        if (dnode->parent_sess)
    661642                async_hangup(dnode->parent_sess);
Note: See TracChangeset for help on using the changeset viewer.