tpm_try_get_ops(9)
π tpm_try_get_ops π
okay so welcome to the tpm_try_get_ops(9) page of the Kernel API Manual β¨ this is the one that grabs you a ref to the tpm_chip, and honestly? it's giving gatekeeper-with-a-good-reason π
πΈ NAME πΈ
tpm_try_get_ops β Get a ref to the tpm_chip π«Ά
β¨ SYNOPSIS β¨
int tpm_try_get_ops (struct tpm_chip *chip );
π ARGUMENTS π
chipβ the Chip to ref. that's the one, bestie π
π¦ DESCRIPTION π¦
okay so before you even breathe on this function, the caller must already have some kind of locking to ensure that chip is valid β like, this is not the function's job, it is yours, no cap π
Once you're in, this function will lock the chip so that the ops member can be accessed safely π₯ the locking is doing main character work here: it prevents tpm_chip_unregister from completing, so it should not be held for long periods β like, get in, do your little ops thing, get out, periodt π
Returns -ERRNO if the chip could not be got π
lowkey important: that unregister-blocking thing is real β don't sit on this lock, bestie π«Ά
π SEE ALSO π
Kernel file ./drivers/char/tpm/tpm-chip.c plus the whole friend group:
tpm_chip_start(9)tpm_chip_stop(9)tpm_put_ops(9)tpm_default_chip(9)tpm_dev_release(9)tpm_class_shutdown(9)tpm_chip_alloc(9)tpmm_chip_alloc(9)
π that's the whole vibe!! this lil page lives in ./drivers/char/tpm, dated October 2026, and it's literally titled tpm_try_get_ops(9) β slay, go ref that chip responsibly ππ§ββοΈ
π¦ where this page comes from
- nixpkgs unstable: linux-manual 7.3.1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms