pcmcia: deprecate CS_IN_USE

If a resource is already in use, mark it with -EBUSY. Same for cards already
asleep.

(includes a fix for a bug found by Larry Finger -- thanks!)
Signed-off-by: Dominik Brodowski <linux@dominikbrodowski.net>
This commit is contained in:
Dominik Brodowski
2008-08-03 11:40:19 +02:00
parent 943f70f1b5
commit f958095ef4
3 changed files with 33 additions and 18 deletions

View File

@@ -534,7 +534,7 @@ static int socket_insert(struct pcmcia_socket *skt)
static int socket_suspend(struct pcmcia_socket *skt)
{
if (skt->state & SOCKET_SUSPEND)
return CS_IN_USE;
return -EBUSY;
send_event(skt, CS_EVENT_PM_SUSPEND, CS_EVENT_PRI_LOW);
skt->socket = dead_socket;
@@ -556,7 +556,7 @@ static int socket_resume(struct pcmcia_socket *skt)
int ret;
if (!(skt->state & SOCKET_SUSPEND))
return CS_IN_USE;
return -EBUSY;
skt->socket = dead_socket;
skt->ops->init(skt);
@@ -765,7 +765,7 @@ int pccard_reset_card(struct pcmcia_socket *skt)
break;
}
if (skt->state & SOCKET_SUSPEND) {
ret = CS_IN_USE;
ret = -EBUSY;
break;
}
if (skt->state & SOCKET_CARDBUS) {