summaryrefslogtreecommitdiffstats
path: root/views
diff options
context:
space:
mode:
authorSuren A. Chilingaryan <csa@suren.me>2016-03-03 00:50:59 +0100
committerSuren A. Chilingaryan <csa@suren.me>2016-03-03 00:50:59 +0100
commit195c28f3074486165b6e0935362810f8a1fb9531 (patch)
tree56aecf261aaae57e28c08cef573ae6642ec5394d /views
parent1e53d2d17e611586030e3ff3e9ab87e5bb753c9b (diff)
downloadpcitool-195c28f3074486165b6e0935362810f8a1fb9531.tar.gz
pcitool-195c28f3074486165b6e0935362810f8a1fb9531.tar.bz2
pcitool-195c28f3074486165b6e0935362810f8a1fb9531.tar.xz
pcitool-195c28f3074486165b6e0935362810f8a1fb9531.zip
Make Python problems non-fatal
Diffstat (limited to 'views')
-rw-r--r--views/transform.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/views/transform.c b/views/transform.c
index 25f30d1..3aa3b2b 100644
--- a/views/transform.c
+++ b/views/transform.c
@@ -18,7 +18,7 @@ static pcilib_view_context_t * pcilib_transform_view_init(pcilib_t *ctx, pcilib_
pcilib_view_context_t *view_ctx;
pcilib_transform_view_description_t *v = (pcilib_transform_view_description_t*)(ctx->views[view]);
- if(v->script) {
+ if (v->script) {
pcilib_access_mode_t mode = 0;
err = pcilib_py_load_script(ctx, v->script);
@@ -39,11 +39,13 @@ static pcilib_view_context_t * pcilib_transform_view_init(pcilib_t *ctx, pcilib_
if (!v->read_from_reg) v->read_from_reg = "read_from_register";
if (!v->write_to_reg) v->write_to_reg = "write_to_register";
+ } else if (!ctx->py) {
+ v->base.mode &= (~PCILIB_REGISTER_RW);
}
-
+
view_ctx = (pcilib_view_context_t*)malloc(sizeof(pcilib_view_context_t));
if (view_ctx) memset(view_ctx, 0, sizeof(pcilib_view_context_t));
-
+
return view_ctx;
}