* [PATCH] i2c: Encourage move to dev_pm_ops by warning on use of legacy methods @ 2010-12-20 21:41 Mark Brown [not found] ` <1292881260-31987-1-git-send-email-broonie-yzvPICuk2AATkU/dhu1WVueM+bqZidxxQQ4Iyu8u01E@public.gmane.org> 0 siblings, 1 reply; 4+ messages in thread From: Mark Brown @ 2010-12-20 21:41 UTC (permalink / raw) To: Jean Delvare, Ben Dooks Cc: linux-i2c-u79uwXL29TY76Z2rM5mHXA, Rafael J. Wysocki, Mark Brown Since the PM core wishes to transition away from the legacy suspend and resume methods and since removing them makes using PM core features like runtime PM much easier start warning when a driver is registered using the legacy methods. Signed-off-by: Mark Brown <broonie-yzvPICuk2AATkU/dhu1WVueM+bqZidxxQQ4Iyu8u01E@public.gmane.org> --- Clearly this is going to generate reams of warnings when lots of stuff is built in - I'm willing to work on fixing up drivers - so it should only be applied after the next merge window to give a chance for an active effort at migrating drivers before we spam everyone's logs. drivers/i2c/i2c-core.c | 8 ++++++++ 1 files changed, 8 insertions(+), 0 deletions(-) diff --git a/drivers/i2c/i2c-core.c b/drivers/i2c/i2c-core.c index 6b4cc56..8cd82f4 100644 --- a/drivers/i2c/i2c-core.c +++ b/drivers/i2c/i2c-core.c @@ -1140,6 +1140,14 @@ int i2c_register_driver(struct module *owner, struct i2c_driver *driver) if (res) return res; + /* Drivers should switch to dev_pm_ops instead. */ + if (driver->suspend) + pr_warn("i2c-core: driver [%s] using legacy suspend method\n", + driver->driver.name); + if (driver->resume) + pr_warn("i2c-core: driver [%s] using legacy resume method\n", + driver->driver.name); + pr_debug("i2c-core: driver [%s] registered\n", driver->driver.name); INIT_LIST_HEAD(&driver->clients); -- 1.7.1 ^ permalink raw reply related [flat|nested] 4+ messages in thread
[parent not found: <1292881260-31987-1-git-send-email-broonie-yzvPICuk2AATkU/dhu1WVueM+bqZidxxQQ4Iyu8u01E@public.gmane.org>]
* Re: [PATCH] i2c: Encourage move to dev_pm_ops by warning on use of legacy methods [not found] ` <1292881260-31987-1-git-send-email-broonie-yzvPICuk2AATkU/dhu1WVueM+bqZidxxQQ4Iyu8u01E@public.gmane.org> @ 2010-12-20 21:59 ` Ben Dooks [not found] ` <20101220215958.GB1126-SMNkleLxa3Z6Wcw2j4pizdi2O/JbrIOy@public.gmane.org> 2011-01-13 20:14 ` Jean Delvare 1 sibling, 1 reply; 4+ messages in thread From: Ben Dooks @ 2010-12-20 21:59 UTC (permalink / raw) To: Mark Brown Cc: Jean Delvare, Ben Dooks, linux-i2c-u79uwXL29TY76Z2rM5mHXA, Rafael J. Wysocki On Mon, Dec 20, 2010 at 09:41:00PM +0000, Mark Brown wrote: > Since the PM core wishes to transition away from the legacy suspend > and resume methods and since removing them makes using PM core features > like runtime PM much easier start warning when a driver is registered > using the legacy methods. > > Signed-off-by: Mark Brown <broonie-yzvPICuk2AATkU/dhu1WVueM+bqZidxxQQ4Iyu8u01E@public.gmane.org> > --- > > Clearly this is going to generate reams of warnings when lots of stuff > is built in - I'm willing to work on fixing up drivers - so it should > only be applied after the next merge window to give a chance for an > active effort at migrating drivers before we spam everyone's logs. Ok, it'll generate warnings at load-time, maybe move it to when the drive is actually bound to a device? Otherwise looks ok to me. I'll look at pm-ops for the bus drivers after christmas, once the pre-emptive house spring-clean has finished... -- Ben Dooks, ben-elnMNo+KYs3YtjvyW6yDsg@public.gmane.org, http://www.fluff.org/ben/ Large Hadron Colada: A large Pina Colada that makes the universe disappear. ^ permalink raw reply [flat|nested] 4+ messages in thread
[parent not found: <20101220215958.GB1126-SMNkleLxa3Z6Wcw2j4pizdi2O/JbrIOy@public.gmane.org>]
* Re: [PATCH] i2c: Encourage move to dev_pm_ops by warning on use of legacy methods [not found] ` <20101220215958.GB1126-SMNkleLxa3Z6Wcw2j4pizdi2O/JbrIOy@public.gmane.org> @ 2010-12-20 23:38 ` Mark Brown 0 siblings, 0 replies; 4+ messages in thread From: Mark Brown @ 2010-12-20 23:38 UTC (permalink / raw) To: Ben Dooks Cc: Jean Delvare, Ben Dooks, linux-i2c-u79uwXL29TY76Z2rM5mHXA, Rafael J. Wysocki On Mon, Dec 20, 2010 at 09:59:58PM +0000, Ben Dooks wrote: > Ok, it'll generate warnings at load-time, maybe move it to when the > drive is actually bound to a device? It struck me that this warning was more likely to trigger as you don't need to actually have the device present in a particular system, just built into or loaded into the kernel, and that it probably ought to only go off once per driver anyway. > I'll look at pm-ops for the bus drivers after christmas, once the > pre-emptive house spring-clean has finished... With the patch I sent yesterday this should now all be delegated to the PM core. ^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] i2c: Encourage move to dev_pm_ops by warning on use of legacy methods [not found] ` <1292881260-31987-1-git-send-email-broonie-yzvPICuk2AATkU/dhu1WVueM+bqZidxxQQ4Iyu8u01E@public.gmane.org> 2010-12-20 21:59 ` Ben Dooks @ 2011-01-13 20:14 ` Jean Delvare 1 sibling, 0 replies; 4+ messages in thread From: Jean Delvare @ 2011-01-13 20:14 UTC (permalink / raw) To: Mark Brown; +Cc: Ben Dooks, linux-i2c-u79uwXL29TY76Z2rM5mHXA, Rafael J. Wysocki On Mon, 20 Dec 2010 21:41:00 +0000, Mark Brown wrote: > Since the PM core wishes to transition away from the legacy suspend > and resume methods and since removing them makes using PM core features > like runtime PM much easier start warning when a driver is registered > using the legacy methods. > > Signed-off-by: Mark Brown <broonie-yzvPICuk2AATkU/dhu1WVueM+bqZidxxQQ4Iyu8u01E@public.gmane.org> > --- > > Clearly this is going to generate reams of warnings when lots of stuff > is built in - I'm willing to work on fixing up drivers - so it should > only be applied after the next merge window to give a chance for an > active effort at migrating drivers before we spam everyone's logs. > > drivers/i2c/i2c-core.c | 8 ++++++++ > 1 files changed, 8 insertions(+), 0 deletions(-) > > diff --git a/drivers/i2c/i2c-core.c b/drivers/i2c/i2c-core.c > index 6b4cc56..8cd82f4 100644 > --- a/drivers/i2c/i2c-core.c > +++ b/drivers/i2c/i2c-core.c > @@ -1140,6 +1140,14 @@ int i2c_register_driver(struct module *owner, struct i2c_driver *driver) > if (res) > return res; > > + /* Drivers should switch to dev_pm_ops instead. */ > + if (driver->suspend) > + pr_warn("i2c-core: driver [%s] using legacy suspend method\n", > + driver->driver.name); > + if (driver->resume) > + pr_warn("i2c-core: driver [%s] using legacy resume method\n", > + driver->driver.name); > + > pr_debug("i2c-core: driver [%s] registered\n", driver->driver.name); > > INIT_LIST_HEAD(&driver->clients); Sorry for the delay. Applied, thanks. -- Jean Delvare ^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2011-01-13 20:14 UTC | newest] Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed) -- links below jump to the message on this page -- 2010-12-20 21:41 [PATCH] i2c: Encourage move to dev_pm_ops by warning on use of legacy methods Mark Brown [not found] ` <1292881260-31987-1-git-send-email-broonie-yzvPICuk2AATkU/dhu1WVueM+bqZidxxQQ4Iyu8u01E@public.gmane.org> 2010-12-20 21:59 ` Ben Dooks [not found] ` <20101220215958.GB1126-SMNkleLxa3Z6Wcw2j4pizdi2O/JbrIOy@public.gmane.org> 2010-12-20 23:38 ` Mark Brown 2011-01-13 20:14 ` Jean Delvare
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.