diff options
author | Vasilii Chernov <vchernov@inr.ru> | 2016-03-02 10:28:04 +0100 |
---|---|---|
committer | Vasilii Chernov <vchernov@inr.ru> | 2016-03-02 10:28:04 +0100 |
commit | 8e7c95957ee73d6c11ef28f7c0e2319a11103783 (patch) | |
tree | 83df220932b3d88e071eda4c756e485dd48d50e9 /pcilib/pci.c | |
parent | 8719b84a95805d109e21c20f05a0164315e1b38a (diff) | |
parent | 867bddcf7be374221a04b7ae89f93a5f5d703ee6 (diff) | |
download | pcitool-8e7c95957ee73d6c11ef28f7c0e2319a11103783.tar.gz pcitool-8e7c95957ee73d6c11ef28f7c0e2319a11103783.tar.bz2 pcitool-8e7c95957ee73d6c11ef28f7c0e2319a11103783.tar.xz pcitool-8e7c95957ee73d6c11ef28f7c0e2319a11103783.zip |
Merge with http://ufo.kit.edu/ufo/log/csa/pcitool 362 revision
Diffstat (limited to 'pcilib/pci.c')
-rw-r--r-- | pcilib/pci.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/pcilib/pci.c b/pcilib/pci.c index 19165ba..ec40c95 100644 --- a/pcilib/pci.c +++ b/pcilib/pci.c @@ -131,7 +131,7 @@ pcilib_t *pcilib_open(const char *device, const char *model) { return NULL; } - ctx->page_mask = (uintptr_t)-1; + ctx->page_mask = pcilib_get_page_mask(); if ((model)&&(!strcasecmp(model, "maintenance"))) { ctx->model = strdup("maintenance"); @@ -271,14 +271,14 @@ const pcilib_driver_version_t *pcilib_get_driver_version(pcilib_t *ctx) { const pcilib_board_info_t *pcilib_get_board_info(pcilib_t *ctx) { int ret; - if (ctx->page_mask == (uintptr_t)-1) { + if (!ctx->board_info_ready) { ret = ioctl( ctx->handle, PCIDRIVER_IOC_PCI_INFO, &ctx->board_info ); if (ret) { pcilib_error("PCIDRIVER_IOC_PCI_INFO ioctl have failed"); return NULL; } - ctx->page_mask = pcilib_get_page_mask(); + ctx->board_info_ready = 1; } return &ctx->board_info; |