aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/char/tpm/tpm-chip.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/drivers/char/tpm/tpm-chip.c b/drivers/char/tpm/tpm-chip.c
index a321bd57f3e9..9dec9f551b83 100644
--- a/drivers/char/tpm/tpm-chip.c
+++ b/drivers/char/tpm/tpm-chip.c
@@ -191,9 +191,10 @@ struct tpm_chip *tpm_chip_alloc(struct device *pdev,
191 /* get extra reference on main device to hold on 191 /* get extra reference on main device to hold on
192 * behalf of devs. This holds the chip structure 192 * behalf of devs. This holds the chip structure
193 * while cdevs is in use. The corresponding put 193 * while cdevs is in use. The corresponding put
194 * is in the tpm_devs_release 194 * is in the tpm_devs_release (TPM2 only)
195 */ 195 */
196 get_device(&chip->dev); 196 if (chip->flags & TPM_CHIP_FLAG_TPM2)
197 get_device(&chip->dev);
197 198
198 if (chip->dev_num == 0) 199 if (chip->dev_num == 0)
199 chip->dev.devt = MKDEV(MISC_MAJOR, TPM_MINOR); 200 chip->dev.devt = MKDEV(MISC_MAJOR, TPM_MINOR);