On Fri, 2010-11-12 at 14:11 +0000, David Howells wrote:Rename the helper to tpm_chip_find_and_module_get() solves the naming issue in a simpler and better way in my opinion.Mimi Zohar<zohar@xxxxxxxxxxxxxxxxxx> wrote:Or alternately rename the helper to tpm_chip_find_and_module_get()?
I'd make a function tpm_chip_find_put() just to wrap module_put() and thenThe module_get() is in tpm_chip_find_get(), which is just a helper.+ module_put(chip->dev->driver->owner);Where's the corresponding module_get()? I suspect this should be wrapped to
match tpm_chip_find_get().
David
(It's used this way throughout tpm.c)
place it with tpm_chip_find_get() in the sources. That makes it easier to see
what's going on.
In either case, this is really up to Rajiv (the maintainer for tpm.c
who has already acked this patch), as this usage already appears in
other places in tpm.c. There would have to be a separate patch fixing
this for all of the instances. Rajiv, your thoughts?
dave