Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

tpm: Get rid of TPM_CHIP_FLAG_REGISTERED

This is no longer necessary, all calls to tpm_chip_unregister happen
in remove() callbacks.

Signed-off-by: Jason Gunthorpe <jgunthorpe@obsidianresearch.com>
Reviewed-by: Tomas Winkler <tomas.winkler@intel.com>
Reviewed-by: Jarkko Sakkinen <jarkko.sakkinen@linux.intel.com>
Signed-off-by: Jarkko Sakkinen <jarkko.sakkinen@linux.intel.com>

authored by

Jason Gunthorpe and committed by
Jarkko Sakkinen
1a277e67 1f0f30e4

-6
-5
drivers/char/tpm/tpm-chip.c
··· 375 375 return rc; 376 376 } 377 377 378 - chip->flags |= TPM_CHIP_FLAG_REGISTERED; 379 - 380 378 rc = tpm_add_legacy_sysfs(chip); 381 379 if (rc) { 382 380 tpm_chip_unregister(chip); ··· 400 402 */ 401 403 void tpm_chip_unregister(struct tpm_chip *chip) 402 404 { 403 - if (!(chip->flags & TPM_CHIP_FLAG_REGISTERED)) 404 - return; 405 - 406 405 tpm_del_legacy_sysfs(chip); 407 406 408 407 tpm1_chip_unregister(chip);
-1
drivers/char/tpm/tpm.h
··· 139 139 #define TPM_PPI_VERSION_LEN 3 140 140 141 141 enum tpm_chip_flags { 142 - TPM_CHIP_FLAG_REGISTERED = BIT(0), 143 142 TPM_CHIP_FLAG_TPM2 = BIT(1), 144 143 TPM_CHIP_FLAG_IRQ = BIT(2), 145 144 TPM_CHIP_FLAG_VIRTUAL = BIT(3),