Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 181973
b: refs/heads/master
c: 3970dd8
h: refs/heads/master
i:
  181971: 431df04
v: v3
  • Loading branch information
Dominik Brodowski committed Jan 24, 2010
1 parent 798cdec commit fc5f002
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 24 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 593f010bc0d8f7fde2ce948cac3f77f6a3d9db2b
refs/heads/master: 3970dd8c5169505f0cc5e4c3e2fde7bdd9bbad3e
13 changes: 10 additions & 3 deletions trunk/drivers/pcmcia/cs.c
Original file line number Diff line number Diff line change
Expand Up @@ -407,7 +407,7 @@ static void socket_shutdown(struct pcmcia_socket *s)
"*** DANGER *** unable to remove socket power\n");
}

cs_socket_put(s);
s->state &= ~SOCKET_INUSE;
}

static int socket_setup(struct pcmcia_socket *skt, int initial_delay)
Expand Down Expand Up @@ -496,8 +496,8 @@ static int socket_insert(struct pcmcia_socket *skt)

dev_dbg(&skt->dev, "insert\n");

if (!cs_socket_get(skt))
return -ENODEV;
WARN_ON(skt->state & SOCKET_INUSE);
skt->state |= SOCKET_INUSE;

ret = socket_setup(skt, setup_delay);
if (ret == 0) {
Expand Down Expand Up @@ -697,6 +697,13 @@ static int pccardd(void *__skt)
/* make sure we are running before we exit */
set_current_state(TASK_RUNNING);

/* shut down socket, if a device is still present */
if (skt->state & SOCKET_PRESENT) {
mutex_lock(&skt->skt_mutex);
socket_remove(skt);
mutex_unlock(&skt->skt_mutex);
}

/* remove from the device core */
pccard_sysfs_remove_socket(&skt->dev);
device_unregister(&skt->dev);
Expand Down
20 changes: 0 additions & 20 deletions trunk/drivers/pcmcia/cs_internal.h
Original file line number Diff line number Diff line change
Expand Up @@ -87,26 +87,6 @@ struct pccard_resource_ops {
#define SOCKET_CARDBUS 0x8000
#define SOCKET_CARDBUS_CONFIG 0x10000

static inline int cs_socket_get(struct pcmcia_socket *skt)
{
int ret;

WARN_ON(skt->state & SOCKET_INUSE);

ret = try_module_get(skt->owner);
if (ret)
skt->state |= SOCKET_INUSE;
return ret;
}

static inline void cs_socket_put(struct pcmcia_socket *skt)
{
if (skt->state & SOCKET_INUSE) {
skt->state &= ~SOCKET_INUSE;
module_put(skt->owner);
}
}


/*
* Stuff internal to module "pcmcia_core":
Expand Down

0 comments on commit fc5f002

Please sign in to comment.