diff options
-rw-r--r-- | drivers/net/wireless/atmel_cs.c | 2 | ||||
-rw-r--r-- | drivers/net/wireless/ray_cs.c | 2 | ||||
-rw-r--r-- | drivers/net/wireless/wavelan_cs.c | 1 | ||||
-rw-r--r-- | drivers/pcmcia/ds.c | 48 | ||||
-rw-r--r-- | drivers/telephony/ixj_pcmcia.c | 1 | ||||
-rw-r--r-- | include/pcmcia/ds.h | 6 |
6 files changed, 30 insertions, 30 deletions
diff --git a/drivers/net/wireless/atmel_cs.c b/drivers/net/wireless/atmel_cs.c index 962272c1342a..d09b1472e673 100644 --- a/drivers/net/wireless/atmel_cs.c +++ b/drivers/net/wireless/atmel_cs.c | |||
@@ -220,7 +220,7 @@ do { last_fn = (fn); if ((last_ret = (ret)) != 0) goto cs_failed; } while (0) | |||
220 | static int card_present(void *arg) | 220 | static int card_present(void *arg) |
221 | { | 221 | { |
222 | struct pcmcia_device *link = (struct pcmcia_device *)arg; | 222 | struct pcmcia_device *link = (struct pcmcia_device *)arg; |
223 | if (link->state & DEV_SUSPEND) | 223 | if (link->suspended) |
224 | return 0; | 224 | return 0; |
225 | else if (link->state & DEV_PRESENT) | 225 | else if (link->state & DEV_PRESENT) |
226 | return 1; | 226 | return 1; |
diff --git a/drivers/net/wireless/ray_cs.c b/drivers/net/wireless/ray_cs.c index 8cfe9332a3c1..e3924339fabe 100644 --- a/drivers/net/wireless/ray_cs.c +++ b/drivers/net/wireless/ray_cs.c | |||
@@ -1968,7 +1968,7 @@ static irqreturn_t ray_interrupt(int irq, void *dev_id, struct pt_regs * regs) | |||
1968 | 1968 | ||
1969 | local = (ray_dev_t *)dev->priv; | 1969 | local = (ray_dev_t *)dev->priv; |
1970 | link = (struct pcmcia_device *)local->finder; | 1970 | link = (struct pcmcia_device *)local->finder; |
1971 | if ( ! (link->state & DEV_PRESENT) || link->state & DEV_SUSPEND ) { | 1971 | if ( ! (link->state & DEV_PRESENT) || link->suspended ) { |
1972 | DEBUG(2,"ray_cs interrupt from device not present or suspended.\n"); | 1972 | DEBUG(2,"ray_cs interrupt from device not present or suspended.\n"); |
1973 | return IRQ_NONE; | 1973 | return IRQ_NONE; |
1974 | } | 1974 | } |
diff --git a/drivers/net/wireless/wavelan_cs.c b/drivers/net/wireless/wavelan_cs.c index 7373caf6e8e8..6b6769654777 100644 --- a/drivers/net/wireless/wavelan_cs.c +++ b/drivers/net/wireless/wavelan_cs.c | |||
@@ -4744,7 +4744,6 @@ static int wavelan_resume(struct pcmcia_device *link) | |||
4744 | { | 4744 | { |
4745 | struct net_device * dev = (struct net_device *) link->priv; | 4745 | struct net_device * dev = (struct net_device *) link->priv; |
4746 | 4746 | ||
4747 | link->state &= ~DEV_SUSPEND; | ||
4748 | if ((link->state & DEV_CONFIG) && (link->open)) { | 4747 | if ((link->state & DEV_CONFIG) && (link->open)) { |
4749 | wv_hw_reset(dev); | 4748 | wv_hw_reset(dev); |
4750 | netif_device_attach(dev); | 4749 | netif_device_attach(dev); |
diff --git a/drivers/pcmcia/ds.c b/drivers/pcmcia/ds.c index e8fe544f2e9c..34e634aa48e4 100644 --- a/drivers/pcmcia/ds.c +++ b/drivers/pcmcia/ds.c | |||
@@ -945,7 +945,7 @@ static ssize_t pcmcia_show_pm_state(struct device *dev, struct device_attribute | |||
945 | { | 945 | { |
946 | struct pcmcia_device *p_dev = to_pcmcia_dev(dev); | 946 | struct pcmcia_device *p_dev = to_pcmcia_dev(dev); |
947 | 947 | ||
948 | if (p_dev->dev.power.power_state.event != PM_EVENT_ON) | 948 | if (p_dev->suspended) |
949 | return sprintf(buf, "off\n"); | 949 | return sprintf(buf, "off\n"); |
950 | else | 950 | else |
951 | return sprintf(buf, "on\n"); | 951 | return sprintf(buf, "on\n"); |
@@ -960,11 +960,9 @@ static ssize_t pcmcia_store_pm_state(struct device *dev, struct device_attribute | |||
960 | if (!count) | 960 | if (!count) |
961 | return -EINVAL; | 961 | return -EINVAL; |
962 | 962 | ||
963 | if ((p_dev->dev.power.power_state.event == PM_EVENT_ON) && | 963 | if ((!p_dev->suspended) && !strncmp(buf, "off", 3)) |
964 | (!strncmp(buf, "off", 3))) | ||
965 | ret = dpm_runtime_suspend(dev, PMSG_SUSPEND); | 964 | ret = dpm_runtime_suspend(dev, PMSG_SUSPEND); |
966 | else if ((p_dev->dev.power.power_state.event != PM_EVENT_ON) && | 965 | else if (p_dev->suspended && !strncmp(buf, "on", 2)) |
967 | (!strncmp(buf, "on", 2))) | ||
968 | dpm_runtime_resume(dev); | 966 | dpm_runtime_resume(dev); |
969 | 967 | ||
970 | return ret ? ret : count; | 968 | return ret ? ret : count; |
@@ -1030,7 +1028,7 @@ static int pcmcia_dev_suspend(struct device * dev, pm_message_t state) | |||
1030 | { | 1028 | { |
1031 | struct pcmcia_device *p_dev = to_pcmcia_dev(dev); | 1029 | struct pcmcia_device *p_dev = to_pcmcia_dev(dev); |
1032 | struct pcmcia_driver *p_drv = NULL; | 1030 | struct pcmcia_driver *p_drv = NULL; |
1033 | int ret; | 1031 | int ret = 0; |
1034 | 1032 | ||
1035 | if (dev->driver) | 1033 | if (dev->driver) |
1036 | p_drv = to_pcmcia_drv(dev->driver); | 1034 | p_drv = to_pcmcia_drv(dev->driver); |
@@ -1038,14 +1036,16 @@ static int pcmcia_dev_suspend(struct device * dev, pm_message_t state) | |||
1038 | if (p_drv && p_drv->suspend) { | 1036 | if (p_drv && p_drv->suspend) { |
1039 | ret = p_drv->suspend(p_dev); | 1037 | ret = p_drv->suspend(p_dev); |
1040 | if (ret) | 1038 | if (ret) |
1041 | return ret; | 1039 | goto out; |
1042 | p_dev->state |= DEV_SUSPEND; | 1040 | if ((p_dev->state & DEV_CONFIG) && |
1043 | if ((p_dev->state & DEV_CONFIG) && | 1041 | !(p_dev->state & DEV_SUSPEND_NORELEASE)) |
1044 | !(p_dev->state & DEV_SUSPEND_NORELEASE)) | 1042 | pcmcia_release_configuration(p_dev); |
1045 | pcmcia_release_configuration(p_dev); | ||
1046 | } | 1043 | } |
1047 | 1044 | ||
1048 | return 0; | 1045 | out: |
1046 | if (!ret) | ||
1047 | p_dev->suspended = 1; | ||
1048 | return ret; | ||
1049 | } | 1049 | } |
1050 | 1050 | ||
1051 | 1051 | ||
@@ -1053,24 +1053,26 @@ static int pcmcia_dev_resume(struct device * dev) | |||
1053 | { | 1053 | { |
1054 | struct pcmcia_device *p_dev = to_pcmcia_dev(dev); | 1054 | struct pcmcia_device *p_dev = to_pcmcia_dev(dev); |
1055 | struct pcmcia_driver *p_drv = NULL; | 1055 | struct pcmcia_driver *p_drv = NULL; |
1056 | int ret; | 1056 | int ret = 0; |
1057 | 1057 | ||
1058 | if (dev->driver) | 1058 | if (dev->driver) |
1059 | p_drv = to_pcmcia_drv(dev->driver); | 1059 | p_drv = to_pcmcia_drv(dev->driver); |
1060 | 1060 | ||
1061 | if (p_drv && p_drv->resume) { | 1061 | if (p_drv && p_drv->resume) { |
1062 | p_dev->state &= ~DEV_SUSPEND; | 1062 | if ((p_dev->state & DEV_CONFIG) && |
1063 | if ((p_dev->state & DEV_CONFIG) && | 1063 | !(p_dev->state & DEV_SUSPEND_NORELEASE)){ |
1064 | !(p_dev->state & DEV_SUSPEND_NORELEASE)){ | 1064 | ret = pcmcia_request_configuration(p_dev, |
1065 | ret = pcmcia_request_configuration(p_dev, | 1065 | &p_dev->conf); |
1066 | &p_dev->conf); | 1066 | if (ret) |
1067 | if (ret) | 1067 | goto out; |
1068 | return ret; | 1068 | } |
1069 | } | 1069 | ret = p_drv->resume(p_dev); |
1070 | return p_drv->resume(p_dev); | ||
1071 | } | 1070 | } |
1072 | 1071 | ||
1073 | return 0; | 1072 | out: |
1073 | if (!ret) | ||
1074 | p_dev->suspended = 0; | ||
1075 | return ret; | ||
1074 | } | 1076 | } |
1075 | 1077 | ||
1076 | 1078 | ||
diff --git a/drivers/telephony/ixj_pcmcia.c b/drivers/telephony/ixj_pcmcia.c index a27df6101dc6..5c7611c2ac6c 100644 --- a/drivers/telephony/ixj_pcmcia.c +++ b/drivers/telephony/ixj_pcmcia.c | |||
@@ -60,7 +60,6 @@ static void ixj_detach(struct pcmcia_device *link) | |||
60 | { | 60 | { |
61 | DEBUG(0, "ixj_detach(0x%p)\n", link); | 61 | DEBUG(0, "ixj_detach(0x%p)\n", link); |
62 | 62 | ||
63 | link->state &= ~DEV_RELEASE_PENDING; | ||
64 | if (link->state & DEV_CONFIG) | 63 | if (link->state & DEV_CONFIG) |
65 | ixj_cs_release(link); | 64 | ixj_cs_release(link); |
66 | 65 | ||
diff --git a/include/pcmcia/ds.h b/include/pcmcia/ds.h index 557d8aea1a86..93a7ebc34156 100644 --- a/include/pcmcia/ds.h +++ b/include/pcmcia/ds.h | |||
@@ -108,8 +108,6 @@ typedef struct dev_node_t { | |||
108 | #define DEV_CONFIG 0x02 | 108 | #define DEV_CONFIG 0x02 |
109 | #define DEV_SUSPEND_NORELEASE 0x04 | 109 | #define DEV_SUSPEND_NORELEASE 0x04 |
110 | #define DEV_CONFIG_PENDING 0x10 | 110 | #define DEV_CONFIG_PENDING 0x10 |
111 | #define DEV_RELEASE_PENDING 0x20 | ||
112 | #define DEV_SUSPEND 0x40 | ||
113 | #define DEV_BUSY 0x80 | 111 | #define DEV_BUSY 0x80 |
114 | 112 | ||
115 | #define DEV_OK(l) \ | 113 | #define DEV_OK(l) \ |
@@ -163,13 +161,15 @@ struct pcmcia_device { | |||
163 | 161 | ||
164 | u_int p_state; | 162 | u_int p_state; |
165 | 163 | ||
164 | u8 suspended:1; | ||
165 | u8 reserved:3; | ||
166 | |||
166 | /* information about this device */ | 167 | /* information about this device */ |
167 | u8 has_manf_id:1; | 168 | u8 has_manf_id:1; |
168 | u8 has_card_id:1; | 169 | u8 has_card_id:1; |
169 | u8 has_func_id:1; | 170 | u8 has_func_id:1; |
170 | 171 | ||
171 | u8 allow_func_id_match:1; | 172 | u8 allow_func_id_match:1; |
172 | u8 reserved:4; | ||
173 | 173 | ||
174 | u8 func_id; | 174 | u8 func_id; |
175 | u16 manf_id; | 175 | u16 manf_id; |