diff options
author | Dominik Brodowski <linux@dominikbrodowski.net> | 2010-03-15 16:46:34 -0400 |
---|---|---|
committer | Dominik Brodowski <linux@dominikbrodowski.net> | 2010-03-24 06:00:11 -0400 |
commit | d7646f7632549124fe70fec8af834c7c1246f365 (patch) | |
tree | d69cf32f089d84f7a1d7813f7c8dd8b980170b25 /drivers/pcmcia/yenta_socket.c | |
parent | e7176a37d436a214f6a7727ea7986c654cbee8f0 (diff) |
pcmcia: use dev_pm_ops for class pcmcia_socket_class
Instead of requiring PCMCIA socket drivers to call various functions
during their (bus) resume and suspend functions, register an own
dev_pm_ops for this class. This fixes several suspend/resume bugs
seen on db1xxx-ss, and probably on some other socket drivers, too.
With regard to the asymmetry with only _noirq suspend, but split up
resume, please see bug 14334 and commit 9905d1b411946fb3 .
Signed-off-by: Dominik Brodowski <linux@dominikbrodowski.net>
Diffstat (limited to 'drivers/pcmcia/yenta_socket.c')
-rw-r--r-- | drivers/pcmcia/yenta_socket.c | 17 |
1 files changed, 2 insertions, 15 deletions
diff --git a/drivers/pcmcia/yenta_socket.c b/drivers/pcmcia/yenta_socket.c index 418988ab6edf..f19ad02374d9 100644 --- a/drivers/pcmcia/yenta_socket.c +++ b/drivers/pcmcia/yenta_socket.c | |||
@@ -1290,12 +1290,9 @@ static int yenta_dev_suspend_noirq(struct device *dev) | |||
1290 | { | 1290 | { |
1291 | struct pci_dev *pdev = to_pci_dev(dev); | 1291 | struct pci_dev *pdev = to_pci_dev(dev); |
1292 | struct yenta_socket *socket = pci_get_drvdata(pdev); | 1292 | struct yenta_socket *socket = pci_get_drvdata(pdev); |
1293 | int ret; | ||
1294 | |||
1295 | ret = pcmcia_socket_dev_suspend(dev); | ||
1296 | 1293 | ||
1297 | if (!socket) | 1294 | if (!socket) |
1298 | return ret; | 1295 | return 0; |
1299 | 1296 | ||
1300 | if (socket->type && socket->type->save_state) | 1297 | if (socket->type && socket->type->save_state) |
1301 | socket->type->save_state(socket); | 1298 | socket->type->save_state(socket); |
@@ -1312,7 +1309,7 @@ static int yenta_dev_suspend_noirq(struct device *dev) | |||
1312 | */ | 1309 | */ |
1313 | /* pci_set_power_state(dev, 3); */ | 1310 | /* pci_set_power_state(dev, 3); */ |
1314 | 1311 | ||
1315 | return ret; | 1312 | return 0; |
1316 | } | 1313 | } |
1317 | 1314 | ||
1318 | static int yenta_dev_resume_noirq(struct device *dev) | 1315 | static int yenta_dev_resume_noirq(struct device *dev) |
@@ -1336,26 +1333,16 @@ static int yenta_dev_resume_noirq(struct device *dev) | |||
1336 | if (socket->type && socket->type->restore_state) | 1333 | if (socket->type && socket->type->restore_state) |
1337 | socket->type->restore_state(socket); | 1334 | socket->type->restore_state(socket); |
1338 | 1335 | ||
1339 | pcmcia_socket_dev_early_resume(dev); | ||
1340 | return 0; | ||
1341 | } | ||
1342 | |||
1343 | static int yenta_dev_resume(struct device *dev) | ||
1344 | { | ||
1345 | pcmcia_socket_dev_late_resume(dev); | ||
1346 | return 0; | 1336 | return 0; |
1347 | } | 1337 | } |
1348 | 1338 | ||
1349 | static const struct dev_pm_ops yenta_pm_ops = { | 1339 | static const struct dev_pm_ops yenta_pm_ops = { |
1350 | .suspend_noirq = yenta_dev_suspend_noirq, | 1340 | .suspend_noirq = yenta_dev_suspend_noirq, |
1351 | .resume_noirq = yenta_dev_resume_noirq, | 1341 | .resume_noirq = yenta_dev_resume_noirq, |
1352 | .resume = yenta_dev_resume, | ||
1353 | .freeze_noirq = yenta_dev_suspend_noirq, | 1342 | .freeze_noirq = yenta_dev_suspend_noirq, |
1354 | .thaw_noirq = yenta_dev_resume_noirq, | 1343 | .thaw_noirq = yenta_dev_resume_noirq, |
1355 | .thaw = yenta_dev_resume, | ||
1356 | .poweroff_noirq = yenta_dev_suspend_noirq, | 1344 | .poweroff_noirq = yenta_dev_suspend_noirq, |
1357 | .restore_noirq = yenta_dev_resume_noirq, | 1345 | .restore_noirq = yenta_dev_resume_noirq, |
1358 | .restore = yenta_dev_resume, | ||
1359 | }; | 1346 | }; |
1360 | 1347 | ||
1361 | #define YENTA_PM_OPS (¥ta_pm_ops) | 1348 | #define YENTA_PM_OPS (¥ta_pm_ops) |