aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi/pcmcia/fdomain_stub.c
diff options
context:
space:
mode:
authorDominik Brodowski <linux@dominikbrodowski.net>2006-03-01 18:09:29 -0500
committerDominik Brodowski <linux@dominikbrodowski.net>2006-03-31 10:26:33 -0500
commite2d4096365e06b9a3799afbadc28b4519c0b3526 (patch)
tree90ec691d71f9c0309048714e359b8ba351b533f7 /drivers/scsi/pcmcia/fdomain_stub.c
parentf6fbe01ac976f3ec618cd5fb71ad9ce2cfa7ab2b (diff)
[PATCH] pcmcia: use bitfield instead of p_state and state
Instead of the two status values struct pcmcia_device->p_state and state, use descriptive bitfields. Most value-checking in drivers was invalid, as the core now only calls the ->remove() (a.k.a. detach) function in case the attachement _and_ configuration was successful. Signed-off-by: Dominik Brodowski <linux@dominikbrodowski.net>
Diffstat (limited to 'drivers/scsi/pcmcia/fdomain_stub.c')
-rw-r--r--drivers/scsi/pcmcia/fdomain_stub.c11
1 files changed, 2 insertions, 9 deletions
diff --git a/drivers/scsi/pcmcia/fdomain_stub.c b/drivers/scsi/pcmcia/fdomain_stub.c
index 80afd3e879cc..85f7ffac19a0 100644
--- a/drivers/scsi/pcmcia/fdomain_stub.c
+++ b/drivers/scsi/pcmcia/fdomain_stub.c
@@ -105,7 +105,6 @@ static int fdomain_probe(struct pcmcia_device *link)
105 link->conf.IntType = INT_MEMORY_AND_IO; 105 link->conf.IntType = INT_MEMORY_AND_IO;
106 link->conf.Present = PRESENT_OPTION; 106 link->conf.Present = PRESENT_OPTION;
107 107
108 link->state |= DEV_PRESENT | DEV_CONFIG_PENDING;
109 return fdomain_config(link); 108 return fdomain_config(link);
110} /* fdomain_attach */ 109} /* fdomain_attach */
111 110
@@ -115,8 +114,7 @@ static void fdomain_detach(struct pcmcia_device *link)
115{ 114{
116 DEBUG(0, "fdomain_detach(0x%p)\n", link); 115 DEBUG(0, "fdomain_detach(0x%p)\n", link);
117 116
118 if (link->state & DEV_CONFIG) 117 fdomain_release(link);
119 fdomain_release(link);
120 118
121 kfree(link->priv); 119 kfree(link->priv);
122} /* fdomain_detach */ 120} /* fdomain_detach */
@@ -147,9 +145,6 @@ static int fdomain_config(struct pcmcia_device *link)
147 CS_CHECK(ParseTuple, pcmcia_parse_tuple(link, &tuple, &parse)); 145 CS_CHECK(ParseTuple, pcmcia_parse_tuple(link, &tuple, &parse));
148 link->conf.ConfigBase = parse.config.base; 146 link->conf.ConfigBase = parse.config.base;
149 147
150 /* Configure card */
151 link->state |= DEV_CONFIG;
152
153 tuple.DesiredTuple = CISTPL_CFTABLE_ENTRY; 148 tuple.DesiredTuple = CISTPL_CFTABLE_ENTRY;
154 CS_CHECK(GetFirstTuple, pcmcia_get_first_tuple(link, &tuple)); 149 CS_CHECK(GetFirstTuple, pcmcia_get_first_tuple(link, &tuple));
155 while (1) { 150 while (1) {
@@ -188,7 +183,6 @@ static int fdomain_config(struct pcmcia_device *link)
188 link->dev_node = &info->node; 183 link->dev_node = &info->node;
189 info->host = host; 184 info->host = host;
190 185
191 link->state &= ~DEV_CONFIG_PENDING;
192 return 0; 186 return 0;
193 187
194cs_failed: 188cs_failed:
@@ -214,8 +208,7 @@ static void fdomain_release(struct pcmcia_device *link)
214 208
215static int fdomain_resume(struct pcmcia_device *link) 209static int fdomain_resume(struct pcmcia_device *link)
216{ 210{
217 if (link->state & DEV_CONFIG) 211 fdomain_16x0_bus_reset(NULL);
218 fdomain_16x0_bus_reset(NULL);
219 212
220 return 0; 213 return 0;
221} 214}