Skip to content

Commit b9736a1

Browse files
broonieLee Jones
authored andcommitted
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>
1 parent ed83d30 commit b9736a1

2 files changed

Lines changed: 10 additions & 6 deletions

File tree

‎drivers/mfd/wm831x-i2c.c‎

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -64,11 +64,13 @@ static int wm831x_i2c_suspend(struct device *dev)
6464
return wm831x_device_suspend(wm831x);
6565
}
6666

67-
static void wm831x_i2c_shutdown(struct i2c_client *i2c)
67+
static int wm831x_i2c_poweroff(struct device *dev)
6868
{
69-
struct wm831x *wm831x = i2c_get_clientdata(i2c);
69+
struct wm831x *wm831x = dev_get_drvdata(dev);
7070

7171
wm831x_device_shutdown(wm831x);
72+
73+
return 0;
7274
}
7375

7476
static const struct i2c_device_id wm831x_i2c_id[] = {
@@ -85,6 +87,7 @@ MODULE_DEVICE_TABLE(i2c, wm831x_i2c_id);
8587

8688
static const struct dev_pm_ops wm831x_pm_ops = {
8789
.suspend = wm831x_i2c_suspend,
90+
.poweroff = wm831x_i2c_poweroff,
8891
};
8992

9093
static struct i2c_driver wm831x_i2c_driver = {
@@ -95,7 +98,6 @@ static struct i2c_driver wm831x_i2c_driver = {
9598
},
9699
.probe = wm831x_i2c_probe,
97100
.remove = wm831x_i2c_remove,
98-
.shutdown = wm831x_i2c_shutdown,
99101
.id_table = wm831x_i2c_id,
100102
};
101103

‎drivers/mfd/wm831x-spi.c‎

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -66,16 +66,19 @@ static int wm831x_spi_suspend(struct device *dev)
6666
return wm831x_device_suspend(wm831x);
6767
}
6868

69-
static void wm831x_spi_shutdown(struct spi_device *spi)
69+
static int wm831x_spi_poweroff(struct device *dev)
7070
{
71-
struct wm831x *wm831x = spi_get_drvdata(spi);
71+
struct wm831x *wm831x = dev_get_drvdata(dev);
7272

7373
wm831x_device_shutdown(wm831x);
74+
75+
return 0;
7476
}
7577

7678
static const struct dev_pm_ops wm831x_spi_pm = {
7779
.freeze = wm831x_spi_suspend,
7880
.suspend = wm831x_spi_suspend,
81+
.poweroff = wm831x_spi_poweroff,
7982
};
8083

8184
static const struct spi_device_id wm831x_spi_ids[] = {
@@ -99,7 +102,6 @@ static struct spi_driver wm831x_spi_driver = {
99102
.id_table = wm831x_spi_ids,
100103
.probe = wm831x_spi_probe,
101104
.remove = wm831x_spi_remove,
102-
.shutdown = wm831x_spi_shutdown,
103105
};
104106

105107
static int __init wm831x_spi_init(void)

0 commit comments

Comments
 (0)