[patch 8/19] pcmcia: clean up cs ds callback

Dominik Brodowski linux at dominikbrodowski.net
Sun Mar 20 05:43:38 EST 2005


struct pcmcia_callback isn't needed for each socket, one is enough for all
sockets.

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

Index: 2.6.11+/drivers/pcmcia/ds.c
===================================================================
--- 2.6.11+.orig/drivers/pcmcia/ds.c	2005-03-09 00:03:01.000000000 +0100
+++ 2.6.11+/drivers/pcmcia/ds.c	2005-03-09 00:03:03.000000000 +0100
@@ -1166,6 +1166,11 @@
 } /* deregister_client */
 EXPORT_SYMBOL(pcmcia_deregister_client);
 
+static struct pcmcia_callback pcmcia_bus_callback = {
+	.owner = THIS_MODULE,
+	.event = ds_event,
+	.requery = pcmcia_bus_rescan,
+};
 
 static int __devinit pcmcia_bus_add_socket(struct class_device *class_dev)
 {
@@ -1201,12 +1206,9 @@
 	INIT_WORK(&s->device_add, pcmcia_delayed_add_pseudo_device, s);
 
 	/* Set up hotline to Card Services */
-	s->callback.owner = THIS_MODULE;
-	s->callback.event = &ds_event;
-	s->callback.requery = &pcmcia_bus_rescan;
 	socket->pcmcia = s;
 
-	ret = pccard_register_pcmcia(socket, &s->callback);
+	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);
Index: 2.6.11+/drivers/pcmcia/ds_internal.h
===================================================================
--- 2.6.11+.orig/drivers/pcmcia/ds_internal.h	2005-03-09 00:03:01.000000000 +0100
+++ 2.6.11+/drivers/pcmcia/ds_internal.h	2005-03-09 00:03:03.000000000 +0100
@@ -5,7 +5,6 @@
 /* Socket state information */
 struct pcmcia_bus_socket {
 	struct kref		refcount;
-	struct pcmcia_callback	callback;
 	int			state;
 	struct pcmcia_socket	*parent;
 



More information about the linux-pcmcia mailing list