summaryrefslogtreecommitdiff
path: root/drivers/char/tpm/tpm-chip.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/char/tpm/tpm-chip.c')
-rw-r--r--drivers/char/tpm/tpm-chip.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/drivers/char/tpm/tpm-chip.c b/drivers/char/tpm/tpm-chip.c
index 836f056f7d27..d0c187269ef4 100644
--- a/drivers/char/tpm/tpm-chip.c
+++ b/drivers/char/tpm/tpm-chip.c
@@ -278,14 +278,16 @@ static void tpm_del_char_device(struct tpm_chip *chip)
static int tpm1_chip_register(struct tpm_chip *chip)
{
+ int rc;
+
if (chip->flags & TPM_CHIP_FLAG_TPM2)
return 0;
tpm_sysfs_add_device(chip);
- chip->bios_dir = tpm_bios_log_setup(dev_name(&chip->dev));
+ rc = tpm_bios_log_setup(chip);
- return 0;
+ return rc;
}
static void tpm1_chip_unregister(struct tpm_chip *chip)
@@ -293,8 +295,7 @@ static void tpm1_chip_unregister(struct tpm_chip *chip)
if (chip->flags & TPM_CHIP_FLAG_TPM2)
return;
- if (chip->bios_dir)
- tpm_bios_log_teardown(chip->bios_dir);
+ tpm_bios_log_teardown(chip);
}
static void tpm_del_legacy_sysfs(struct tpm_chip *chip)