aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/pcmcia
diff options
context:
space:
mode:
authorDominik Brodowski <linux@dominikbrodowski.net>2010-07-21 08:43:05 -0400
committerDominik Brodowski <linux@dominikbrodowski.net>2010-07-30 15:07:37 -0400
commitce3f9d71bd9c4268698109ad425625a2a8f51e22 (patch)
tree31f1c514199da5aabae02ac4aeab31f6343fe324 /drivers/pcmcia
parent134716f19bc53dc22e8aba34f2af195b805328b5 (diff)
pcmcia: remove unused flag, simplify headers
As we only provide one way to set up resources now, we can remove the resource-setup-related bitfield (except resource_setup_done). In addition, pcmcia_state only consisted of one entry, so remove this bitfield as well. Suggested-by: Komuro <komurojun-mbn@nifty.com> Signed-off-by: Dominik Brodowski <linux@dominikbrodowski.net>
Diffstat (limited to 'drivers/pcmcia')
-rw-r--r--drivers/pcmcia/ds.c14
-rw-r--r--drivers/pcmcia/rsrc_nonstatic.c4
2 files changed, 7 insertions, 11 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;