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

mfd: wm831x: Use PM ops for shutdown

This helps move us towards removing the bus custom operations.

Acked-by: Charles Keepax <ckeepax@opensource.wolfsonmicro.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
Signed-off-by: Lee Jones <lee.jones@linaro.org>

authored by

Mark Brown and committed by
Lee Jones
b9736a16 ed83d301

+10 -6
+5 -3
drivers/mfd/wm831x-i2c.c
··· 64 64 return wm831x_device_suspend(wm831x); 65 65 } 66 66 67 - static void wm831x_i2c_shutdown(struct i2c_client *i2c) 67 + static int wm831x_i2c_poweroff(struct device *dev) 68 68 { 69 - struct wm831x *wm831x = i2c_get_clientdata(i2c); 69 + struct wm831x *wm831x = dev_get_drvdata(dev); 70 70 71 71 wm831x_device_shutdown(wm831x); 72 + 73 + return 0; 72 74 } 73 75 74 76 static const struct i2c_device_id wm831x_i2c_id[] = { ··· 87 85 88 86 static const struct dev_pm_ops wm831x_pm_ops = { 89 87 .suspend = wm831x_i2c_suspend, 88 + .poweroff = wm831x_i2c_poweroff, 90 89 }; 91 90 92 91 static struct i2c_driver wm831x_i2c_driver = { ··· 98 95 }, 99 96 .probe = wm831x_i2c_probe, 100 97 .remove = wm831x_i2c_remove, 101 - .shutdown = wm831x_i2c_shutdown, 102 98 .id_table = wm831x_i2c_id, 103 99 }; 104 100
+5 -3
drivers/mfd/wm831x-spi.c
··· 66 66 return wm831x_device_suspend(wm831x); 67 67 } 68 68 69 - static void wm831x_spi_shutdown(struct spi_device *spi) 69 + static int wm831x_spi_poweroff(struct device *dev) 70 70 { 71 - struct wm831x *wm831x = spi_get_drvdata(spi); 71 + struct wm831x *wm831x = dev_get_drvdata(dev); 72 72 73 73 wm831x_device_shutdown(wm831x); 74 + 75 + return 0; 74 76 } 75 77 76 78 static const struct dev_pm_ops wm831x_spi_pm = { 77 79 .freeze = wm831x_spi_suspend, 78 80 .suspend = wm831x_spi_suspend, 81 + .poweroff = wm831x_spi_poweroff, 79 82 }; 80 83 81 84 static const struct spi_device_id wm831x_spi_ids[] = { ··· 102 99 .id_table = wm831x_spi_ids, 103 100 .probe = wm831x_spi_probe, 104 101 .remove = wm831x_spi_remove, 105 - .shutdown = wm831x_spi_shutdown, 106 102 }; 107 103 108 104 static int __init wm831x_spi_init(void)