Commit 3e5e624b authored by Andres Salomon's avatar Andres Salomon Committed by Greg Kroah-Hartman

staging/olpc_dcon: use s/r hooks from device_driver->pm

..instead of the i2c_driver hooks.  This should silence the following
runtime warnings:

[   17.820321] i2c-core: driver [olpc_dcon] using legacy suspend method
[   17.846082] i2c-core: driver [olpc_dcon] using legacy resume method
Signed-off-by: default avatarAndres Salomon <dilinger@queued.net>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 6c98274c
...@@ -685,8 +685,9 @@ static int dcon_remove(struct i2c_client *client) ...@@ -685,8 +685,9 @@ static int dcon_remove(struct i2c_client *client)
} }
#ifdef CONFIG_PM #ifdef CONFIG_PM
static int dcon_suspend(struct i2c_client *client, pm_message_t state) static int dcon_suspend(struct device *dev)
{ {
struct i2c_client *client = to_i2c_client(dev);
struct dcon_priv *dcon = i2c_get_clientdata(client); struct dcon_priv *dcon = i2c_get_clientdata(client);
if (!dcon->asleep) { if (!dcon->asleep) {
...@@ -697,8 +698,9 @@ static int dcon_suspend(struct i2c_client *client, pm_message_t state) ...@@ -697,8 +698,9 @@ static int dcon_suspend(struct i2c_client *client, pm_message_t state)
return 0; return 0;
} }
static int dcon_resume(struct i2c_client *client) static int dcon_resume(struct device *dev)
{ {
struct i2c_client *client = to_i2c_client(dev);
struct dcon_priv *dcon = i2c_get_clientdata(client); struct dcon_priv *dcon = i2c_get_clientdata(client);
if (!dcon->asleep) { if (!dcon->asleep) {
...@@ -709,7 +711,12 @@ static int dcon_resume(struct i2c_client *client) ...@@ -709,7 +711,12 @@ static int dcon_resume(struct i2c_client *client)
return 0; return 0;
} }
#endif #else
#define dcon_suspend NULL
#define dcon_resume NULL
#endif /* CONFIG_PM */
irqreturn_t dcon_interrupt(int irq, void *id) irqreturn_t dcon_interrupt(int irq, void *id)
...@@ -753,16 +760,21 @@ irqreturn_t dcon_interrupt(int irq, void *id) ...@@ -753,16 +760,21 @@ irqreturn_t dcon_interrupt(int irq, void *id)
return IRQ_HANDLED; return IRQ_HANDLED;
} }
static const struct dev_pm_ops dcon_pm_ops = {
.suspend = dcon_suspend,
.resume = dcon_resume,
};
static const struct i2c_device_id dcon_idtable[] = { static const struct i2c_device_id dcon_idtable[] = {
{ "olpc_dcon", 0 }, { "olpc_dcon", 0 },
{ } { }
}; };
MODULE_DEVICE_TABLE(i2c, dcon_idtable); MODULE_DEVICE_TABLE(i2c, dcon_idtable);
struct i2c_driver dcon_driver = { struct i2c_driver dcon_driver = {
.driver = { .driver = {
.name = "olpc_dcon", .name = "olpc_dcon",
.pm = &dcon_pm_ops,
}, },
.class = I2C_CLASS_DDC | I2C_CLASS_HWMON, .class = I2C_CLASS_DDC | I2C_CLASS_HWMON,
.id_table = dcon_idtable, .id_table = dcon_idtable,
...@@ -770,10 +782,6 @@ struct i2c_driver dcon_driver = { ...@@ -770,10 +782,6 @@ struct i2c_driver dcon_driver = {
.remove = __devexit_p(dcon_remove), .remove = __devexit_p(dcon_remove),
.detect = dcon_detect, .detect = dcon_detect,
.address_list = normal_i2c, .address_list = normal_i2c,
#ifdef CONFIG_PM
.suspend = dcon_suspend,
.resume = dcon_resume,
#endif
}; };
static int __init olpc_dcon_init(void) static int __init olpc_dcon_init(void)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment