diff options
author | Rafael J. Wysocki <rjw@sisk.pl> | 2012-07-06 13:09:13 -0400 |
---|---|---|
committer | Rafael J. Wysocki <rjw@sisk.pl> | 2012-07-10 15:37:02 -0400 |
commit | 8324be05380be044df8b70cb4bfb0c0b50eec3e5 (patch) | |
tree | 0a24c5ab2c8893bbf532055580f4e72f35ff59a1 /drivers/char | |
parent | 035e2ce8eb7412dbcb8522c19676a1dd52f3c024 (diff) |
tpm_atmel: Use struct dev_pm_ops for power management
Make the tpm_atmel driver define its PM callbacks through
a struct dev_pm_ops object rather than by using legacy PM hooks
in struct platform_driver.
This allows the driver to use tpm_pm_suspend() and tpm_pm_resume()
as its PM callbacks directly, without defining its own PM callback
routines.
Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
Diffstat (limited to 'drivers/char')
-rw-r--r-- | drivers/char/tpm/tpm_atmel.c | 12 |
1 files changed, 2 insertions, 10 deletions
diff --git a/drivers/char/tpm/tpm_atmel.c b/drivers/char/tpm/tpm_atmel.c index 8244d87f86aa..678d57019dc4 100644 --- a/drivers/char/tpm/tpm_atmel.c +++ b/drivers/char/tpm/tpm_atmel.c | |||
@@ -168,22 +168,14 @@ static void atml_plat_remove(void) | |||
168 | } | 168 | } |
169 | } | 169 | } |
170 | 170 | ||
171 | static int tpm_atml_suspend(struct platform_device *dev, pm_message_t msg) | 171 | static SIMPLE_DEV_PM_OPS(tpm_atml_pm, tpm_pm_suspend, tpm_pm_resume); |
172 | { | ||
173 | return tpm_pm_suspend(&dev->dev); | ||
174 | } | ||
175 | 172 | ||
176 | static int tpm_atml_resume(struct platform_device *dev) | ||
177 | { | ||
178 | return tpm_pm_resume(&dev->dev); | ||
179 | } | ||
180 | static struct platform_driver atml_drv = { | 173 | static struct platform_driver atml_drv = { |
181 | .driver = { | 174 | .driver = { |
182 | .name = "tpm_atmel", | 175 | .name = "tpm_atmel", |
183 | .owner = THIS_MODULE, | 176 | .owner = THIS_MODULE, |
177 | .pm = &tpm_atml_pm, | ||
184 | }, | 178 | }, |
185 | .suspend = tpm_atml_suspend, | ||
186 | .resume = tpm_atml_resume, | ||
187 | }; | 179 | }; |
188 | 180 | ||
189 | static int __init init_atmel(void) | 181 | static int __init init_atmel(void) |