From c4f209458c5caa00f8d67033224458c78c374adc Mon Sep 17 00:00:00 2001 From: zilio nicolas Date: Fri, 3 Jul 2015 18:03:53 +0200 Subject: modified pci to put banks before registers --- pcilib/pci.c | 10 +++++----- 1 file 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; -- cgit v1.2.3