On Sun, 13 Jan 2008, Michael Buesch wrote: > > Besides, if you're going to register the device right back again during > > the subsequent resume, then why go to the trouble of unregistering it > > during suspend? Why not just leave it registered the whole time and > > avoid all the complication (and excess meaningless uevents)? > > Well, because not doing it complicates code :) > Currently suspend/resume calls the same code as init/exit. > The b43 init/exit code is really complicated, compared to other > drivers, due to dozens of hardware versions. So I just avoided > having yet other codepaths for suspend/resume. But I will add > a flag to the device structure that's used to avoid unregistering stuff. Instead of adding an extra flag you should refactor the code. Have a common "enable" subroutine that can be called for both init and resume, and a common "disable" subroutine that can be called for both exit and suspend. Then the method routines themselves will contain only the portions unique to their particular functions, making them shorter and simpler. Alan Stern _______________________________________________ linux-pm mailing list linux-pm@xxxxxxxxxxxxxxxxxxxxxxxxxx https://lists.linux-foundation.org/mailman/listinfo/linux-pm