diff --git a/drivers/pcmcia/ds.c b/drivers/pcmcia/ds.c
index 85e2cb2..f796dcd 100644
--- a/drivers/pcmcia/ds.c
+++ b/drivers/pcmcia/ds.c
@@ -75,7 +75,7 @@
 
 spinlock_t pcmcia_dev_list_lock;
 
-static int unbind_request(struct pcmcia_bus_socket *s);
+static int unbind_request(struct pcmcia_socket *s);
 
 /*====================================================================*/
 
@@ -313,24 +313,6 @@
 /*======================================================================*/
 
 
-void pcmcia_release_bus_socket(struct kref *refcount)
-{
-	struct pcmcia_bus_socket *s = container_of(refcount, struct pcmcia_bus_socket, refcount);
-	pcmcia_put_socket(s->parent);
-	kfree(s);
-}
-
-void pcmcia_put_bus_socket(struct pcmcia_bus_socket *s)
-{
-	kref_put(&s->refcount, pcmcia_release_bus_socket);
-}
-
-struct pcmcia_bus_socket *pcmcia_get_bus_socket(struct pcmcia_bus_socket *s)
-{
-	kref_get(&s->refcount);
-	return (s);
-}
-
 /**
  * pcmcia_register_driver - register a PCMCIA driver with the bus core
  *
@@ -387,7 +369,7 @@
 {
 	struct pcmcia_device *p_dev = to_pcmcia_dev(dev);
 	ds_dbg(1, "releasing dev %p\n", p_dev);
-	pcmcia_put_bus_socket(p_dev->socket->pcmcia);
+	pcmcia_put_socket(p_dev->socket);
 	kfree(p_dev);
 }
 
@@ -522,12 +504,12 @@
  */
 static DECLARE_MUTEX(device_add_lock);
 
-struct pcmcia_device * pcmcia_device_add(struct pcmcia_bus_socket *s, unsigned int function)
+struct pcmcia_device * pcmcia_device_add(struct pcmcia_socket *s, unsigned int function)
 {
 	struct pcmcia_device *p_dev;
 	unsigned long flags;
 
-	s = pcmcia_get_bus_socket(s);
+	s = pcmcia_get_socket(s);
 	if (!s)
 		return NULL;
 
@@ -542,18 +524,18 @@
 		goto err_put;
 	memset(p_dev, 0, sizeof(struct pcmcia_device));
 
-	p_dev->socket = s->parent;
+	p_dev->socket = s;
 	p_dev->device_no = (s->device_count++);
 	p_dev->func   = function;
 
 	p_dev->dev.bus = &pcmcia_bus_type;
-	p_dev->dev.parent = s->parent->dev.dev;
+	p_dev->dev.parent = s->dev.dev;
 	p_dev->dev.release = pcmcia_release_dev;
 	sprintf (p_dev->dev.bus_id, "%d.%d", p_dev->socket->sock, p_dev->device_no);
 
 	/* compat */
 	p_dev->client.client_magic = CLIENT_MAGIC;
-	p_dev->client.Socket = s->parent;
+	p_dev->client.Socket = s;
 	p_dev->client.Function = function;
 	p_dev->client.state = CLIENT_UNBOUND;
 
@@ -581,7 +563,7 @@
 	s->device_count--;
  err_put:
 	up(&device_add_lock);
-	pcmcia_put_bus_socket(s);
+	pcmcia_put_socket(s);
 
 	return NULL;
 }
@@ -612,7 +594,7 @@
 	/* this doesn't handle multifunction devices on one pcmcia function
 	 * yet. */
 	for (i=0; i < no_funcs; i++)
-		pcmcia_device_add(s->pcmcia, i);
+		pcmcia_device_add(s, i);
 
 	return (ret);
 }
@@ -620,12 +602,12 @@
 
 static void pcmcia_delayed_add_pseudo_device(void *data)
 {
-	struct pcmcia_bus_socket *s = data;
+	struct pcmcia_socket *s = data;
 	pcmcia_device_add(s, 0);
 	s->pcmcia_state.device_add_pending = 0;
 }
 
-static inline void pcmcia_add_pseudo_device(struct pcmcia_bus_socket *s)
+static inline void pcmcia_add_pseudo_device(struct pcmcia_socket *s)
 {
 	if (!s->pcmcia_state.device_add_pending) {
 		schedule_work(&s->device_add);
@@ -650,7 +632,7 @@
 
 	/* must be called with skt_sem held */
 	spin_lock_irqsave(&pcmcia_dev_list_lock, flags);
-	if (list_empty(&skt->pcmcia->devices_list))
+	if (list_empty(&skt->devices_list))
 		no_devices=1;
 	spin_unlock_irqrestore(&pcmcia_dev_list_lock, flags);
 
@@ -727,7 +709,7 @@
 		 * pseudo devices, and if not, add the second one.
 		 */
 		if (dev->device_no == 0)
-			pcmcia_add_pseudo_device(dev->socket->pcmcia);
+			pcmcia_add_pseudo_device(dev->socket);
 
 		if (dev->device_no != did->device_no)
 			return 0;
@@ -947,21 +929,13 @@
 
 static int send_event(struct pcmcia_socket *s, event_t event, int priority)
 {
-	int ret = 0;
 	struct send_event_data private;
-	struct pcmcia_bus_socket *skt = pcmcia_get_bus_socket(s->pcmcia);
-
-	if (!skt)
-		return 0;
 
 	private.skt = s;
 	private.event = event;
 	private.priority = priority;
 
-	ret = bus_for_each_dev(&pcmcia_bus_type, NULL, &private, send_event_callback);
-
-	pcmcia_put_bus_socket(skt);
-	return ret;
+	return bus_for_each_dev(&pcmcia_bus_type, NULL, &private, send_event_callback);
 } /* send_event */
 
 
@@ -972,25 +946,25 @@
 
 static int ds_event(struct pcmcia_socket *skt, event_t event, int priority)
 {
-	struct pcmcia_bus_socket *s = skt->pcmcia;
+	struct pcmcia_socket *s = pcmcia_get_socket(skt);
 	int ret = 0;
 
 	ds_dbg(1, "ds_event(0x%06x, %d, 0x%p)\n",
-	       event, priority, s);
+	       event, priority, skt);
     
 	switch (event) {
 
 	case CS_EVENT_CARD_REMOVAL:
 		s->pcmcia_state.present = 0;
 	    	send_event(skt, event, priority);
-		unbind_request(s);
-		handle_event(s, event);
+		unbind_request(skt);
+		handle_event(skt, event);
 		break;
 	
 	case CS_EVENT_CARD_INSERTION:
 		s->pcmcia_state.present = 1;
 		pcmcia_card_add(skt);
-		handle_event(s, event);
+		handle_event(skt, event);
 		break;
 
 	case CS_EVENT_EJECTION_REQUEST:
@@ -998,11 +972,13 @@
 		break;
 
 	default:
-		handle_event(s, event);
+		handle_event(skt, event);
 		send_event(skt, event, priority);
 		break;
     }
 
+    pcmcia_put_socket(s);
+
     return 0;
 } /* ds_event */
 
@@ -1011,8 +987,7 @@
 int pcmcia_register_client(client_handle_t *handle, client_reg_t *req)
 {
 	client_t *client = NULL;
-	struct pcmcia_socket *s;
-	struct pcmcia_bus_socket *skt = NULL;
+	struct pcmcia_socket *s = NULL;
 	struct pcmcia_device *p_dev = NULL;
 
 	/* Look for unbound client with matching dev_info */
@@ -1023,14 +998,11 @@
 		if (s->state & SOCKET_CARDBUS)
 			continue;
 
-		skt = s->pcmcia;
-		if (!skt)
-			continue;
-		skt = pcmcia_get_bus_socket(skt);
-		if (!skt)
+		s = pcmcia_get_socket(s);
+		if (!s)
 			continue;
 		spin_lock_irqsave(&pcmcia_dev_list_lock, flags);
-		list_for_each_entry(p_dev, &skt->devices_list, socket_device_list) {
+		list_for_each_entry(p_dev, &s->devices_list, socket_device_list) {
 			struct pcmcia_driver *p_drv;
 			p_dev = pcmcia_get_dev(p_dev);
 			if (!p_dev)
@@ -1049,14 +1021,14 @@
 			pcmcia_put_dev(p_dev);
 		}
 		spin_unlock_irqrestore(&pcmcia_dev_list_lock, flags);
-		pcmcia_put_bus_socket(skt);
+		pcmcia_put_socket(s);
 	}
  found:
 	up_read(&pcmcia_socket_list_rwsem);
 	if (!p_dev || !client)
 		return -ENODEV;
 
-	pcmcia_put_bus_socket(skt); /* safe, as we already hold a reference from bind_device */
+	pcmcia_put_socket(s); /* safe, as we already hold a reference from bind_device */
 
 	*handle = client;
 	client->state &= ~CLIENT_UNBOUND;
@@ -1106,12 +1078,12 @@
 /* unbind _all_ devices attached to a given pcmcia_bus_socket. The
  * drivers have been called with EVENT_CARD_REMOVAL before.
  */
-static int unbind_request(struct pcmcia_bus_socket *s)
+static int unbind_request(struct pcmcia_socket *s)
 {
 	struct pcmcia_device	*p_dev;
 	unsigned long		flags;
 
-	ds_dbg(2, "unbind_request(%d)\n", s->parent->sock);
+	ds_dbg(2, "unbind_request(%d)\n", s->sock);
 
 	s->device_count = 0;
 
@@ -1176,24 +1148,14 @@
 static int __devinit pcmcia_bus_add_socket(struct class_device *class_dev)
 {
 	struct pcmcia_socket *socket = class_get_devdata(class_dev);
-	struct pcmcia_bus_socket *s;
 	int ret;
 
-	s = kmalloc(sizeof(struct pcmcia_bus_socket), GFP_KERNEL);
-	if(!s)
-		return -ENOMEM;
-	memset(s, 0, sizeof(struct pcmcia_bus_socket));
-
-	/* get reference to parent socket */
-	s->parent = pcmcia_get_socket(socket);
-	if (!s->parent) {
+	socket = pcmcia_get_socket(socket);
+	if (!socket) {
 		printk(KERN_ERR "PCMCIA obtaining reference to socket %p failed\n", socket);
-		kfree (s);
 		return -ENODEV;
 	}
 
-	kref_init(&s->refcount);
-    
 	/*
 	 * Ugly. But we want to wait for the socket threads to have started up.
 	 * We really should let the drivers themselves drive some of this..
@@ -1201,19 +1163,17 @@
 	msleep(250);
 
 #ifdef CONFIG_PCMCIA_IOCTL
-	init_waitqueue_head(&s->queue);
+	init_waitqueue_head(&socket->queue);
 #endif
-	INIT_LIST_HEAD(&s->devices_list);
-	INIT_WORK(&s->device_add, pcmcia_delayed_add_pseudo_device, s);
-
-	/* Set up hotline to Card Services */
-	socket->pcmcia = s;
+	INIT_LIST_HEAD(&socket->devices_list);
+	INIT_WORK(&socket->device_add, pcmcia_delayed_add_pseudo_device, socket);
+	memset(&socket->pcmcia_state, 0, sizeof(u8));
+	socket->device_count = 0;
 
 	ret = pccard_register_pcmcia(socket, &pcmcia_bus_callback);
 	if (ret) {
 		printk(KERN_ERR "PCMCIA registration PCCard core failed for socket %p\n", socket);
-		pcmcia_put_bus_socket(s);
-		socket->pcmcia = NULL;
+		pcmcia_put_socket(socket);
 		return (ret);
 	}
 
@@ -1224,14 +1184,13 @@
 {
 	struct pcmcia_socket *socket = class_get_devdata(class_dev);
 
-	if (!socket || !socket->pcmcia)
+	if (!socket)
 		return;
 
+	socket->pcmcia_state.dead = 1;
 	pccard_register_pcmcia(socket, NULL);
 
-	socket->pcmcia->pcmcia_state.dead = 1;
-	pcmcia_put_bus_socket(socket->pcmcia);
-	socket->pcmcia = NULL;
+	pcmcia_put_socket(socket);
 
 	return;
 }
diff --git a/drivers/pcmcia/ds_internal.h b/drivers/pcmcia/ds_internal.h
index 2c3bb18..d359bd2 100644
--- a/drivers/pcmcia/ds_internal.h
+++ b/drivers/pcmcia/ds_internal.h
@@ -1,56 +1,21 @@
 /* ds_internal.h - internal header for 16-bit PCMCIA devices management */
 
-struct user_info_t;
-
-/* Socket state information */
-struct pcmcia_bus_socket {
-	struct kref		refcount;
-	struct pcmcia_socket	*parent;
-
-	/* the PCMCIA devices connected to this socket (normally one, more
-	 * for multifunction devices: */
-	struct list_head	devices_list;
-	u8			device_count; /* the number of devices, used
-					       * only internally and subject
-					       * to incorrectness and change */
-
-	struct {
-		u8		present:1,
-				busy:1,
-				dead:1,
-				device_add_pending:1,
-				reserved:4;
-	} 			pcmcia_state;
-
-	struct work_struct	device_add;
-
-
-#ifdef CONFIG_PCMCIA_IOCTL
-	struct user_info_t	*user;
-	wait_queue_head_t	queue;
-#endif
-};
 extern spinlock_t pcmcia_dev_list_lock;
-
 extern struct bus_type pcmcia_bus_type;
 
-
 extern struct pcmcia_device * pcmcia_get_dev(struct pcmcia_device *p_dev);
 extern void pcmcia_put_dev(struct pcmcia_device *p_dev);
 
-struct pcmcia_bus_socket *pcmcia_get_bus_socket(struct pcmcia_bus_socket *s);
-void pcmcia_put_bus_socket(struct pcmcia_bus_socket *s);
-
-struct pcmcia_device * pcmcia_device_add(struct pcmcia_bus_socket *s, unsigned int function);
+struct pcmcia_device * pcmcia_device_add(struct pcmcia_socket *s, unsigned int function);
 
 #ifdef CONFIG_PCMCIA_IOCTL
 extern void __init pcmcia_setup_ioctl(void);
 extern void __exit pcmcia_cleanup_ioctl(void);
-extern void handle_event(struct pcmcia_bus_socket *s, event_t event);
-extern int handle_request(struct pcmcia_bus_socket *s, event_t event);
+extern void handle_event(struct pcmcia_socket *s, event_t event);
+extern int handle_request(struct pcmcia_socket *s, event_t event);
 #else
 static inline void __init pcmcia_setup_ioctl(void) { return; }
 static inline void __init pcmcia_cleanup_ioctl(void) { return; }
-static inline void handle_event(struct pcmcia_bus_socket *s, event_t event) { return; }
-static inline int handle_request(struct pcmcia_bus_socket *s, event_t event) { return CS_SUCCESS; }
+static inline void handle_event(struct pcmcia_socket *s, event_t event) { return; }
+static inline int handle_request(struct pcmcia_socket *s, event_t event) { return CS_SUCCESS; }
 #endif
diff --git a/drivers/pcmcia/pcmcia_ioctl.c b/drivers/pcmcia/pcmcia_ioctl.c
index b223f52..0bebfdb 100644
--- a/drivers/pcmcia/pcmcia_ioctl.c
+++ b/drivers/pcmcia/pcmcia_ioctl.c
@@ -70,7 +70,7 @@
 	int			event_head, event_tail;
 	event_t			event[MAX_EVENTS];
 	struct user_info_t	*next;
-	struct pcmcia_bus_socket *socket;
+	struct pcmcia_socket	*socket;
 } user_info_t;
 
 
@@ -87,15 +87,6 @@
 #endif
 
 
-static struct pcmcia_bus_socket * get_socket_info_by_nr(unsigned int nr)
-{
-	struct pcmcia_socket * s = pcmcia_get_socket_by_nr(nr);
-	if (s && s->pcmcia)
-		return s->pcmcia;
-	else
-		return NULL;
-}
-
 /* backwards-compatible accessing of driver --- by name! */
 
 static struct pcmcia_driver * get_pcmcia_driver (dev_info_t *dev_info)
@@ -172,7 +163,7 @@
     user->event[user->event_head] = event;
 }
 
-void handle_event(struct pcmcia_bus_socket *s, event_t event)
+void handle_event(struct pcmcia_socket *s, event_t event)
 {
     user_info_t *user;
     for (user = s->user; user; user = user->next)
@@ -204,18 +195,18 @@
 
 ======================================================================*/
 
-static int bind_request(struct pcmcia_bus_socket *s, bind_info_t *bind_info)
+static int bind_request(struct pcmcia_socket *s, bind_info_t *bind_info)
 {
 	struct pcmcia_driver *p_drv;
 	struct pcmcia_device *p_dev;
 	int ret = 0;
 	unsigned long flags;
 
-	s = pcmcia_get_bus_socket(s);
+	s = pcmcia_get_socket(s);
 	if (!s)
 		return -EINVAL;
 
-	ds_dbg(2, "bind_request(%d, '%s')\n", s->parent->sock,
+	ds_dbg(2, "bind_request(%d, '%s')\n", s->sock,
 	       (char *)bind_info->dev_info);
 
 	p_drv = get_pcmcia_driver(&bind_info->dev_info);
@@ -278,9 +269,9 @@
 	/*
 	 * Prevent this racing with a card insertion.
 	 */
-	down(&s->parent->skt_sem);
+	down(&s->skt_sem);
 	bus_rescan_devices(&pcmcia_bus_type);
-	up(&s->parent->skt_sem);
+	up(&s->skt_sem);
 
 	/* check whether the driver indeed matched. I don't care if this
 	 * is racy or not, because it can only happen on cardmgr access
@@ -294,7 +285,7 @@
  err_put_driver:
 	put_driver(&p_drv->drv);
  err_put:
-	pcmcia_put_bus_socket(s);
+	pcmcia_put_socket(s);
 
 	return (ret);
 } /* bind_request */
@@ -302,7 +293,7 @@
 
 extern struct pci_bus *pcmcia_lookup_bus(struct pcmcia_socket *s);
 
-static int get_device_info(struct pcmcia_bus_socket *s, bind_info_t *bind_info, int first)
+static int get_device_info(struct pcmcia_socket *s, bind_info_t *bind_info, int first)
 {
 	dev_node_t *node;
 	struct pcmcia_device *p_dev;
@@ -317,7 +308,7 @@
 	{
 		struct pci_bus *bus;
 
-		bus = pcmcia_lookup_bus(s->parent);
+		bus = pcmcia_lookup_bus(s);
 		if (bus) {
 			struct list_head *list;
 			struct pci_dev *dev = NULL;
@@ -391,21 +382,21 @@
 static int ds_open(struct inode *inode, struct file *file)
 {
     socket_t i = iminor(inode);
-    struct pcmcia_bus_socket *s;
+    struct pcmcia_socket *s;
     user_info_t *user;
 
     ds_dbg(0, "ds_open(socket %d)\n", i);
 
-    s = get_socket_info_by_nr(i);
+    s = pcmcia_get_socket_by_nr(i);
     if (!s)
 	    return -ENODEV;
-    s = pcmcia_get_bus_socket(s);
+    s = pcmcia_get_socket(s);
     if (!s)
 	    return -ENODEV;
 
     if ((file->f_flags & O_ACCMODE) != O_RDONLY) {
 	    if (s->pcmcia_state.busy) {
-		    pcmcia_put_bus_socket(s);
+		    pcmcia_put_socket(s);
 		    return -EBUSY;
 	    }
 	else
@@ -414,7 +405,7 @@
 
     user = kmalloc(sizeof(user_info_t), GFP_KERNEL);
     if (!user) {
-	    pcmcia_put_bus_socket(s);
+	    pcmcia_put_socket(s);
 	    return -ENOMEM;
     }
     user->event_tail = user->event_head = 0;
@@ -433,7 +424,7 @@
 
 static int ds_release(struct inode *inode, struct file *file)
 {
-    struct pcmcia_bus_socket *s;
+    struct pcmcia_socket *s;
     user_info_t *user, **link;
 
     ds_dbg(0, "ds_release(socket %d)\n", iminor(inode));
@@ -456,7 +447,7 @@
     *link = user->next;
     user->user_magic = 0;
     kfree(user);
-    pcmcia_put_bus_socket(s);
+    pcmcia_put_socket(s);
 out:
     return 0;
 } /* ds_release */
@@ -466,7 +457,7 @@
 static ssize_t ds_read(struct file *file, char __user *buf,
 		       size_t count, loff_t *ppos)
 {
-    struct pcmcia_bus_socket *s;
+    struct pcmcia_socket *s;
     user_info_t *user;
     int ret;
 
@@ -510,7 +501,7 @@
 /* No kernel lock - fine */
 static u_int ds_poll(struct file *file, poll_table *wait)
 {
-    struct pcmcia_bus_socket *s;
+    struct pcmcia_socket *s;
     user_info_t *user;
 
     ds_dbg(2, "ds_poll(socket %d)\n", iminor(file->f_dentry->d_inode));
@@ -536,7 +527,7 @@
 static int ds_ioctl(struct inode * inode, struct file * file,
 		    u_int cmd, u_long arg)
 {
-    struct pcmcia_bus_socket *s;
+    struct pcmcia_socket *s;
     void __user *uarg = (char __user *)arg;
     u_int size;
     int ret, err;
@@ -589,57 +580,57 @@
 	break;
     case DS_GET_CONFIGURATION_INFO:
 	if (buf->config.Function &&
-	   (buf->config.Function >= s->parent->functions))
+	   (buf->config.Function >= s->functions))
 	    ret = CS_BAD_ARGS;
 	else
-	    ret = pccard_get_configuration_info(s->parent,
+	    ret = pccard_get_configuration_info(s,
 			buf->config.Function, &buf->config);
 	break;
     case DS_GET_FIRST_TUPLE:
-	down(&s->parent->skt_sem);
-	pcmcia_validate_mem(s->parent);
-	up(&s->parent->skt_sem);
-	ret = pccard_get_first_tuple(s->parent, BIND_FN_ALL, &buf->tuple);
+	down(&s->skt_sem);
+	pcmcia_validate_mem(s);
+	up(&s->skt_sem);
+	ret = pccard_get_first_tuple(s, BIND_FN_ALL, &buf->tuple);
 	break;
     case DS_GET_NEXT_TUPLE:
-	ret = pccard_get_next_tuple(s->parent, BIND_FN_ALL, &buf->tuple);
+	ret = pccard_get_next_tuple(s, BIND_FN_ALL, &buf->tuple);
 	break;
     case DS_GET_TUPLE_DATA:
 	buf->tuple.TupleData = buf->tuple_parse.data;
 	buf->tuple.TupleDataMax = sizeof(buf->tuple_parse.data);
-	ret = pccard_get_tuple_data(s->parent, &buf->tuple);
+	ret = pccard_get_tuple_data(s, &buf->tuple);
 	break;
     case DS_PARSE_TUPLE:
 	buf->tuple.TupleData = buf->tuple_parse.data;
 	ret = pccard_parse_tuple(&buf->tuple, &buf->tuple_parse.parse);
 	break;
     case DS_RESET_CARD:
-	ret = pccard_reset_card(s->parent);
+	ret = pccard_reset_card(s);
 	break;
     case DS_GET_STATUS:
 	if (buf->status.Function &&
-	   (buf->status.Function >= s->parent->functions))
+	   (buf->status.Function >= s->functions))
 	    ret = CS_BAD_ARGS;
 	else
-	ret = pccard_get_status(s->parent, buf->status.Function, &buf->status);
+	ret = pccard_get_status(s, buf->status.Function, &buf->status);
 	break;
     case DS_VALIDATE_CIS:
-	down(&s->parent->skt_sem);
-	pcmcia_validate_mem(s->parent);
-	up(&s->parent->skt_sem);
-	ret = pccard_validate_cis(s->parent, BIND_FN_ALL, &buf->cisinfo);
+	down(&s->skt_sem);
+	pcmcia_validate_mem(s);
+	up(&s->skt_sem);
+	ret = pccard_validate_cis(s, BIND_FN_ALL, &buf->cisinfo);
 	break;
     case DS_SUSPEND_CARD:
-	ret = pcmcia_suspend_card(s->parent);
+	ret = pcmcia_suspend_card(s);
 	break;
     case DS_RESUME_CARD:
-	ret = pcmcia_resume_card(s->parent);
+	ret = pcmcia_resume_card(s);
 	break;
     case DS_EJECT_CARD:
-	err = pcmcia_eject_card(s->parent);
+	err = pcmcia_eject_card(s);
 	break;
     case DS_INSERT_CARD:
-	err = pcmcia_insert_card(s->parent);
+	err = pcmcia_insert_card(s);
 	break;
     case DS_ACCESS_CONFIGURATION_REGISTER:
 	if ((buf->conf_reg.Action == CS_WRITE) && !capable(CAP_SYS_ADMIN)) {
@@ -647,10 +638,10 @@
 	    goto free_out;
 	}
 	if (buf->conf_reg.Function &&
-	   (buf->conf_reg.Function >= s->parent->functions))
+	   (buf->conf_reg.Function >= s->functions))
 	    ret = CS_BAD_ARGS;
 	else
-	    ret = pccard_access_configuration_register(s->parent,
+	    ret = pccard_access_configuration_register(s,
 			buf->conf_reg.Function, &buf->conf_reg);
 	break;
     case DS_GET_FIRST_REGION:
@@ -671,11 +662,11 @@
 	goto free_out;
 	break;
     case DS_GET_FIRST_WINDOW:
-	ret = pcmcia_get_window(s->parent, &buf->win_info.handle, 0,
+	ret = pcmcia_get_window(s, &buf->win_info.handle, 0,
 			&buf->win_info.window);
 	break;
     case DS_GET_NEXT_WINDOW:
-	ret = pcmcia_get_window(s->parent, &buf->win_info.handle,
+	ret = pcmcia_get_window(s, &buf->win_info.handle,
 			buf->win_info.handle->index + 1, &buf->win_info.window);
 	break;
     case DS_GET_MEM_PAGE:
@@ -683,7 +674,7 @@
 			   &buf->win_info.map);
 	break;
     case DS_REPLACE_CIS:
-	ret = pcmcia_replace_cis(s->parent, &buf->cisdump);
+	ret = pcmcia_replace_cis(s, &buf->cisdump);
 	break;
     case DS_BIND_REQUEST:
 	if (!capable(CAP_SYS_ADMIN)) {
diff --git a/include/pcmcia/ss.h b/include/pcmcia/ss.h
index f879776..0f7aacc 100644
--- a/include/pcmcia/ss.h
+++ b/include/pcmcia/ss.h
@@ -15,10 +15,12 @@
 #ifndef _LINUX_SS_H
 #define _LINUX_SS_H
 
+#include <linux/config.h>
+#include <linux/device.h>
+
 #include <pcmcia/cs_types.h>
 #include <pcmcia/cs.h>
 #include <pcmcia/bulkmem.h>
-#include <linux/device.h>
 
 /* Definitions for card status flags for GetStatus */
 #define SS_WRPROT	0x0001
@@ -171,7 +173,7 @@
 
 struct config_t;
 struct pcmcia_callback;
-
+struct user_info_t;
 
 struct pcmcia_socket {
 	struct module			*owner;
@@ -242,9 +244,32 @@
 	unsigned int			thread_events;
 
 	/* pcmcia (16-bit) */
-	struct pcmcia_bus_socket	*pcmcia;
 	struct pcmcia_callback		*callback;
 
+#if defined(CONFIG_PCMCIA) || defined(CONFIG_PCMCIA_MODULE)
+	struct list_head		devices_list;	/*  PCMCIA devices */
+	u8				device_count;	/* the number of devices, used
+							 * only internally and subject
+							 * to incorrectness and change */
+
+	struct {
+		u8			present:1,	/* PCMCIA card is present in socket */
+					busy:1,		/* "master" ioctl is used */
+					dead:1,		/* pcmcia module is being unloaded */
+					device_add_pending:1, /* a pseudo-multifunction-device
+							       * add event is pending */
+					reserved:4;
+	} 				pcmcia_state;
+
+	struct work_struct		device_add;	/* for adding further pseudo-multifunction
+							 * devices */
+
+#ifdef CONFIG_PCMCIA_IOCTL
+	struct user_info_t		*user;
+	wait_queue_head_t		queue;
+#endif
+#endif
+
 	/* cardbus (32-bit) */
 #ifdef CONFIG_CARDBUS
 	struct resource *		cb_cis_res;
