diff options
Diffstat (limited to 'pcilib')
-rw-r--r-- | pcilib/pci.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/pcilib/pci.c b/pcilib/pci.c index 5bae8fc..5312922 100644 --- a/pcilib/pci.c +++ b/pcilib/pci.c @@ -175,17 +175,17 @@ pcilib_t *pcilib_open(const char *device, const char *model) { if (!ctx->model) ctx->model = strdup(model?model:"pci"); + if(banks){ + pcilib_xml_initialize_banks(doc,banks); + pcilib_add_register_banks(ctx,number_banks,banks); + }else pcilib_error("no memory for banks"); + if(registers){ pcilib_xml_initialize_registers(doc,registers); pcilib_xml_arrange_registers(registers,number_registers); pcilib_add_registers(ctx,number_registers,registers); }else pcilib_error("no memory for registers"); - if(banks){ - pcilib_xml_initialize_banks(doc,banks); - pcilib_add_register_banks(ctx,number_banks,banks); - }else pcilib_error("no memory for banks"); - ctx->model_info.registers = ctx->registers; ctx->model_info.banks = ctx->banks; ctx->model_info.protocols = ctx->protocols; |