tpm: invalid self test error message

The driver emits invalid self test error message even though the init
succeeds.

Signed-off-by: Jarkko Sakkinen <jarkko.sakkinen@linux.intel.com>
Fixes: cae8b441fc ("tpm: Factor out common startup code")
Reviewed-by: James Morris <james.l.morris@oracle.com>
This commit is contained in:
Jarkko Sakkinen 2016-09-02 02:36:58 +03:00
parent a39f44faa8
commit b7d7b28471

View File

@ -957,7 +957,7 @@ int tpm2_auto_startup(struct tpm_chip *chip)
goto out;
rc = tpm2_do_selftest(chip);
if (rc != TPM2_RC_INITIALIZE) {
if (rc != 0 && rc != TPM2_RC_INITIALIZE) {
dev_err(&chip->dev, "TPM self test failed\n");
goto out;
}
@ -974,7 +974,6 @@ int tpm2_auto_startup(struct tpm_chip *chip)
}
}
return rc;
out:
if (rc > 0)
rc = -ENODEV;