From mboxrd@z Thu Jan 1 00:00:00 1970 From: Pavel Machek Subject: Re: [RFC][PATCH 1/3] PM: Introduce new top level suspend and hibernation callbacks Date: Wed, 19 Mar 2008 10:15:27 +0100 Message-ID: <20080319091526.GA1938@elf.ucw.cz> References: <200803170020.55473.rjw@sisk.pl> <200803170022.30345.rjw@sisk.pl> <20080319005340.GC8298@kroah.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Content-Disposition: inline In-Reply-To: <20080319005340.GC8298@kroah.com> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: linux-pm-bounces@lists.linux-foundation.org Errors-To: linux-pm-bounces@lists.linux-foundation.org To: Greg KH Cc: LKML , ACPI Devel Maling List , pm list , Alexey Starikovskiy List-Id: linux-acpi@vger.kernel.org On Tue 2008-03-18 17:53:40, Greg KH wrote: > On Mon, Mar 17, 2008 at 12:22:29AM +0100, Rafael J. Wysocki wrote: > > From: Rafael J. Wysocki > > > > Introduce 'struct pm_ops' representing a set of suspend and > > hibernation operations for bus types, device classes and device > > types. > > Ok, I must have missed the thread describing why we need to do this, so, > why do we need to do this? What is this going to buy us in the end > after everything is changed? That was rather long thread where Linus flamed us for having everything in one "suspend" callback, selecting what to do by pm_message_t parameter. It was kind of hard to miss ;-). Pavel > > +struct pm_ops { > > +#ifdef CONFIG_PM_SLEEP > > + int (*prepare)(struct device *dev); > > + void (*complete)(struct device *dev); > > +#endif > > +#ifdef CONFIG_SUSPEND > > + int (*suspend)(struct device *dev); > > + int (*resume)(struct device *dev); > > +#endif > > +#ifdef CONFIG_HIBERNATION > > + int (*freeze)(struct device *dev); > > + int (*thaw)(struct device *dev); > > + int (*poweroff)(struct device *dev); > > + int (*quiesce)(struct device *dev); > > + int (*restore)(struct device *dev); > > + int (*recover)(struct device *dev); > > +#endif > > > Don't ifdef stuff like this, it only causes ifdefs to be needed to the > .c code as well for all places these structures are defined in > drivers/busses, right? -- (english) http://www.livejournal.com/~pavelmachek (cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html pomozte zachranit klanovicky les: http://www.ujezdskystrom.info/