From: Daniel De Graaf Date: Thu, 21 Mar 2013 20:11:20 +0000 (-0400) Subject: mini-os/tpmback: set up callbacks before enumeration X-Git-Url: http://xenbits.xensource.com/gitweb?a=commitdiff_plain;h=bea390885b684c711d83132fb2d8e3c45c4d470d;p=people%2Fliuw%2Fstubdom.git mini-os/tpmback: set up callbacks before enumeration The open/close callbacks in tpmback cannot be properly initalized in order to catch the initial enumeration events because init_tpmback clears the callbacks and then asynchronously starts the enumeration of existing tpmback devices. Fix this by passing the callbacks to init_tpmback so they can be installed before enumeration. This also removes the unused callbacks for suspend and resume. Signed-off-by: Daniel De Graaf --- diff --git a/vtpm/vtpm.c b/vtpm/vtpm.c index 71aef78..3362ea8 100644 --- a/vtpm/vtpm.c +++ b/vtpm/vtpm.c @@ -367,7 +367,7 @@ int main(int argc, char **argv) } /* Initialize devices */ - init_tpmback(); + init_tpmback(NULL, NULL); if((tpmfront_dev = init_tpmfront(NULL)) == NULL) { error("Unable to initialize tpmfront device"); goto abort_posttpmfront; diff --git a/vtpmmgr/init.c b/vtpmmgr/init.c index a158020..00dd9f3 100644 --- a/vtpmmgr/init.c +++ b/vtpmmgr/init.c @@ -462,7 +462,7 @@ TPM_RESULT vtpmmgr_init(int argc, char** argv) { } //Setup tpmback device - init_tpmback(); + init_tpmback(NULL, NULL); //Setup tpm access switch(opts.tpmdriver) {