Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1311328

Re: [PATCH] driver-core: platform: automatically mark wakeup devices

From Dmitry Torokhov <dmitry.torokhov@gmail.com>
Newsgroups linux.kernel
Subject Re: [PATCH] driver-core: platform: automatically mark wakeup devices
Date 2016-01-18 07:20 +0100
Message-ID <qSbkt-58S-1@gated-at.bofh.it> (permalink)
References <qS7Ad-2zb-3@gated-at.bofh.it> <qSaop-4qZ-1@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


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

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH] driver-core: platform: automatically mark wakeup devices Dmitry Torokhov <dmitry.torokhov@gmail.com> - 2016-01-18 03:20 +0100
  Re: [PATCH] driver-core: platform: automatically mark wakeup devices Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2016-01-18 06:20 +0100
    Re: [PATCH] driver-core: platform: automatically mark wakeup devices Dmitry Torokhov <dmitry.torokhov@gmail.com> - 2016-01-18 07:20 +0100
      Re: [PATCH] driver-core: platform: automatically mark wakeup devices Sudeep Holla <sudeep.holla@arm.com> - 2016-01-18 16:40 +0100
  Re: [PATCH] driver-core: platform: automatically mark wakeup devices "Rafael J. Wysocki" <rjw@rjwysocki.net> - 2016-01-18 15:50 +0100
    Re: [PATCH] driver-core: platform: automatically mark wakeup devices Sudeep Holla <sudeep.holla@arm.com> - 2016-01-18 16:30 +0100
      Re: [PATCH] driver-core: platform: automatically mark wakeup devices "Rafael J. Wysocki" <rjw@rjwysocki.net> - 2016-01-18 16:50 +0100
        Re: [PATCH] driver-core: platform: automatically mark wakeup devices Sudeep Holla <sudeep.holla@arm.com> - 2016-01-18 17:00 +0100
          Re: [PATCH] driver-core: platform: automatically mark wakeup devices "Rafael J. Wysocki" <rafael@kernel.org> - 2016-01-18 18:10 +0100
    Re: [PATCH] driver-core: platform: automatically mark wakeup devices Dmitry Torokhov <dmitry.torokhov@gmail.com> - 2016-01-18 17:30 +0100
      Re: [PATCH] driver-core: platform: automatically mark wakeup devices "Rafael J. Wysocki" <rafael@kernel.org> - 2016-01-18 18:20 +0100
        Re: [PATCH] driver-core: platform: automatically mark wakeup devices Dmitry Torokhov <dmitry.torokhov@gmail.com> - 2016-01-18 19:00 +0100
          Re: [PATCH] driver-core: platform: automatically mark wakeup devices "Rafael J. Wysocki" <rafael@kernel.org> - 2016-01-18 23:20 +0100
            Re: [PATCH] driver-core: platform: automatically mark wakeup devices Dmitry Torokhov <dmitry.torokhov@gmail.com> - 2016-01-20 02:00 +0100
              Re: [PATCH] driver-core: platform: automatically mark wakeup devices "Rafael J. Wysocki" <rafael@kernel.org> - 2016-01-20 03:50 +0100
                Re: [PATCH] driver-core: platform: automatically mark wakeup devices "Rafael J. Wysocki" <rafael@kernel.org> - 2016-01-20 15:00 +0100
                Re: [PATCH] driver-core: platform: automatically mark wakeup devices "Rafael J. Wysocki" <rafael@kernel.org> - 2016-01-21 00:10 +0100
                Re: [PATCH] driver-core: platform: automatically mark wakeup devices Dmitry Torokhov <dmitry.torokhov@gmail.com> - 2016-01-21 01:30 +0100
                Re: [PATCH] driver-core: platform: automatically mark wakeup devices "Rafael J. Wysocki" <rafael@kernel.org> - 2016-01-26 17:50 +0100

csiph-web