• Juergen Gross's avatar
    xen/pcifront: move xenstore config scanning into sub-function · 2849752f
    Juergen Gross authored
    pcifront_try_connect() and pcifront_attach_devices() share a large
    chunk of duplicated code for reading the config information from
    Xenstore, which only differs regarding calling pcifront_rescan_root()
    or pcifront_scan_root().
    
    Put that code into a new sub-function. It is fine to always call
    pcifront_rescan_root() from that common function, as it will fallback
    to pcifront_scan_root() if the domain/bus combination isn't known
    yet (and pcifront_scan_root() should never be called for an already
    known domain/bus combination anyway). In order to avoid duplicate
    messages for the fallback case move the check for domain/bus not known
    to the beginning of pcifront_rescan_root().
    
    While at it fix the error reporting in case the root-xx node had the
    wrong format.
    
    As the return value of pcifront_try_connect() and
    pcifront_attach_devices() are not used anywhere make those functions
    return void. As an additional bonus this removes the dubious return
    of -EFAULT in case of an unexpected driver state.
    Signed-off-by: default avatarJuergen Gross <jgross@suse.com>
    Reviewed-by: default avatarJason Andryuk <jandryuk@gmail.com>
    Signed-off-by: default avatarJuergen Gross <jgross@suse.com>
    2849752f
xen-pcifront.c 25.8 KB