diff options
author | zilio nicolas <nicolas.zilio@kit.edu> | 2015-08-27 16:19:53 +0200 |
---|---|---|
committer | zilio nicolas <nicolas.zilio@kit.edu> | 2015-08-27 16:19:53 +0200 |
commit | d2ec5ac52105c526390d8a31e52a7a2c260dde80 (patch) | |
tree | 24fdf70ac477eeb913c914cecccd6704b40cf7f1 /pcilib/pci.c | |
parent | 1d3cffac722081aa8b74821a832d8cc9c58715e6 (diff) | |
download | pcitool-d2ec5ac52105c526390d8a31e52a7a2c260dde80.tar.gz pcitool-d2ec5ac52105c526390d8a31e52a7a2c260dde80.tar.bz2 pcitool-d2ec5ac52105c526390d8a31e52a7a2c260dde80.tar.xz pcitool-d2ec5ac52105c526390d8a31e52a7a2c260dde80.zip |
xml files get by model and remove of validation mode
Diffstat (limited to 'pcilib/pci.c')
-rw-r--r-- | pcilib/pci.c | 17 |
1 files changed, 6 insertions, 11 deletions
diff --git a/pcilib/pci.c b/pcilib/pci.c index 5d9fedb..03b2623 100644 --- a/pcilib/pci.c +++ b/pcilib/pci.c @@ -109,14 +109,8 @@ pcilib_t *pcilib_open(const char *device, const char *model) { size_t i; pcilib_t *ctx = malloc(sizeof(pcilib_t)); - char *xmlfile; - pcilib_xml_read_config(&xmlfile,3); - xmlDocPtr doc; - doc=pcilib_xml_getdoc(xmlfile); - - xmlXPathContextPtr context; - context=pcilib_xml_getcontext(doc); - + xmlDocPtr* docs=NULL; + if (!model) model = getenv("PCILIB_MODEL"); @@ -179,9 +173,10 @@ pcilib_t *pcilib_open(const char *device, const char *model) { if (!ctx->model) ctx->model = strdup(model?model:"pci"); - - pcilib_xml_initialize_banks(ctx,doc); - pcilib_xml_initialize_registers(ctx,doc); + + pcilib_init_xml(docs); + pcilib_xml_initialize_banks(ctx,docs); + pcilib_xml_initialize_registers(ctx,docs); ctx->model_info.registers = ctx->registers; ctx->model_info.banks = ctx->banks; |