aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/pcmcia
diff options
context:
space:
mode:
authorDominik Brodowski <linux@dominikbrodowski.net>2006-03-05 05:04:33 -0500
committerDominik Brodowski <linux@dominikbrodowski.net>2006-03-31 10:26:57 -0500
commit9940ec3617fec1db13e589bbc3f37e37878c7683 (patch)
treeed0547040dc815fe1e2039fc1cba1613d5308cc7 /drivers/pcmcia
parente2d4096365e06b9a3799afbadc28b4519c0b3526 (diff)
[PATCH] pcmcia: convert DEV_OK to pcmcia_dev_present
Instead of the DEV_OK macro, drivers should use pcmcia_dev_present(). Signed-off-by: Dominik Brodowski <linux@dominikbrodowski.net>
Diffstat (limited to 'drivers/pcmcia')
-rw-r--r--drivers/pcmcia/ds.c27
1 files changed, 27 insertions, 0 deletions
diff --git a/drivers/pcmcia/ds.c b/drivers/pcmcia/ds.c
index 8c87343707cf..677105e35759 100644
--- a/drivers/pcmcia/ds.c
+++ b/drivers/pcmcia/ds.c
@@ -469,6 +469,7 @@ static void pcmcia_card_remove(struct pcmcia_socket *s)
469 } 469 }
470 p_dev = list_entry((&s->devices_list)->next, struct pcmcia_device, socket_device_list); 470 p_dev = list_entry((&s->devices_list)->next, struct pcmcia_device, socket_device_list);
471 list_del(&p_dev->socket_device_list); 471 list_del(&p_dev->socket_device_list);
472 p_dev->_removed=1;
472 spin_unlock_irqrestore(&pcmcia_dev_list_lock, flags); 473 spin_unlock_irqrestore(&pcmcia_dev_list_lock, flags);
473 474
474 device_unregister(&p_dev->dev); 475 device_unregister(&p_dev->dev);
@@ -1163,6 +1164,32 @@ static int ds_event(struct pcmcia_socket *skt, event_t event, int priority)
1163} /* ds_event */ 1164} /* ds_event */
1164 1165
1165 1166
1167struct pcmcia_device * pcmcia_dev_present(struct pcmcia_device *_p_dev)
1168{
1169 struct pcmcia_device *p_dev;
1170 struct pcmcia_device *ret = NULL;
1171
1172 p_dev = pcmcia_get_dev(_p_dev);
1173 if (!p_dev)
1174 return NULL;
1175
1176 if (!p_dev->socket->pcmcia_state.present)
1177 goto out;
1178
1179 if (p_dev->_removed)
1180 goto out;
1181
1182 if (p_dev->suspended)
1183 goto out;
1184
1185 ret = p_dev;
1186 out:
1187 pcmcia_put_dev(p_dev);
1188 return ret;
1189}
1190EXPORT_SYMBOL(pcmcia_dev_present);
1191
1192
1166static struct pcmcia_callback pcmcia_bus_callback = { 1193static struct pcmcia_callback pcmcia_bus_callback = {
1167 .owner = THIS_MODULE, 1194 .owner = THIS_MODULE,
1168 .event = ds_event, 1195 .event = ds_event,