[RFC PATCH 10/11] pcmcia updates (post 2.6.16): rename pcmcia_device->state

Dominik Brodowski linux at dominikbrodowski.net
Sun Jan 15 14:15:09 EST 2006


Subject: [PATCH] pcmcia: rename pcmcia_device.state
From: Dominik Brodowski <linux at dominikbrodowski.net>
Date: 1137338760 +0100

Rename pcmcia_device.state (which is used in very few places) to p_state
in order to avoid a namespace collision when moving the deprecated
dev_link_t into struct pcmcia_device

Signed-off-by: Dominik Brodowski <linux at dominikbrodowski.net>

---

 drivers/pcmcia/ds.c              |   12 ++++++------
 drivers/pcmcia/pcmcia_resource.c |   24 ++++++++++++------------
 include/pcmcia/ds.h              |    2 +-
 3 files changed, 19 insertions(+), 19 deletions(-)

f9139189e2fc37202833a422758d8de5b7ca2a54
diff --git a/drivers/pcmcia/ds.c b/drivers/pcmcia/ds.c
index a0546b7..28466cf 100644
--- a/drivers/pcmcia/ds.c
+++ b/drivers/pcmcia/ds.c
@@ -381,7 +381,7 @@ static int pcmcia_device_probe(struct de
 		goto put_dev;
 	}
 
-	p_dev->state &= ~CLIENT_UNBOUND;
+	p_dev->p_state &= ~CLIENT_UNBOUND;
 
 	ret = p_drv->probe(p_dev);
 
@@ -410,17 +410,17 @@ static int pcmcia_device_remove(struct d
 	       	p_drv->remove(p_dev);
 
 	/* check for proper unloading */
-	if (p_dev->state & (CLIENT_IRQ_REQ|CLIENT_IO_REQ|CLIENT_CONFIG_LOCKED))
+	if (p_dev->p_state & (CLIENT_IRQ_REQ|CLIENT_IO_REQ|CLIENT_CONFIG_LOCKED))
 		printk(KERN_INFO "pcmcia: driver %s did not release config properly\n",
 		       p_drv->drv.name);
 
 	for (i = 0; i < MAX_WIN; i++)
-		if (p_dev->state & CLIENT_WIN_REQ(i))
+		if (p_dev->p_state & CLIENT_WIN_REQ(i))
 			printk(KERN_INFO "pcmcia: driver %s did not release windows properly\n",
 			       p_drv->drv.name);
 
 	/* references from pcmcia_probe_device */
-	p_dev->state = CLIENT_UNBOUND;
+	p_dev->p_state = CLIENT_UNBOUND;
 	pcmcia_put_dev(p_dev);
 	module_put(p_drv->owner);
 
@@ -449,7 +449,7 @@ static void pcmcia_card_remove(struct pc
 		}
 		p_dev = list_entry((&s->devices_list)->next, struct pcmcia_device, socket_device_list);
 		list_del(&p_dev->socket_device_list);
-		p_dev->state |= CLIENT_STALE;
+		p_dev->p_state |= CLIENT_STALE;
 		spin_unlock_irqrestore(&pcmcia_dev_list_lock, flags);
 
 		device_unregister(&p_dev->dev);
@@ -579,7 +579,7 @@ struct pcmcia_device * pcmcia_device_add
 	sprintf (p_dev->devname, "pcmcia%s", p_dev->dev.bus_id);
 
 	/* compat */
-	p_dev->state = CLIENT_UNBOUND;
+	p_dev->p_state = CLIENT_UNBOUND;
 
 
 	spin_lock_irqsave(&pcmcia_dev_list_lock, flags);
diff --git a/drivers/pcmcia/pcmcia_resource.c b/drivers/pcmcia/pcmcia_resource.c
index 17e2fbf..ab0bbb6 100644
--- a/drivers/pcmcia/pcmcia_resource.c
+++ b/drivers/pcmcia/pcmcia_resource.c
@@ -476,8 +476,8 @@ int pcmcia_release_configuration(struct 
 	config_t *c = p_dev->function_config;
 	int i;
 
-	if (p_dev->state & CLIENT_CONFIG_LOCKED) {
-		p_dev->state &= ~CLIENT_CONFIG_LOCKED;
+	if (p_dev->p_state & CLIENT_CONFIG_LOCKED) {
+		p_dev->p_state &= ~CLIENT_CONFIG_LOCKED;
 		if (--(s->lock_count) == 0) {
 			s->socket.flags = SS_OUTPUT_ENA;   /* Is this correct? */
 			s->socket.Vpp = 0;
@@ -516,10 +516,10 @@ int pcmcia_release_io(struct pcmcia_devi
 	struct pcmcia_socket *s = p_dev->socket;
 	config_t *c = p_dev->function_config;
 
-	if (!(p_dev->state & CLIENT_IO_REQ))
+	if (!(p_dev->p_state & CLIENT_IO_REQ))
 		return CS_BAD_HANDLE;
 
-	p_dev->state &= ~CLIENT_IO_REQ;
+	p_dev->p_state &= ~CLIENT_IO_REQ;
 
 	if ((c->io.BasePort1 != req->BasePort1) ||
 	    (c->io.NumPorts1 != req->NumPorts1) ||
@@ -542,9 +542,9 @@ int pcmcia_release_irq(struct pcmcia_dev
 	struct pcmcia_socket *s = p_dev->socket;
 	config_t *c= p_dev->function_config;
 
-	if (!(p_dev->state & CLIENT_IRQ_REQ))
+	if (!(p_dev->p_state & CLIENT_IRQ_REQ))
 		return CS_BAD_HANDLE;
-	p_dev->state &= ~CLIENT_IRQ_REQ;
+	p_dev->p_state &= ~CLIENT_IRQ_REQ;
 
 	if (c->state & CONFIG_LOCKED)
 		return CS_CONFIGURATION_LOCKED;
@@ -576,7 +576,7 @@ int pcmcia_release_window(window_handle_
 	if ((win == NULL) || (win->magic != WINDOW_MAGIC))
 		return CS_BAD_HANDLE;
 	s = win->sock;
-	if (!(win->handle->state & CLIENT_WIN_REQ(win->index)))
+	if (!(win->handle->p_state & CLIENT_WIN_REQ(win->index)))
 		return CS_BAD_HANDLE;
 
 	/* Shut down memory window */
@@ -590,7 +590,7 @@ int pcmcia_release_window(window_handle_
 		kfree(win->ctl.res);
 		win->ctl.res = NULL;
 	}
-	win->handle->state &= ~CLIENT_WIN_REQ(win->index);
+	win->handle->p_state &= ~CLIENT_WIN_REQ(win->index);
 
 	win->magic = 0;
 
@@ -708,7 +708,7 @@ int pcmcia_request_configuration(struct 
 	}
 
 	c->state |= CONFIG_LOCKED;
-	p_dev->state |= CLIENT_CONFIG_LOCKED;
+	p_dev->p_state |= CLIENT_CONFIG_LOCKED;
 	return CS_SUCCESS;
 } /* pcmcia_request_configuration */
 EXPORT_SYMBOL(pcmcia_request_configuration);
@@ -754,7 +754,7 @@ int pcmcia_request_io(struct pcmcia_devi
 
 	c->io = *req;
 	c->state |= CONFIG_IO_REQ;
-	p_dev->state |= CLIENT_IO_REQ;
+	p_dev->p_state |= CLIENT_IO_REQ;
 	return CS_SUCCESS;
 } /* pcmcia_request_io */
 EXPORT_SYMBOL(pcmcia_request_io);
@@ -850,7 +850,7 @@ int pcmcia_request_irq(struct pcmcia_dev
 	s->irq.Config++;
 
 	c->state |= CONFIG_IRQ_REQ;
-	p_dev->state |= CLIENT_IRQ_REQ;
+	p_dev->p_state |= CLIENT_IRQ_REQ;
 
 #ifdef CONFIG_PCMCIA_PROBE
 	pcmcia_used_irq[irq]++;
@@ -910,7 +910,7 @@ int pcmcia_request_window(struct pcmcia_
 		if (!win->ctl.res)
 			return CS_IN_USE;
 	}
-	(*p_dev)->state |= CLIENT_WIN_REQ(w);
+	(*p_dev)->p_state |= CLIENT_WIN_REQ(w);
 
 	/* Configure the socket controller */
 	win->ctl.map = w+1;
diff --git a/include/pcmcia/ds.h b/include/pcmcia/ds.h
index 8a6a95e..7f712df 100644
--- a/include/pcmcia/ds.h
+++ b/include/pcmcia/ds.h
@@ -166,7 +166,7 @@ struct pcmcia_device {
 	/* deprecated, a cleaned up version will be moved into this
 	   struct soon */
 	dev_link_t		*instance;
-	u_int			state;
+	u_int			p_state;
 
 	/* information about this device */
 	u8			has_manf_id:1;
-- 
1.1.2



More information about the linux-pcmcia mailing list