summaryrefslogtreecommitdiffstats
path: root/protocols
diff options
context:
space:
mode:
authorzilio nicolas <nicolas.zilio@kit.edu>2015-06-12 19:08:55 +0200
committerzilio nicolas <nicolas.zilio@kit.edu>2015-06-12 19:08:55 +0200
commit51ec836689e0d9e2d27f2fa4579ff1088513dacf (patch)
tree617947170dd4fa735f4d5e213179e67343dd486e /protocols
parent18e672c04c6b12d51b13f4cf32b9c197245407d6 (diff)
downloadpcitool-51ec836689e0d9e2d27f2fa4579ff1088513dacf.tar.gz
pcitool-51ec836689e0d9e2d27f2fa4579ff1088513dacf.tar.bz2
pcitool-51ec836689e0d9e2d27f2fa4579ff1088513dacf.tar.xz
pcitool-51ec836689e0d9e2d27f2fa4579ff1088513dacf.zip
some modifications
Diffstat (limited to 'protocols')
-rw-r--r--protocols/software_registers.c7
1 files changed, 2 insertions, 5 deletions
diff --git a/protocols/software_registers.c b/protocols/software_registers.c
index d3c390f..68655e0 100644
--- a/protocols/software_registers.c
+++ b/protocols/software_registers.c
@@ -20,9 +20,7 @@
*/
pcilib_register_bank_context_t* pcilib_software_registers_open(pcilib_t *ctx, pcilib_register_bank_t bank,const char* model, const void *args){
pcilib_register_bank_context_t* bank_ctx;
- pcilib_register_value_t *init=NULL;
pcilib_kmem_handle_t *test;
- int i;
int j;
bank_ctx=calloc(1,sizeof(pcilib_register_bank_context_t));
@@ -35,11 +33,10 @@ pcilib_register_bank_context_t* pcilib_software_registers_open(pcilib_t *ctx, pc
bank_ctx->bank_software_register_adress=test;
}else{
bank_ctx->bank_software_register_adress=test;
- init=test;
j=0;
while(ctx->model_info.registers[j].name!=NULL){
- if(ctx->model_info.registers[j].bank==(ctx->banks + bank).addr){
- pcilib_write_register_by_id(ctx,ctx->model_info.registers[j],ctx->model_info.registers[j].defvalue);
+ if(ctx->model_info.registers[j].bank==(ctx->banks+bank)->addr){
+ pcilib_write_register_by_id(ctx,ctx->model_info.registers[j].addr,ctx->model_info.registers[j].defvalue);
}
j++;
}