All of lore.kernel.org
 help / color / mirror / Atom feed
From: Dmitry Torokhov <dmitry.torokhov@gmail.com>
To: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: "Rob Herring" <robh@kernel.org>,
	"Grant Likely" <grant.likely@linaro.org>,
	"Linus Walleij" <linus.walleij@linaro.org>,
	"Thierry Reding" <treding@nvidia.com>,
	"Uwe Kleine-König" <u.kleine-koenig@pengutronix.de>,
	linux-kernel@vger.kernel.org,
	"Rafael J. Wysocki" <rafael@kernel.org>
Subject: Re: [PATCH] driver-core: platform: automatically mark wakeup devices
Date: Sun, 17 Jan 2016 22:14:56 -0800	[thread overview]
Message-ID: <20160118061456.GA9099@dtor-ws> (raw)
In-Reply-To: <20160118051125.GA23372@kroah.com>

On Sun, Jan 17, 2016 at 09:11:25PM -0800, Greg Kroah-Hartman wrote:
> On Sun, Jan 17, 2016 at 06:11:38PM -0800, Dmitry Torokhov wrote:
> > When probing platform drivers let's check if corresponding devices have
> > "wakeup-source" property defined (either in device tree, ACPI, or static
> > platform properties) and automatically enable such devices as wakeup
> > sources for the system. This will help us standardize on the name for this
> > property and reduce amount of boilerplate code in the drivers.
> 
> How much boilerplate code can be removed?  Do you have an example patch
> of this removal for any drivers if we move this logic into the driver core?

Admittedly not a lot, a few lines. There is a couple of lines for
checking the property and calling device_init_wakeup() and also
sometimes clearing wakeup flag is the only thing that is left in
remove() method after converting to devm*. I am more interested in
standardizing on the property name and having wakeup flag cleared on
removal or probe failure, similarly how we do it for driver data in
device structure.

I do not have good patches in input at the moment as even though we are
using "wakeup-source" now lots if the drivers did not start with it and
so we have compatibility parsing still that we want to keep around. I
want the new drivers to use only this property though.

FWIW I2C bus code implements automatic parsing of this property as well
and I wonder if we want to do the same for SPI.

Thanks.

-- 
Dmitry

  reply	other threads:[~2016-01-18  6:15 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-01-18  2:11 [PATCH] driver-core: platform: automatically mark wakeup devices Dmitry Torokhov
2016-01-18  5:11 ` Greg Kroah-Hartman
2016-01-18  6:14   ` Dmitry Torokhov [this message]
2016-01-18 15:35     ` Sudeep Holla
2016-01-18 14:47 ` Rafael J. Wysocki
2016-01-18 15:23   ` Sudeep Holla
2016-01-18 15:41     ` Rafael J. Wysocki
2016-01-18 15:58       ` Sudeep Holla
2016-01-18 17:09         ` Rafael J. Wysocki
2016-01-18 16:22   ` Dmitry Torokhov
2016-01-18 17:19     ` Rafael J. Wysocki
2016-01-18 17:55       ` Dmitry Torokhov
2016-01-18 22:18         ` Rafael J. Wysocki
2016-01-20  0:45           ` Dmitry Torokhov
2016-01-20  2:40             ` Rafael J. Wysocki
2016-01-20 13:51               ` Rafael J. Wysocki
2016-01-20 23:01                 ` Rafael J. Wysocki
2016-01-21  0:23                   ` Dmitry Torokhov
2016-01-26 16:47                     ` Rafael J. Wysocki

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=20160118061456.GA9099@dtor-ws \
    --to=dmitry.torokhov@gmail.com \
    --cc=grant.likely@linaro.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=linus.walleij@linaro.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=rafael@kernel.org \
    --cc=robh@kernel.org \
    --cc=treding@nvidia.com \
    --cc=u.kleine-koenig@pengutronix.de \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.