diff options
Diffstat (limited to 'pcilib/pci.c')
-rw-r--r-- | pcilib/pci.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/pcilib/pci.c b/pcilib/pci.c index 512e891..6078a6e 100644 --- a/pcilib/pci.c +++ b/pcilib/pci.c @@ -108,6 +108,9 @@ pcilib_t *pcilib_open(const char *device, const char *model) { size_t i; pcilib_t *ctx = malloc(sizeof(pcilib_t)); + if (!model) + model = getenv("PCILIB_MODEL"); + if (ctx) { memset(ctx, 0, sizeof(pcilib_t)); ctx->pci_cfg_space_fd = -1; |