diff options
author | Dominik Brodowski <linux@dominikbrodowski.net> | 2006-01-05 18:02:03 -0500 |
---|---|---|
committer | Dominik Brodowski <linux@dominikbrodowski.net> | 2006-01-05 18:02:03 -0500 |
commit | 8e9e793d68fcda6cc84c18cedf85ca0f91d801a8 (patch) | |
tree | 3dcceaaa676f1221e532e24106bb661143733eaf /drivers/pcmcia/cs.c | |
parent | 98e4c28b7ec390c2dad6a4c69d69629c0f7e8b10 (diff) |
[PATCH] pcmcia: merge suspend into device model
Merge the suspend and resume methods for 16-bit PCMCIA cards into the
device model -- for both runtime power management and suspend to ram/disk.
Bugfix in ds.c by Richard Purdie
Signed-Off-By: Richard Purdie <rpurdie@rpsys.net>
Signed-off-by: Dominik Brodowski <linux@dominikbrodowski.net>
Diffstat (limited to 'drivers/pcmcia/cs.c')
-rw-r--r-- | drivers/pcmcia/cs.c | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/drivers/pcmcia/cs.c b/drivers/pcmcia/cs.c index 7cf09084ef61..83d2753814c2 100644 --- a/drivers/pcmcia/cs.c +++ b/drivers/pcmcia/cs.c | |||
@@ -780,8 +780,13 @@ int pccard_reset_card(struct pcmcia_socket *skt) | |||
780 | ret = send_event(skt, CS_EVENT_RESET_REQUEST, CS_EVENT_PRI_LOW); | 780 | ret = send_event(skt, CS_EVENT_RESET_REQUEST, CS_EVENT_PRI_LOW); |
781 | if (ret == 0) { | 781 | if (ret == 0) { |
782 | send_event(skt, CS_EVENT_RESET_PHYSICAL, CS_EVENT_PRI_LOW); | 782 | send_event(skt, CS_EVENT_RESET_PHYSICAL, CS_EVENT_PRI_LOW); |
783 | if (socket_reset(skt) == CS_SUCCESS) | 783 | if (skt->callback) |
784 | skt->callback->suspend(skt); | ||
785 | if (socket_reset(skt) == CS_SUCCESS) { | ||
784 | send_event(skt, CS_EVENT_CARD_RESET, CS_EVENT_PRI_LOW); | 786 | send_event(skt, CS_EVENT_CARD_RESET, CS_EVENT_PRI_LOW); |
787 | if (skt->callback) | ||
788 | skt->callback->resume(skt); | ||
789 | } | ||
785 | } | 790 | } |
786 | 791 | ||
787 | ret = CS_SUCCESS; | 792 | ret = CS_SUCCESS; |
@@ -812,6 +817,11 @@ int pcmcia_suspend_card(struct pcmcia_socket *skt) | |||
812 | ret = CS_UNSUPPORTED_FUNCTION; | 817 | ret = CS_UNSUPPORTED_FUNCTION; |
813 | break; | 818 | break; |
814 | } | 819 | } |
820 | if (skt->callback) { | ||
821 | ret = skt->callback->suspend(skt); | ||
822 | if (ret) | ||
823 | break; | ||
824 | } | ||
815 | ret = socket_suspend(skt); | 825 | ret = socket_suspend(skt); |
816 | } while (0); | 826 | } while (0); |
817 | up(&skt->skt_sem); | 827 | up(&skt->skt_sem); |
@@ -838,6 +848,8 @@ int pcmcia_resume_card(struct pcmcia_socket *skt) | |||
838 | break; | 848 | break; |
839 | } | 849 | } |
840 | ret = socket_resume(skt); | 850 | ret = socket_resume(skt); |
851 | if (!ret && skt->callback) | ||
852 | skt->callback->resume(skt); | ||
841 | } while (0); | 853 | } while (0); |
842 | up(&skt->skt_sem); | 854 | up(&skt->skt_sem); |
843 | 855 | ||