[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20170130215301.GA18997@atrey.karlin.mff.cuni.cz>
Date: Mon, 30 Jan 2017 22:53:01 +0100
From: Pavel Machek <pavel@....cz>
To: Thierry Reding <thierry.reding@...il.com>
Cc: Linus Torvalds <torvalds@...ux-foundation.org>,
Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
"Rafael J . Wysocki" <rjw@...ysocki.net>,
Sebastian Reichel <sre@...nel.org>,
Guenter Roeck <linux@...ck-us.net>, linux-pm@...r.kernel.org,
linux-kernel@...r.kernel.org
Subject: Re: [RFC 1/3] system-power: Add system power and restart framework
Hi!
> +struct system_power_chip;
> +
> +struct system_power_ops {
> + int (*restart)(struct system_power_chip *chip, enum reboot_mode mode,
> + char *cmd);
> + int (*power_off_prepare)(struct system_power_chip *chip);
> + int (*power_off)(struct system_power_chip *chip);
> +};
> +
> +struct system_power_chip {
> + const struct system_power_ops *ops;
> + struct list_head list;
> + struct device *dev;
> +};
Is it useful to have two structures? AFAICT one would do.
Do we always have struct device * to work with? IMO we have nothing
suitable for example in the ACPI case. Would void * be more suitable?
Could you convert someting (acpi?) to the new framework as
demonstration?
Pavel
--
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html
Powered by blists - more mailing lists