• Niklas Schnelle's avatar
    s390/pci: refactor zpci_create_device() · ba764dd7
    Niklas Schnelle authored
    Currently zpci_create_device() is only called in clp_add_pci_device()
    which allocates the memory for the struct zpci_dev being created. There
    is little separation of concerns as only both functions together can
    create a zpci_dev and the only CLP specific code in
    clp_add_pci_device() is a call to clp_query_pci_fn().
    
    Improve this by removing clp_add_pci_device() and refactor
    zpci_create_device() such that it alone creates and initializes the
    zpci_dev given the FID and Function Handle. For this we need to make
    clp_query_pci_fn() non-static. While at it remove the function handle
    parameter since we can just take that from the zpci_dev. Also move
    adding to the zpci_list to after the zdev has been fully created which
    eliminates a window where a partially initialized zdev can be found by
    get_zdev_by_fid().
    Acked-by: default avatarPierre Morel <pmorel@linux.ibm.com>
    Signed-off-by: default avatarNiklas Schnelle <schnelle@linux.ibm.com>
    Signed-off-by: default avatarVasily Gorbik <gor@linux.ibm.com>
    ba764dd7
pci_event.c 3.96 KB