[PATCH] pcmcia: embed dev_link_t into struct pcmcia_device

Embed dev_link_t into struct pcmcia_device(), as they basically address the
same entity. The actual contents of dev_link_t will be cleaned up step by step.
This patch includes a bugfix from and signed-off-by Andrew Morton.

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

diff --git a/include/pcmcia/ds.h b/include/pcmcia/ds.h
index 7f712df..61f7d2d 100644
--- a/include/pcmcia/ds.h
+++ b/include/pcmcia/ds.h
@@ -39,7 +39,7 @@
 typedef struct bind_info_t {
     dev_info_t		dev_info;
     u_char		function;
-    struct dev_link_t	*instance;
+    struct pcmcia_device *instance;
     char		name[DEV_NAME_LEN];
     u_short		major, minor;
     void		*next;
@@ -103,18 +103,6 @@
     struct dev_node_t	*next;
 } dev_node_t;
 
-typedef struct dev_link_t {
-    dev_node_t		*dev;
-    u_int		state, open;
-    client_handle_t	handle;
-    io_req_t		io;
-    irq_req_t		irq;
-    config_req_t	conf;
-    window_handle_t	win;
-    void		*priv;
-    struct dev_link_t	*next;
-} dev_link_t;
-
 /* Flags for device state */
 #define DEV_PRESENT		0x01
 #define DEV_CONFIG		0x02
@@ -163,9 +151,17 @@
 
 	struct list_head	socket_device_list;
 
-	/* deprecated, a cleaned up version will be moved into this
-	   struct soon */
-	dev_link_t		*instance;
+	/* deprecated, will be cleaned up soon */
+	dev_node_t		*dev_node;
+	u_int			state;
+	u_int			open;
+	struct pcmcia_device	*handle;
+	io_req_t		io;
+	irq_req_t		irq;
+	config_req_t		conf;
+	window_handle_t		win;
+	void			*priv;
+
 	u_int			p_state;
 
 	/* information about this device */
@@ -189,6 +185,7 @@
 	struct pcmcia_driver *	cardmgr;
 #endif
 };
+typedef struct pcmcia_device dev_link_t;
 
 #define to_pcmcia_dev(n) container_of(n, struct pcmcia_device, dev)
 #define to_pcmcia_drv(n) container_of(n, struct pcmcia_driver, drv)
@@ -196,7 +193,7 @@
 #define handle_to_pdev(handle) (handle)
 #define handle_to_dev(handle) (handle->dev)
 
-#define dev_to_instance(dev) (dev->instance)
+#define dev_to_instance(dev) (dev)
 
 /* error reporting */
 void cs_error(client_handle_t handle, int func, int ret);