Commit 37f4915f authored by Matthew Wilcox's avatar Matthew Wilcox Committed by Linus Torvalds

tpm: use idr_find(), not idr_find_slowpath()

idr_find_slowpath() is not intended to be part of the public API, it's
an implementation detail.  There's no reason to skip straight to the
slowpath here.

Link: http://lkml.kernel.org/r/1480369871-5271-64-git-send-email-mawilcox@linuxonhyperv.comSigned-off-by: default avatarMatthew Wilcox <mawilcox@microsoft.com>
Tested-by: default avatarKirill A. Shutemov <kirill.shutemov@linux.intel.com>
Cc: Konstantin Khlebnikov <koct9i@gmail.com>
Cc: Ross Zwisler <ross.zwisler@linux.intel.com>
Cc: Peter Huewe <peterhuewe@gmx.de>
Cc: Marcel Selhorst <tpmdd@selhorst.net>
Cc: Jarkko Sakkinen <jarkko.sakkinen@linux.intel.com>
Cc: Jason Gunthorpe <jgunthorpe@obsidianresearch.com>
Cc: Matthew Wilcox <mawilcox@microsoft.com>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent 99c49407
...@@ -84,7 +84,7 @@ EXPORT_SYMBOL_GPL(tpm_put_ops); ...@@ -84,7 +84,7 @@ EXPORT_SYMBOL_GPL(tpm_put_ops);
* *
* The return'd chip has been tpm_try_get_ops'd and must be released via * The return'd chip has been tpm_try_get_ops'd and must be released via
* tpm_put_ops * tpm_put_ops
*/ */
struct tpm_chip *tpm_chip_find_get(int chip_num) struct tpm_chip *tpm_chip_find_get(int chip_num)
{ {
struct tpm_chip *chip, *res = NULL; struct tpm_chip *chip, *res = NULL;
...@@ -103,7 +103,7 @@ struct tpm_chip *tpm_chip_find_get(int chip_num) ...@@ -103,7 +103,7 @@ struct tpm_chip *tpm_chip_find_get(int chip_num)
} }
} while (chip_prev != chip_num); } while (chip_prev != chip_num);
} else { } else {
chip = idr_find_slowpath(&dev_nums_idr, chip_num); chip = idr_find(&dev_nums_idr, chip_num);
if (chip && !tpm_try_get_ops(chip)) if (chip && !tpm_try_get_ops(chip))
res = chip; res = chip;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment