aboutsummaryrefslogtreecommitdiff
path: root/hw/tpm
diff options
context:
space:
mode:
authorMarc-André Lureau <marcandre.lureau@redhat.com>2017-11-06 19:39:24 +0100
committerStefan Berger <stefanb@linux.vnet.ibm.com>2017-12-14 23:39:15 -0500
commitc03785440d1d949cad6fa515e456479c2ec9b212 (patch)
tree16bf23c8adbcdcd6dd0d1e51ec283241fe6866fc /hw/tpm
parent493b78303532146c8161b33e878db8af7dca3b81 (diff)
tpm-tis: use DEFINE_PROP_TPMBE
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com> Reviewed-by: Stefan Berger <stefanb@linux.vnet.ibm.com> Signed-off-by: Stefan Berger <stefanb@linux.vnet.ibm.com>
Diffstat (limited to 'hw/tpm')
-rw-r--r--hw/tpm/tpm_tis.c12
1 files changed, 2 insertions, 10 deletions
diff --git a/hw/tpm/tpm_tis.c b/hw/tpm/tpm_tis.c
index db101b61d4..97cd7f5026 100644
--- a/hw/tpm/tpm_tis.c
+++ b/hw/tpm/tpm_tis.c
@@ -86,7 +86,6 @@ typedef struct TPMState {
TPMBackendCmd cmd;
- char *backend;
TPMBackend *be_driver;
TPMVersion be_tpm_version;
} TPMState;
@@ -1053,7 +1052,7 @@ static const VMStateDescription vmstate_tpm_tis = {
static Property tpm_tis_properties[] = {
DEFINE_PROP_UINT32("irq", TPMState, irq_num, TPM_TIS_IRQ),
- DEFINE_PROP_STRING("tpmdev", TPMState, backend),
+ DEFINE_PROP_TPMBE("tpmdev", TPMState, be_driver),
DEFINE_PROP_END_OF_LIST(),
};
@@ -1066,17 +1065,10 @@ static void tpm_tis_realizefn(DeviceState *dev, Error **errp)
return;
}
- s->be_driver = qemu_find_tpm_be(s->backend);
if (!s->be_driver) {
- error_setg(errp, "backend driver with id %s could not be found",
- s->backend);
+ error_setg(errp, "'tpmdev' property is required");
return;
}
-
- if (tpm_backend_init(s->be_driver, TPM_IF(s), errp)) {
- return;
- }
-
if (s->irq_num > 15) {
error_setg(errp, "IRQ %d is outside valid range of 0 to 15",
s->irq_num);