i2c: Encourage move to dev_pm_ops by warning on use of legacy methods
Subsystems (2)
PATCH 1/1 i2c: Encourage move to dev_pm_ops by warning on use of legacy methods
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.
---
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(-)
drivers/i2c/i2c-core.c +8 -0
@@ -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);
Signature · 1 line
1.7.1
A message that is not in the archive (sent off-list or not yet received): 1292881260-31987-1-git-send-email-broonie-yzvPICuk2AATkU/[email protected]
Quoted 5 lines · 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.
Quoted 7 lines
Signed-off-by Mark Brown <broonie-yzvPICuk2AATkU/[email protected]>---
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...
Signature · 3 lines
Ben Dooks, [email protected], http://www.fluff.org/ben/ Large Hadron Colada: A large Pina Colada that makes the universe disappear.
A message that is not in the archive (sent off-list or not yet received): 20101220215958.GB1126-SMNkleLxa3Z6Wcw2j4pizdi2O/[email protected]
Quoted 2 lines · Ben Dooks
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.
Quoted 2 lines
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.
Quoted 25 lines · 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/[email protected]>---
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(-)drivers/i2c/i2c-core.c +1
-0@@ -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. */
drivers/i2c/i2c-core.c int i2c_register_driver(struct module *owner, struct i2c_driver *driver) · line 1153
Quoted 10 lines
drivers/i2c/i2c-core.c +7
-0+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.
Signature · 1 line
Jean Delvare