On Wed, May 31, 2017 at 03:01:13PM -0700, Josh Zimmerman wrote:

> >> +               if (dev->class && dev->class->shutdown) {
> >> +                       if (initcall_debug)
> >> +                               dev_info(dev, "shutdown\n");
> >> +                       dev->class->shutdown(dev);
> >> +               }
> >>                 if (dev->bus && dev->bus->shutdown) {
> 
> I just looked again at this line, which I am suddenly skeptical of. Is there
> any reason to run _both_ the class and the bus or driver shutdown
> functions? In the code as-is, only the bus or the driver function will
> execute. Right now, this patch will change that behavior. I suspect I
> should just add the appropriate "else", but I'm not sure if there is
> some reason to prefer the behavior as implemented in this version of
> the patch.

Yes, I think the else should be there.

>From what I could tell, the intent is that the most generic will then
call the least generic in the proper order, eg tpm class shutdown full
should then call bus and driver shutdown, if they are defined.

This allows each step to inject some action both before and after
calling the lower level steps, and follows the same pattern used
elsewhere.

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