From aad887f6641145fec2a801da2ce4ed36cf99c6a5 Mon Sep 17 00:00:00 2001 From: Jarkko Sakkinen Date: Sun, 5 Nov 2017 13:16:26 +0200 Subject: tpm: use struct tpm_chip for tpm_chip_find_get() Device number (the character device index) is not a stable identifier for a TPM chip. That is the reason why every call site passes TPM_ANY_NUM to tpm_chip_find_get(). This commit changes the API in a way that instead a struct tpm_chip instance is given and NULL means the default chip. In addition, this commit refines the documentation to be up to date with the implementation. Suggested-by: Jason Gunthorpe (@chip_num -> @chip part) Signed-off-by: Jarkko Sakkinen Reviewed-by: Jason Gunthorpe Tested-by: PrasannaKumar Muralidharan --- drivers/char/hw_random/tpm-rng.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'drivers/char/hw_random') diff --git a/drivers/char/hw_random/tpm-rng.c b/drivers/char/hw_random/tpm-rng.c index d6d448266f07..c5e363825af0 100644 --- a/drivers/char/hw_random/tpm-rng.c +++ b/drivers/char/hw_random/tpm-rng.c @@ -25,7 +25,7 @@ static int tpm_rng_read(struct hwrng *rng, void *data, size_t max, bool wait) { - return tpm_get_random(TPM_ANY_NUM, data, max); + return tpm_get_random(NULL, data, max); } static struct hwrng tpm_rng = { -- cgit v1.2.3