mfd: Don't use I2C-specific suspend and resume operations for tps65090
Mark Brown [Mon, 7 May 2012 09:03:18 +0000 (10:03 +0100)]
The legacy suspend operations have been deprecated and printing warnings
on boot for over a year now.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Acked-by: Venu Byravarasu <vbyravarasu@nvidia.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
(Cherry-picked from mainline
b6c9eeef4e775e1fff76f4395d11638dc198271d)

Change-Id: Ia8b79787c813327fe1d1ccb5a5ad19da57f2212f
Signed-off-by: Laxman Dewangan <ldewangan@nvidia.com>
Reviewed-on: http://git-master/r/120369
(cherry picked from commit b7582d0944f6329e8eb3804fd0a53eaacefe4395)

Signed-off-by: Peter Zu <pzu@nvidia.com>
Change-Id: I844f6f7962794c52a15a498fd6f83c5b413a9984
Reviewed-on: http://git-master/r/123466
Reviewed-by: Automatic_Commit_Validation_User
Reviewed-by: Simone Willett <swillett@nvidia.com>
Tested-by: Simone Willett <swillett@nvidia.com>

drivers/mfd/tps65090.c

index ac7e8b1..6dc4c34 100644 (file)
@@ -335,21 +335,27 @@ static int __devexit tps65090_i2c_remove(struct i2c_client *client)
 }
 
 #ifdef CONFIG_PM_SLEEP
-static int tps65090_i2c_suspend(struct i2c_client *client, pm_message_t state)
+static int tps65090_suspend(struct device *dev)
 {
+       struct i2c_client *client = to_i2c_client(dev);
        if (client->irq)
                disable_irq(client->irq);
        return 0;
 }
 
-static int tps65090_i2c_resume(struct i2c_client *client)
+static int tps65090_resume(struct device *dev)
 {
+       struct i2c_client *client = to_i2c_client(dev);
        if (client->irq)
                enable_irq(client->irq);
        return 0;
 }
 #endif
 
+static const struct dev_pm_ops tps65090_pm_ops = {
+       SET_SYSTEM_SLEEP_PM_OPS(tps65090_suspend, tps65090_resume)
+};
+
 static const struct i2c_device_id tps65090_id_table[] = {
        { "tps65090", 0 },
        { },
@@ -360,13 +366,10 @@ static struct i2c_driver tps65090_driver = {
        .driver = {
                .name   = "tps65090",
                .owner  = THIS_MODULE,
+               .pm     = &tps65090_pm_ops,
        },
        .probe          = tps65090_i2c_probe,
        .remove         = __devexit_p(tps65090_i2c_remove),
-#ifdef CONFIG_PM_SLEEP
-       .suspend        = tps65090_i2c_suspend,
-       .resume         = tps65090_i2c_resume,
-#endif
        .id_table       = tps65090_id_table,
 };