aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/char
diff options
context:
space:
mode:
authorRafael J. Wysocki <rjw@sisk.pl>2012-07-06 13:08:53 -0400
committerRafael J. Wysocki <rjw@sisk.pl>2012-07-10 15:36:51 -0400
commit7650572a8baa79d317ca5d37a7998593ff0767af (patch)
treea967e487ce9ff246e2c0a2bc07996ea396eef514 /drivers/char
parent156ffcb42a3b3fbebbb7f0e08e679b0954c0829c (diff)
omap-rng: Use struct dev_pm_ops for power management
Make the omap-rng driver define its PM callbacks through a struct dev_pm_ops object rather than by using legacy PM hooks in struct platform_driver. Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
Diffstat (limited to 'drivers/char')
-rw-r--r--drivers/char/hw_random/omap-rng.c13
1 files changed, 7 insertions, 6 deletions
diff --git a/drivers/char/hw_random/omap-rng.c b/drivers/char/hw_random/omap-rng.c
index 1412565c01a..d706bd0e9e8 100644
--- a/drivers/char/hw_random/omap-rng.c
+++ b/drivers/char/hw_random/omap-rng.c
@@ -162,22 +162,24 @@ static int __exit omap_rng_remove(struct platform_device *pdev)
162 162
163#ifdef CONFIG_PM 163#ifdef CONFIG_PM
164 164
165static int omap_rng_suspend(struct platform_device *pdev, pm_message_t message) 165static int omap_rng_suspend(struct device *dev)
166{ 166{
167 omap_rng_write_reg(RNG_MASK_REG, 0x0); 167 omap_rng_write_reg(RNG_MASK_REG, 0x0);
168 return 0; 168 return 0;
169} 169}
170 170
171static int omap_rng_resume(struct platform_device *pdev) 171static int omap_rng_resume(struct device *dev)
172{ 172{
173 omap_rng_write_reg(RNG_MASK_REG, 0x1); 173 omap_rng_write_reg(RNG_MASK_REG, 0x1);
174 return 0; 174 return 0;
175} 175}
176 176
177static SIMPLE_DEV_PM_OPS(omap_rng_pm, omap_rng_suspend, omap_rng_resume);
178#define OMAP_RNG_PM (&omap_rng_pm)
179
177#else 180#else
178 181
179#define omap_rng_suspend NULL 182#define OMAP_RNG_PM NULL
180#define omap_rng_resume NULL
181 183
182#endif 184#endif
183 185
@@ -188,11 +190,10 @@ static struct platform_driver omap_rng_driver = {
188 .driver = { 190 .driver = {
189 .name = "omap_rng", 191 .name = "omap_rng",
190 .owner = THIS_MODULE, 192 .owner = THIS_MODULE,
193 .pm = OMAP_RNG_PM,
191 }, 194 },
192 .probe = omap_rng_probe, 195 .probe = omap_rng_probe,
193 .remove = __exit_p(omap_rng_remove), 196 .remove = __exit_p(omap_rng_remove),
194 .suspend = omap_rng_suspend,
195 .resume = omap_rng_resume
196}; 197};
197 198
198static int __init omap_rng_init(void) 199static int __init omap_rng_init(void)