diff options
author | Suren A. Chilingaryan <csa@suren.me> | 2015-10-09 04:42:53 +0200 |
---|---|---|
committer | Suren A. Chilingaryan <csa@suren.me> | 2015-10-09 04:42:53 +0200 |
commit | f13867f64fcba24ef2cb9d726b5ee1082ac1a8b9 (patch) | |
tree | d7186eb2a2c2d2e36c05cc702eb0ab0b3c877443 /pcilib/view.c | |
parent | 3b8e32c9bbe0d909c34303da0ad36ef0ef5be852 (diff) | |
download | pcitool-f13867f64fcba24ef2cb9d726b5ee1082ac1a8b9.tar.gz pcitool-f13867f64fcba24ef2cb9d726b5ee1082ac1a8b9.tar.bz2 pcitool-f13867f64fcba24ef2cb9d726b5ee1082ac1a8b9.tar.xz pcitool-f13867f64fcba24ef2cb9d726b5ee1082ac1a8b9.zip |
Implement enum view
Diffstat (limited to 'pcilib/view.c')
-rw-r--r-- | pcilib/view.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/pcilib/view.c b/pcilib/view.c index bf312e4..e9fdab5 100644 --- a/pcilib/view.c +++ b/pcilib/view.c @@ -126,7 +126,7 @@ pcilib_view_context_t *pcilib_find_register_view_context_by_name(pcilib_t *ctx, if (!regctx->views) return NULL; for (i = 0; regctx->views[i].name; i++) { - if (strcasecmp(name, regctx->views[i].name)) { + if (!strcasecmp(name, regctx->views[i].name)) { return pcilib_find_view_context_by_name(ctx, regctx->views[i].view); } } @@ -261,7 +261,7 @@ int pcilib_read_register_view(pcilib_t *ctx, const char *bank, const char *regna pcilib_clean_value(ctx, val); - err = v->api->read_from_reg(ctx, cfg.view, ®value, val); + err = v->api->read_from_reg(ctx, cfg.view, regvalue, val); if (err) { if (regname) pcilib_error("Error (%i) computing view (%s) of register %s", err, view, regname); @@ -281,7 +281,7 @@ int pcilib_read_register_view(pcilib_t *ctx, const char *bank, const char *regna int pcilib_write_register_view(pcilib_t *ctx, const char *bank, const char *regname, const char *view, const pcilib_value_t *valarg) { int err; - pcilib_value_t val; + pcilib_value_t val = {0}; pcilib_view_description_t *v; pcilib_view_configuration_t cfg; |