From: Pavel Machek <pavel@ucw.cz>
To: Thierry Reding <thierry.reding@gmail.com>
Cc: Linus Torvalds <torvalds@linux-foundation.org>,
Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
"Rafael J . Wysocki" <rjw@rjwysocki.net>,
Sebastian Reichel <sre@kernel.org>,
Guenter Roeck <linux@roeck-us.net>,
linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [RFC 1/3] system-power: Add system power and restart framework
Date: Mon, 30 Jan 2017 22:53:01 +0100 [thread overview]
Message-ID: <20170130215301.GA18997@atrey.karlin.mff.cuni.cz> (raw)
In-Reply-To: <20170130171506.3527-2-thierry.reding@gmail.com>
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
next prev parent reply other threads:[~2017-01-30 21:53 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-01-30 17:15 [RFC 0/3] Add system power and restart framework Thierry Reding
2017-01-30 17:15 ` [RFC 1/3] system-power: " Thierry Reding
2017-01-30 21:53 ` Pavel Machek [this message]
2017-01-31 17:46 ` Thierry Reding
2017-02-01 11:13 ` Pavel Machek
2017-01-30 17:15 ` [RFC 2/3] kernel: Wire up system power framework Thierry Reding
2017-01-30 17:15 ` [RFC 3/3] PM / hibernate: Wire up system-power framework Thierry Reding
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20170130215301.GA18997@atrey.karlin.mff.cuni.cz \
--to=pavel@ucw.cz \
--cc=gregkh@linuxfoundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pm@vger.kernel.org \
--cc=linux@roeck-us.net \
--cc=rjw@rjwysocki.net \
--cc=sre@kernel.org \
--cc=thierry.reding@gmail.com \
--cc=torvalds@linux-foundation.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).