diff options
-rw-r--r-- | drivers/pcmcia/ds.c | 14 | ||||
-rw-r--r-- | drivers/pcmcia/rsrc_nonstatic.c | 4 | ||||
-rw-r--r-- | include/pcmcia/ss.h | 18 |
3 files changed, 10 insertions, 26 deletions
diff --git a/drivers/pcmcia/ds.c b/drivers/pcmcia/ds.c index 78b5b65f9f7e..08617719d3a1 100644 --- a/drivers/pcmcia/ds.c +++ b/drivers/pcmcia/ds.c | |||
@@ -294,7 +294,7 @@ static int pcmcia_device_probe(struct device *dev) | |||
294 | } | 294 | } |
295 | 295 | ||
296 | mutex_lock(&s->ops_mutex); | 296 | mutex_lock(&s->ops_mutex); |
297 | if ((s->pcmcia_state.has_pfc) && | 297 | if ((s->pcmcia_pfc) && |
298 | (p_dev->socket->device_count == 1) && (p_dev->device_no == 0)) | 298 | (p_dev->socket->device_count == 1) && (p_dev->device_no == 0)) |
299 | pcmcia_parse_uevents(s, PCMCIA_UEVENT_REQUERY); | 299 | pcmcia_parse_uevents(s, PCMCIA_UEVENT_REQUERY); |
300 | mutex_unlock(&s->ops_mutex); | 300 | mutex_unlock(&s->ops_mutex); |
@@ -359,7 +359,7 @@ static int pcmcia_device_remove(struct device *dev) | |||
359 | * pseudo multi-function card, we need to unbind | 359 | * pseudo multi-function card, we need to unbind |
360 | * all devices | 360 | * all devices |
361 | */ | 361 | */ |
362 | if ((p_dev->socket->pcmcia_state.has_pfc) && | 362 | if ((p_dev->socket->pcmcia_pfc) && |
363 | (p_dev->socket->device_count > 0) && | 363 | (p_dev->socket->device_count > 0) && |
364 | (p_dev->device_no == 0)) | 364 | (p_dev->device_no == 0)) |
365 | pcmcia_card_remove(p_dev->socket, p_dev); | 365 | pcmcia_card_remove(p_dev->socket, p_dev); |
@@ -681,7 +681,7 @@ static void pcmcia_requery(struct pcmcia_socket *s) | |||
681 | * call pcmcia_device_add() -- which will fail if both | 681 | * call pcmcia_device_add() -- which will fail if both |
682 | * devices are already registered. */ | 682 | * devices are already registered. */ |
683 | mutex_lock(&s->ops_mutex); | 683 | mutex_lock(&s->ops_mutex); |
684 | has_pfc = s->pcmcia_state.has_pfc; | 684 | has_pfc = s->pcmcia_pfc; |
685 | mutex_unlock(&s->ops_mutex); | 685 | mutex_unlock(&s->ops_mutex); |
686 | if (has_pfc) | 686 | if (has_pfc) |
687 | pcmcia_device_add(s, 0); | 687 | pcmcia_device_add(s, 0); |
@@ -813,7 +813,7 @@ static inline int pcmcia_devmatch(struct pcmcia_device *dev, | |||
813 | if (did->match_flags & PCMCIA_DEV_ID_MATCH_DEVICE_NO) { | 813 | if (did->match_flags & PCMCIA_DEV_ID_MATCH_DEVICE_NO) { |
814 | dev_dbg(&dev->dev, "this is a pseudo-multi-function device\n"); | 814 | dev_dbg(&dev->dev, "this is a pseudo-multi-function device\n"); |
815 | mutex_lock(&dev->socket->ops_mutex); | 815 | mutex_lock(&dev->socket->ops_mutex); |
816 | dev->socket->pcmcia_state.has_pfc = 1; | 816 | dev->socket->pcmcia_pfc = 1; |
817 | mutex_unlock(&dev->socket->ops_mutex); | 817 | mutex_unlock(&dev->socket->ops_mutex); |
818 | if (dev->device_no != did->device_no) | 818 | if (dev->device_no != did->device_no) |
819 | return 0; | 819 | return 0; |
@@ -827,7 +827,7 @@ static inline int pcmcia_devmatch(struct pcmcia_device *dev, | |||
827 | 827 | ||
828 | /* if this is a pseudo-multi-function device, | 828 | /* if this is a pseudo-multi-function device, |
829 | * we need explicit matches */ | 829 | * we need explicit matches */ |
830 | if (dev->socket->pcmcia_state.has_pfc) | 830 | if (dev->socket->pcmcia_pfc) |
831 | return 0; | 831 | return 0; |
832 | if (dev->device_no) | 832 | if (dev->device_no) |
833 | return 0; | 833 | return 0; |
@@ -1226,7 +1226,7 @@ static int pcmcia_bus_add(struct pcmcia_socket *skt) | |||
1226 | atomic_set(&skt->present, 1); | 1226 | atomic_set(&skt->present, 1); |
1227 | 1227 | ||
1228 | mutex_lock(&skt->ops_mutex); | 1228 | mutex_lock(&skt->ops_mutex); |
1229 | skt->pcmcia_state.has_pfc = 0; | 1229 | skt->pcmcia_pfc = 0; |
1230 | destroy_cis_cache(skt); /* to be on the safe side... */ | 1230 | destroy_cis_cache(skt); /* to be on the safe side... */ |
1231 | mutex_unlock(&skt->ops_mutex); | 1231 | mutex_unlock(&skt->ops_mutex); |
1232 | 1232 | ||
@@ -1317,7 +1317,7 @@ static int __devinit pcmcia_bus_add_socket(struct device *dev, | |||
1317 | } | 1317 | } |
1318 | 1318 | ||
1319 | INIT_LIST_HEAD(&socket->devices_list); | 1319 | INIT_LIST_HEAD(&socket->devices_list); |
1320 | memset(&socket->pcmcia_state, 0, sizeof(u8)); | 1320 | socket->pcmcia_pfc = 0; |
1321 | socket->device_count = 0; | 1321 | socket->device_count = 0; |
1322 | atomic_set(&socket->present, 0); | 1322 | atomic_set(&socket->present, 0); |
1323 | 1323 | ||
diff --git a/drivers/pcmcia/rsrc_nonstatic.c b/drivers/pcmcia/rsrc_nonstatic.c index d217dc1d426b..13245a2986f3 100644 --- a/drivers/pcmcia/rsrc_nonstatic.c +++ b/drivers/pcmcia/rsrc_nonstatic.c | |||
@@ -1113,8 +1113,6 @@ static ssize_t store_io_db(struct device *dev, | |||
1113 | 1113 | ||
1114 | mutex_lock(&s->ops_mutex); | 1114 | mutex_lock(&s->ops_mutex); |
1115 | ret = adjust_io(s, add, start_addr, end_addr); | 1115 | ret = adjust_io(s, add, start_addr, end_addr); |
1116 | if (!ret) | ||
1117 | s->resource_setup_new = 1; | ||
1118 | mutex_unlock(&s->ops_mutex); | 1116 | mutex_unlock(&s->ops_mutex); |
1119 | 1117 | ||
1120 | return ret ? ret : count; | 1118 | return ret ? ret : count; |
@@ -1181,8 +1179,6 @@ static ssize_t store_mem_db(struct device *dev, | |||
1181 | 1179 | ||
1182 | mutex_lock(&s->ops_mutex); | 1180 | mutex_lock(&s->ops_mutex); |
1183 | ret = adjust_memory(s, add, start_addr, end_addr); | 1181 | ret = adjust_memory(s, add, start_addr, end_addr); |
1184 | if (!ret) | ||
1185 | s->resource_setup_new = 1; | ||
1186 | mutex_unlock(&s->ops_mutex); | 1182 | mutex_unlock(&s->ops_mutex); |
1187 | 1183 | ||
1188 | return ret ? ret : count; | 1184 | return ret ? ret : count; |
diff --git a/include/pcmcia/ss.h b/include/pcmcia/ss.h index 66740b764da7..aeac27109839 100644 --- a/include/pcmcia/ss.h +++ b/include/pcmcia/ss.h | |||
@@ -162,17 +162,10 @@ struct pcmcia_socket { | |||
162 | u_int pci_irq; | 162 | u_int pci_irq; |
163 | struct pci_dev *cb_dev; | 163 | struct pci_dev *cb_dev; |
164 | 164 | ||
165 | |||
166 | /* socket setup is done so resources should be able to be allocated. | 165 | /* socket setup is done so resources should be able to be allocated. |
167 | * Only if set to 1, calls to find_{io,mem}_region are handled, and | 166 | * Only if set to 1, calls to find_{io,mem}_region are handled, and |
168 | * insertio events are actually managed by the PCMCIA layer.*/ | 167 | * insertio events are actually managed by the PCMCIA layer.*/ |
169 | u8 resource_setup_done:1; | 168 | u8 resource_setup_done; |
170 | |||
171 | /* It's old if resource setup is done using adjust_resource_info() */ | ||
172 | u8 resource_setup_old:1; | ||
173 | u8 resource_setup_new:1; | ||
174 | |||
175 | u8 reserved:5; | ||
176 | 169 | ||
177 | /* socket operations */ | 170 | /* socket operations */ |
178 | struct pccard_operations *ops; | 171 | struct pccard_operations *ops; |
@@ -218,13 +211,8 @@ struct pcmcia_socket { | |||
218 | * incorrectness and change */ | 211 | * incorrectness and change */ |
219 | u8 device_count; | 212 | u8 device_count; |
220 | 213 | ||
221 | /* 16-bit state: */ | 214 | /* does the PCMCIA card consist of two pseudo devices? */ |
222 | struct { | 215 | u8 pcmcia_pfc; |
223 | /* the PCMCIA card consists of two pseudo devices */ | ||
224 | u8 has_pfc:1; | ||
225 | |||
226 | u8 reserved:7; | ||
227 | } pcmcia_state; | ||
228 | 216 | ||
229 | /* non-zero if PCMCIA card is present */ | 217 | /* non-zero if PCMCIA card is present */ |
230 | atomic_t present; | 218 | atomic_t present; |