diff options
Diffstat (limited to 'samples/gpio-pci-idio-16.c')
-rw-r--r-- | samples/gpio-pci-idio-16.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/samples/gpio-pci-idio-16.c b/samples/gpio-pci-idio-16.c index 419783f..6d1e6b8 100644 --- a/samples/gpio-pci-idio-16.c +++ b/samples/gpio-pci-idio-16.c @@ -99,8 +99,7 @@ main(int argc, char *argv[]) err(EXIT_FAILURE, "failed to register signal handler"); } - lm_ctx = lm_create_ctx(LM_TRANS_SOCK, argv[optind], 0, - verbose ? _log : NULL, LM_DBG, NULL); + lm_ctx = lm_create_ctx(LM_TRANS_SOCK, argv[optind], 0, NULL); if (lm_ctx == NULL) { if (errno == EINTR) { printf("interrupted\n"); @@ -109,6 +108,11 @@ main(int argc, char *argv[]) err(EXIT_FAILURE, "failed to initialize device emulation"); } + ret = lm_setup_log(lm_ctx, _log, verbose ? LM_DBG : LM_ERR); + if (ret < 0) { + err(EXIT_FAILURE, "failed to setup log"); + } + ret = lm_pci_setup_config_hdr(lm_ctx, id, ss, cc, false); if (ret < 0) { fprintf(stderr, "failed to setup pci header\n"); |