Merge branch 'urgent' of git://git.kernel.org/pub/scm/linux/kernel/git/brodo/pcmcia-2.6
[sfrench/cifs-2.6.git] / drivers / pcmcia / pcmcia_ioctl.c
index 104e73d5d86c02b2f4e0fa8df6a0326dbe7486aa..7631faa0caddf5e953123bc451915bd8fbde3a71 100644 (file)
@@ -711,7 +711,7 @@ static int ds_open(struct inode *inode, struct file *file)
            warning_printed = 1;
     }
 
-    if (s->pcmcia_state.present)
+    if (atomic_read(&s->present))
        queue_event(user, CS_EVENT_CARD_INSERTION);
 out:
     unlock_kernel();
@@ -770,9 +770,6 @@ static ssize_t ds_read(struct file *file, char __user *buf,
        return -EIO;
 
     s = user->socket;
-    if (s->pcmcia_state.dead)
-       return -EIO;
-
     ret = wait_event_interruptible(s->queue, !queue_empty(user));
     if (ret == 0)
        ret = put_user(get_queued_event(user), (int __user *)buf) ? -EFAULT : 4;
@@ -838,8 +835,6 @@ static int ds_ioctl(struct inode *inode, struct file *file,
        return -EIO;
 
     s = user->socket;
-    if (s->pcmcia_state.dead)
-       return -EIO;
 
     size = (cmd & IOCSIZE_MASK) >> IOCSIZE_SHIFT;
     if (size > sizeof(ds_ioctl_arg_t))