Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

mfd: Convert WM831x away from legacy I2C PM operations

Since the legacy bus PM operations are deprecated move the suspend
method over to dev_pm_ops.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>

authored by

Mark Brown and committed by
Samuel Ortiz
c538ddbe 735a3d9e

+8 -5
+8 -5
drivers/mfd/wm831x-i2c.c
··· 94 94 return 0; 95 95 } 96 96 97 - static int wm831x_i2c_suspend(struct i2c_client *i2c, pm_message_t mesg) 97 + static int wm831x_i2c_suspend(struct device *dev) 98 98 { 99 - struct wm831x *wm831x = i2c_get_clientdata(i2c); 99 + struct wm831x *wm831x = dev_get_drvdata(dev); 100 100 101 101 return wm831x_device_suspend(wm831x); 102 102 } ··· 113 113 }; 114 114 MODULE_DEVICE_TABLE(i2c, wm831x_i2c_id); 115 115 116 + static const struct dev_pm_ops wm831x_pm_ops = { 117 + .suspend = wm831x_i2c_suspend, 118 + }; 116 119 117 120 static struct i2c_driver wm831x_i2c_driver = { 118 121 .driver = { 119 - .name = "wm831x", 120 - .owner = THIS_MODULE, 122 + .name = "wm831x", 123 + .owner = THIS_MODULE, 124 + .pm = &wm831x_pm_ops, 121 125 }, 122 126 .probe = wm831x_i2c_probe, 123 127 .remove = wm831x_i2c_remove, 124 - .suspend = wm831x_i2c_suspend, 125 128 .id_table = wm831x_i2c_id, 126 129 }; 127 130