diff options
author | Mark Brown <broonie@opensource.wolfsonmicro.com> | 2011-02-01 06:46:12 -0500 |
---|---|---|
committer | Samuel Ortiz <sameo@linux.intel.com> | 2011-03-23 05:41:45 -0400 |
commit | 87d1906df4ecf6df0832e78e5189a39c7ea09a29 (patch) | |
tree | 4c5a0bf1431009bd10cd7014d842ef2363f273b9 /drivers/mfd/wm831x-spi.c | |
parent | 6f9f13bf9b9fabf2da2028cb7c1e732ef2efa26d (diff) |
mfd: Convert WM831x SPI to use dev_pm_ops
There is a move to deprecate bus-specific PM operations and move to
using dev_pm_ops instead in order to reduce the amount of boilerplate
code in buses and facilitiate updates to the PM core. Do this move for
the WM831x SPI driver.
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
Diffstat (limited to 'drivers/mfd/wm831x-spi.c')
-rw-r--r-- | drivers/mfd/wm831x-spi.c | 24 |
1 files changed, 15 insertions, 9 deletions
diff --git a/drivers/mfd/wm831x-spi.c b/drivers/mfd/wm831x-spi.c index 0a8f772be88c..eed8e4f7a5a1 100644 --- a/drivers/mfd/wm831x-spi.c +++ b/drivers/mfd/wm831x-spi.c | |||
@@ -14,6 +14,7 @@ | |||
14 | 14 | ||
15 | #include <linux/kernel.h> | 15 | #include <linux/kernel.h> |
16 | #include <linux/module.h> | 16 | #include <linux/module.h> |
17 | #include <linux/pm.h> | ||
17 | #include <linux/spi/spi.h> | 18 | #include <linux/spi/spi.h> |
18 | 19 | ||
19 | #include <linux/mfd/wm831x/core.h> | 20 | #include <linux/mfd/wm831x/core.h> |
@@ -113,22 +114,27 @@ static int __devexit wm831x_spi_remove(struct spi_device *spi) | |||
113 | return 0; | 114 | return 0; |
114 | } | 115 | } |
115 | 116 | ||
116 | static int wm831x_spi_suspend(struct spi_device *spi, pm_message_t m) | 117 | static int wm831x_spi_suspend(struct device *dev) |
117 | { | 118 | { |
118 | struct wm831x *wm831x = dev_get_drvdata(&spi->dev); | 119 | struct wm831x *wm831x = dev_get_drvdata(dev); |
119 | 120 | ||
120 | return wm831x_device_suspend(wm831x); | 121 | return wm831x_device_suspend(wm831x); |
121 | } | 122 | } |
122 | 123 | ||
124 | static const struct dev_pm_ops wm831x_spi_pm = { | ||
125 | .freeze = wm831x_spi_suspend, | ||
126 | .suspend = wm831x_spi_suspend, | ||
127 | }; | ||
128 | |||
123 | static struct spi_driver wm8310_spi_driver = { | 129 | static struct spi_driver wm8310_spi_driver = { |
124 | .driver = { | 130 | .driver = { |
125 | .name = "wm8310", | 131 | .name = "wm8310", |
126 | .bus = &spi_bus_type, | 132 | .bus = &spi_bus_type, |
127 | .owner = THIS_MODULE, | 133 | .owner = THIS_MODULE, |
134 | .pm = &wm831x_spi_pm, | ||
128 | }, | 135 | }, |
129 | .probe = wm831x_spi_probe, | 136 | .probe = wm831x_spi_probe, |
130 | .remove = __devexit_p(wm831x_spi_remove), | 137 | .remove = __devexit_p(wm831x_spi_remove), |
131 | .suspend = wm831x_spi_suspend, | ||
132 | }; | 138 | }; |
133 | 139 | ||
134 | static struct spi_driver wm8311_spi_driver = { | 140 | static struct spi_driver wm8311_spi_driver = { |
@@ -136,10 +142,10 @@ static struct spi_driver wm8311_spi_driver = { | |||
136 | .name = "wm8311", | 142 | .name = "wm8311", |
137 | .bus = &spi_bus_type, | 143 | .bus = &spi_bus_type, |
138 | .owner = THIS_MODULE, | 144 | .owner = THIS_MODULE, |
145 | .pm = &wm831x_spi_pm, | ||
139 | }, | 146 | }, |
140 | .probe = wm831x_spi_probe, | 147 | .probe = wm831x_spi_probe, |
141 | .remove = __devexit_p(wm831x_spi_remove), | 148 | .remove = __devexit_p(wm831x_spi_remove), |
142 | .suspend = wm831x_spi_suspend, | ||
143 | }; | 149 | }; |
144 | 150 | ||
145 | static struct spi_driver wm8312_spi_driver = { | 151 | static struct spi_driver wm8312_spi_driver = { |
@@ -147,10 +153,10 @@ static struct spi_driver wm8312_spi_driver = { | |||
147 | .name = "wm8312", | 153 | .name = "wm8312", |
148 | .bus = &spi_bus_type, | 154 | .bus = &spi_bus_type, |
149 | .owner = THIS_MODULE, | 155 | .owner = THIS_MODULE, |
156 | .pm = &wm831x_spi_pm, | ||
150 | }, | 157 | }, |
151 | .probe = wm831x_spi_probe, | 158 | .probe = wm831x_spi_probe, |
152 | .remove = __devexit_p(wm831x_spi_remove), | 159 | .remove = __devexit_p(wm831x_spi_remove), |
153 | .suspend = wm831x_spi_suspend, | ||
154 | }; | 160 | }; |
155 | 161 | ||
156 | static struct spi_driver wm8320_spi_driver = { | 162 | static struct spi_driver wm8320_spi_driver = { |
@@ -158,10 +164,10 @@ static struct spi_driver wm8320_spi_driver = { | |||
158 | .name = "wm8320", | 164 | .name = "wm8320", |
159 | .bus = &spi_bus_type, | 165 | .bus = &spi_bus_type, |
160 | .owner = THIS_MODULE, | 166 | .owner = THIS_MODULE, |
167 | .pm = &wm831x_spi_pm, | ||
161 | }, | 168 | }, |
162 | .probe = wm831x_spi_probe, | 169 | .probe = wm831x_spi_probe, |
163 | .remove = __devexit_p(wm831x_spi_remove), | 170 | .remove = __devexit_p(wm831x_spi_remove), |
164 | .suspend = wm831x_spi_suspend, | ||
165 | }; | 171 | }; |
166 | 172 | ||
167 | static struct spi_driver wm8321_spi_driver = { | 173 | static struct spi_driver wm8321_spi_driver = { |
@@ -169,10 +175,10 @@ static struct spi_driver wm8321_spi_driver = { | |||
169 | .name = "wm8321", | 175 | .name = "wm8321", |
170 | .bus = &spi_bus_type, | 176 | .bus = &spi_bus_type, |
171 | .owner = THIS_MODULE, | 177 | .owner = THIS_MODULE, |
178 | .pm = &wm831x_spi_pm, | ||
172 | }, | 179 | }, |
173 | .probe = wm831x_spi_probe, | 180 | .probe = wm831x_spi_probe, |
174 | .remove = __devexit_p(wm831x_spi_remove), | 181 | .remove = __devexit_p(wm831x_spi_remove), |
175 | .suspend = wm831x_spi_suspend, | ||
176 | }; | 182 | }; |
177 | 183 | ||
178 | static struct spi_driver wm8325_spi_driver = { | 184 | static struct spi_driver wm8325_spi_driver = { |
@@ -180,10 +186,10 @@ static struct spi_driver wm8325_spi_driver = { | |||
180 | .name = "wm8325", | 186 | .name = "wm8325", |
181 | .bus = &spi_bus_type, | 187 | .bus = &spi_bus_type, |
182 | .owner = THIS_MODULE, | 188 | .owner = THIS_MODULE, |
189 | .pm = &wm831x_spi_pm, | ||
183 | }, | 190 | }, |
184 | .probe = wm831x_spi_probe, | 191 | .probe = wm831x_spi_probe, |
185 | .remove = __devexit_p(wm831x_spi_remove), | 192 | .remove = __devexit_p(wm831x_spi_remove), |
186 | .suspend = wm831x_spi_suspend, | ||
187 | }; | 193 | }; |
188 | 194 | ||
189 | static struct spi_driver wm8326_spi_driver = { | 195 | static struct spi_driver wm8326_spi_driver = { |
@@ -191,10 +197,10 @@ static struct spi_driver wm8326_spi_driver = { | |||
191 | .name = "wm8326", | 197 | .name = "wm8326", |
192 | .bus = &spi_bus_type, | 198 | .bus = &spi_bus_type, |
193 | .owner = THIS_MODULE, | 199 | .owner = THIS_MODULE, |
200 | .pm = &wm831x_spi_pm, | ||
194 | }, | 201 | }, |
195 | .probe = wm831x_spi_probe, | 202 | .probe = wm831x_spi_probe, |
196 | .remove = __devexit_p(wm831x_spi_remove), | 203 | .remove = __devexit_p(wm831x_spi_remove), |
197 | .suspend = wm831x_spi_suspend, | ||
198 | }; | 204 | }; |
199 | 205 | ||
200 | static int __init wm831x_spi_init(void) | 206 | static int __init wm831x_spi_init(void) |