/alps/pcitool

To get this branch, use:
bzr branch http://darksoft.org/webbzr/alps/pcitool

« back to all changes in this revision

Viewing changes to pcilib/bank.c

  • Committer: Suren A. Chilingaryan
  • Date: 2015-04-24 03:35:48 UTC
  • Revision ID: csa@suren.me-20150424033548-7xhacqq2s8s1t2fp
More structural changes to get ready for stand-alone event engines

Show diffs side-by-side

added added

removed removed

Lines of Context:
38
38
        
39
39
        bapi = ctx->protocols[protocol].api;
40
40
 
41
 
        if (bapi->init) 
42
 
            bank_ctx = bapi->init(ctx, ctx->num_banks_init, ctx->protocols[protocol].model, ctx->protocols[protocol].args);
43
 
        else
 
41
        if (bapi->init) {
 
42
            const char *model = ctx->protocols[protocol].model;
 
43
            if (!model) model = ctx->model;
 
44
 
 
45
            bank_ctx = bapi->init(ctx, ctx->num_banks_init, model, ctx->protocols[protocol].args);
 
46
        } else
44
47
            bank_ctx = (pcilib_register_bank_context_t*)malloc(sizeof(pcilib_register_bank_context_t));
45
48
        
46
49
        if (!bank_ctx)