On Fri, May 05, 2017 at 03:39:01PM -0700, Josh Zimmerman wrote:

> I've seen some reference to the existing `suspend` method as being
> legacy. e.g., drivers/base/power/main.c:__device_suspend:

I think this is because class->pm is the modern way to do
class->suspend, not because class methods are legacy.

> In addition, it's not clear to me that the tpm codebase is using
> class->suspend right now; it looks like for the most part each
> device

Yes, but that doesn't mean this is the right way to do things, it just
means this old code hasn't really been updated. The tpm subsystem was
a total mess just a few years ago, not everything is cleaned up yet..

eg it would probably make much more sense to hook class->pm to do
tpm_pm_suspend rather than have each driver include the same
STATIC_DEV_PM_OPS.

> Is there some reason a similar approach of having each driver type
> register its own shutdown function pointer (that might just all be the
> same function, much like tpm_pm_suspend) would not be acceptable?

Now that we have so many tpm drivers it is a very good idea not to
introduce boilerplate into every driver, we should be going the other
way :)

Jason

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
tpmdd-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/tpmdd-devel

Reply via email to