Commit 3fdda634 authored by Russell King's avatar Russell King

[PCMCIA] Rename driver services constants.

Driver services constants clash with similar constants defined
by Card services.  Prefix them all with DS_.

This patch started out as Dominik Brodowski's 2.6.0-test9
ds_includes_cs_internal patch, which only changed one constant
and attempted to fix PCMCIA debugging.
parent 9c093b8a
...@@ -118,10 +118,10 @@ struct pcmcia_bus_socket { ...@@ -118,10 +118,10 @@ struct pcmcia_bus_socket {
struct pcmcia_socket *parent; struct pcmcia_socket *parent;
}; };
#define SOCKET_PRESENT 0x01 #define DS_SOCKET_PRESENT 0x01
#define SOCKET_BUSY 0x02 #define DS_SOCKET_BUSY 0x02
#define SOCKET_REMOVAL_PENDING 0x10 #define DS_SOCKET_REMOVAL_PENDING 0x10
#define SOCKET_DEAD 0x80 #define DS_SOCKET_DEAD 0x80
/*====================================================================*/ /*====================================================================*/
...@@ -254,12 +254,12 @@ static int handle_request(struct pcmcia_bus_socket *s, event_t event) ...@@ -254,12 +254,12 @@ static int handle_request(struct pcmcia_bus_socket *s, event_t event)
{ {
if (s->req_pending != 0) if (s->req_pending != 0)
return CS_IN_USE; return CS_IN_USE;
if (s->state & SOCKET_BUSY) if (s->state & DS_SOCKET_BUSY)
s->req_pending = 1; s->req_pending = 1;
handle_event(s, event); handle_event(s, event);
if (wait_event_interruptible(s->request, s->req_pending <= 0)) if (wait_event_interruptible(s->request, s->req_pending <= 0))
return CS_IN_USE; return CS_IN_USE;
if (s->state & SOCKET_BUSY) if (s->state & DS_SOCKET_BUSY)
return s->req_result; return s->req_result;
return CS_SUCCESS; return CS_SUCCESS;
} }
...@@ -268,7 +268,7 @@ static void handle_removal(void *data) ...@@ -268,7 +268,7 @@ static void handle_removal(void *data)
{ {
struct pcmcia_bus_socket *s = data; struct pcmcia_bus_socket *s = data;
handle_event(s, CS_EVENT_CARD_REMOVAL); handle_event(s, CS_EVENT_CARD_REMOVAL);
s->state &= ~SOCKET_REMOVAL_PENDING; s->state &= ~DS_SOCKET_REMOVAL_PENDING;
} }
/*====================================================================== /*======================================================================
...@@ -289,15 +289,15 @@ static int ds_event(event_t event, int priority, ...@@ -289,15 +289,15 @@ static int ds_event(event_t event, int priority,
switch (event) { switch (event) {
case CS_EVENT_CARD_REMOVAL: case CS_EVENT_CARD_REMOVAL:
s->state &= ~SOCKET_PRESENT; s->state &= ~DS_SOCKET_PRESENT;
if (!(s->state & SOCKET_REMOVAL_PENDING)) { if (!(s->state & DS_SOCKET_REMOVAL_PENDING)) {
s->state |= SOCKET_REMOVAL_PENDING; s->state |= DS_SOCKET_REMOVAL_PENDING;
schedule_delayed_work(&s->removal, HZ/10); schedule_delayed_work(&s->removal, HZ/10);
} }
break; break;
case CS_EVENT_CARD_INSERTION: case CS_EVENT_CARD_INSERTION:
s->state |= SOCKET_PRESENT; s->state |= DS_SOCKET_PRESENT;
handle_event(s, event); handle_event(s, event);
break; break;
...@@ -530,10 +530,10 @@ static int ds_open(struct inode *inode, struct file *file) ...@@ -530,10 +530,10 @@ static int ds_open(struct inode *inode, struct file *file)
return -ENODEV; return -ENODEV;
if ((file->f_flags & O_ACCMODE) != O_RDONLY) { if ((file->f_flags & O_ACCMODE) != O_RDONLY) {
if (s->state & SOCKET_BUSY) if (s->state & DS_SOCKET_BUSY)
return -EBUSY; return -EBUSY;
else else
s->state |= SOCKET_BUSY; s->state |= DS_SOCKET_BUSY;
} }
user = kmalloc(sizeof(user_info_t), GFP_KERNEL); user = kmalloc(sizeof(user_info_t), GFP_KERNEL);
...@@ -545,7 +545,7 @@ static int ds_open(struct inode *inode, struct file *file) ...@@ -545,7 +545,7 @@ static int ds_open(struct inode *inode, struct file *file)
s->user = user; s->user = user;
file->private_data = user; file->private_data = user;
if (s->state & SOCKET_PRESENT) if (s->state & DS_SOCKET_PRESENT)
queue_event(user, CS_EVENT_CARD_INSERTION); queue_event(user, CS_EVENT_CARD_INSERTION);
return 0; return 0;
} /* ds_open */ } /* ds_open */
...@@ -567,7 +567,7 @@ static int ds_release(struct inode *inode, struct file *file) ...@@ -567,7 +567,7 @@ static int ds_release(struct inode *inode, struct file *file)
/* Unlink user data structure */ /* Unlink user data structure */
if ((file->f_flags & O_ACCMODE) != O_RDONLY) { if ((file->f_flags & O_ACCMODE) != O_RDONLY) {
s->state &= ~SOCKET_BUSY; s->state &= ~DS_SOCKET_BUSY;
s->req_pending = 0; s->req_pending = 0;
wake_up_interruptible(&s->request); wake_up_interruptible(&s->request);
} }
...@@ -603,7 +603,7 @@ static ssize_t ds_read(struct file *file, char *buf, ...@@ -603,7 +603,7 @@ static ssize_t ds_read(struct file *file, char *buf,
return -EIO; return -EIO;
s = user->socket; s = user->socket;
if (s->state & SOCKET_DEAD) if (s->state & DS_SOCKET_DEAD)
return -EIO; return -EIO;
ret = wait_event_interruptible(s->queue, !queue_empty(user)); ret = wait_event_interruptible(s->queue, !queue_empty(user));
...@@ -633,7 +633,7 @@ static ssize_t ds_write(struct file *file, const char *buf, ...@@ -633,7 +633,7 @@ static ssize_t ds_write(struct file *file, const char *buf,
return -EIO; return -EIO;
s = user->socket; s = user->socket;
if (s->state & SOCKET_DEAD) if (s->state & DS_SOCKET_DEAD)
return -EIO; return -EIO;
if (s->req_pending) { if (s->req_pending) {
...@@ -689,7 +689,7 @@ static int ds_ioctl(struct inode * inode, struct file * file, ...@@ -689,7 +689,7 @@ static int ds_ioctl(struct inode * inode, struct file * file,
return -EIO; return -EIO;
s = user->socket; s = user->socket;
if (s->state & SOCKET_DEAD) if (s->state & DS_SOCKET_DEAD)
return -EIO; return -EIO;
size = (cmd & IOCSIZE_MASK) >> IOCSIZE_SHIFT; size = (cmd & IOCSIZE_MASK) >> IOCSIZE_SHIFT;
...@@ -921,7 +921,7 @@ static void pcmcia_bus_remove_socket(struct class_device *class_dev) ...@@ -921,7 +921,7 @@ static void pcmcia_bus_remove_socket(struct class_device *class_dev)
pcmcia_deregister_client(socket->pcmcia->handle); pcmcia_deregister_client(socket->pcmcia->handle);
socket->pcmcia->state |= SOCKET_DEAD; socket->pcmcia->state |= DS_SOCKET_DEAD;
pcmcia_put_bus_socket(socket->pcmcia); pcmcia_put_bus_socket(socket->pcmcia);
socket->pcmcia = NULL; socket->pcmcia = NULL;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment