[prev in list] [next in list] [prev in thread] [next in thread]
List: linux-power
Subject: Re: [linux-power] Re: [Linux-pm-devel] Updated PM Scheme
From: "Stephen C. Tweedie" <sct () redhat ! com>
Date: 2001-04-23 10:14:53
[Download RAW message or body]
Hi,
On Sun, Apr 22, 2001 at 11:58:49AM -0700, Patrick Mochel wrote:
> > Well, I'd rather have a single entry point of kind "notifier" that gets
> > passed a message than several functions.
> >
> > First, it makes it easier to implement for drivers that don't need to
> > handle all of the requests (I have several examples in mind of drivers
> > that don't need the "early" call to alloc memory for example).
>
> I thought about that and decided against it, and this is why; In that
> scenario, the driver handler has a big switch statement. It either
> implements the functionality in the switch statement, or calls a function
> for each of the different messages.
You often have a lot of common code between the paths, though --- an
ide driver might do a mapping from the device struct to an ide_drive_t
before dispatching the appropriate function, for example, or might
take a set of driver locks before starting the operation. It's easier
to do that with a single notifier.
--Stephen
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic