public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: "John Lenz" <lenz@cs.wisc.edu>
To: "Greg KH" <gregkh@suse.de>
Cc: linux-kernel@vger.kernel.org
Subject: [PATCH] add class_interface pointer to add and remove functions
Date: Thu, 30 Jun 2005 16:18:42 -0500 (CDT)	[thread overview]
Message-ID: <37114.127.0.0.1.1120166322.squirrel@localhost> (raw)
In-Reply-To: <20050630194540.GA15389@suse.de>

On Thu, June 30, 2005 2:45 pm, Greg KH said:
> On Thu, Jun 30, 2005 at 12:22:49PM -0500, John Lenz wrote:
>> As long as there are a whole bunch of class API changes going on, I would
>> request that the class_interface add and remove functions get passed the
>> class_interface pointer as well as the class_device.  This way, the same
>> function can be used on multiple class_interfaces.
>
> I'm sorry, I seem to have missed the patch in this email that implements
> this feature...
>

Here is a patch that updates every usage of class_interface I could find.

Signed-off-by: John Lenz <lenz@cs.wisc.edu>

Index: linux-2.6.12/drivers/message/i2o/device.c
===================================================================
--- linux-2.6.12.orig/drivers/message/i2o/device.c	2005-06-30 11:54:55.000000000 -0500
+++ linux-2.6.12/drivers/message/i2o/device.c	2005-06-30 16:00:55.756158383 -0500
@@ -385,7 +385,7 @@
  *
  *	Returns 0 on success or negative error code on failure.
  */
-static int i2o_device_class_add(struct class_device *cd)
+static int i2o_device_class_add(struct class_interface *class_intf, struct class_device *cd)
 {
 	struct i2o_device *i2o_dev, *tmp;
 	struct i2o_controller *c;
Index: linux-2.6.12/drivers/base/class.c
===================================================================
--- linux-2.6.12.orig/drivers/base/class.c	2005-06-30 11:54:52.000000000 -0500
+++ linux-2.6.12/drivers/base/class.c	2005-06-30 15:58:53.321286879 -0500
@@ -505,7 +505,7 @@
 		list_add_tail(&class_dev->node, &parent->children);
 		list_for_each_entry(class_intf, &parent->interfaces, node)
 			if (class_intf->add)
-				class_intf->add(class_dev);
+				class_intf->add(class_intf, class_dev);
 		up(&parent->sem);
 	}
 	kobject_hotplug(&class_dev->kobj, KOBJ_ADD);
@@ -585,7 +585,7 @@
 		list_del_init(&class_dev->node);
 		list_for_each_entry(class_intf, &parent->interfaces, node)
 			if (class_intf->remove)
-				class_intf->remove(class_dev);
+				class_intf->remove(class_intf, class_dev);
 		up(&parent->sem);
 	}

@@ -688,7 +688,7 @@
 	list_add_tail(&class_intf->node, &parent->interfaces);
 	if (class_intf->add) {
 		list_for_each_entry(class_dev, &parent->children, node)
-			class_intf->add(class_dev);
+			class_intf->add(class_intf, class_dev);
 	}
 	up(&parent->sem);

@@ -707,7 +707,7 @@
 	list_del_init(&class_intf->node);
 	if (class_intf->remove) {
 		list_for_each_entry(class_dev, &parent->children, node)
-			class_intf->remove(class_dev);
+			class_intf->remove(class_intf, class_dev);
 	}
 	up(&parent->sem);

Index: linux-2.6.12/drivers/pcmcia/ds.c
===================================================================
--- linux-2.6.12.orig/drivers/pcmcia/ds.c	2005-06-30 11:54:56.000000000 -0500
+++ linux-2.6.12/drivers/pcmcia/ds.c	2005-06-30 16:02:14.382619884 -0500
@@ -1148,7 +1148,7 @@
 	.requery = pcmcia_bus_rescan,
 };

-static int __devinit pcmcia_bus_add_socket(struct class_device *class_dev)
+static int __devinit pcmcia_bus_add_socket(struct class_interface *class_intf, struct class_device *class_dev)
 {
 	struct pcmcia_socket *socket = class_get_devdata(class_dev);
 	int ret;
@@ -1183,7 +1183,7 @@
 	return 0;
 }

-static void pcmcia_bus_remove_socket(struct class_device *class_dev)
+static void pcmcia_bus_remove_socket(struct class_interface *class_intf, struct class_device *class_dev)
 {
 	struct pcmcia_socket *socket = class_get_devdata(class_dev);

Index: linux-2.6.12/drivers/scsi/sg.c
===================================================================
--- linux-2.6.12.orig/drivers/scsi/sg.c	2005-06-30 11:54:57.000000000 -0500
+++ linux-2.6.12/drivers/scsi/sg.c	2005-06-30 16:06:23.123755439 -0500
@@ -104,8 +104,8 @@

 #define SG_DEV_ARR_LUMP 32	/* amount to over allocate sg_dev_arr by */

-static int sg_add(struct class_device *);
-static void sg_remove(struct class_device *);
+static int sg_add(struct class_interface *class_intf, struct class_device *);
+static void sg_remove(struct class_interface *class_intf, struct class_device *);

 static Scsi_Request *dummy_cmdp;	/* only used for sizeof */

@@ -1507,7 +1507,7 @@
 }

 static int
-sg_add(struct class_device *cl_dev)
+sg_add(struct class_interface *class_intf, struct class_device *cl_dev)
 {
 	struct scsi_device *scsidp = to_scsi_device(cl_dev->dev);
 	struct gendisk *disk;
@@ -1583,7 +1583,7 @@
 }

 static void
-sg_remove(struct class_device *cl_dev)
+sg_remove(struct class_interface *class_intf, struct class_device *cl_dev)
 {
 	struct scsi_device *scsidp = to_scsi_device(cl_dev->dev);
 	Sg_device *sdp = NULL;
Index: linux-2.6.12/drivers/pcmcia/socket_sysfs.c
===================================================================
--- linux-2.6.12.orig/drivers/pcmcia/socket_sysfs.c	2005-06-30 11:54:56.000000000 -0500
+++ linux-2.6.12/drivers/pcmcia/socket_sysfs.c	2005-06-30 16:04:24.233249703 -0500
@@ -342,7 +342,7 @@
 	.write = pccard_store_cis,
 };

-static int __devinit pccard_sysfs_add_socket(struct class_device *class_dev)
+static int __devinit pccard_sysfs_add_socket(struct class_interface *class_intf, struct class_device *class_dev)
 {
 	struct class_device_attribute **attr;
 	int ret = 0;
@@ -358,7 +358,7 @@
 	return ret;
 }

-static void __devexit pccard_sysfs_remove_socket(struct class_device *class_dev)
+static void __devexit pccard_sysfs_remove_socket(struct class_interface *class_intf, struct class_device *class_dev)
 {
 	struct class_device_attribute **attr;

Index: linux-2.6.12/drivers/pcmcia/rsrc_nonstatic.c
===================================================================
--- linux-2.6.12.orig/drivers/pcmcia/rsrc_nonstatic.c	2005-06-30 11:54:56.000000000 -0500
+++ linux-2.6.12/drivers/pcmcia/rsrc_nonstatic.c	2005-06-30 16:03:49.738193763 -0500
@@ -994,7 +994,7 @@
 	NULL,
 };

-static int __devinit pccard_sysfs_add_rsrc(struct class_device *class_dev)
+static int __devinit pccard_sysfs_add_rsrc(struct class_interface *class_intf, struct class_device *class_dev)
 {
 	struct pcmcia_socket *s = class_get_devdata(class_dev);
 	struct class_device_attribute **attr;
@@ -1011,7 +1011,7 @@
 	return ret;
 }

-static void __devexit pccard_sysfs_remove_rsrc(struct class_device *class_dev)
+static void __devexit pccard_sysfs_remove_rsrc(struct class_interface *class_intf, struct class_device *class_dev)
 {
 	struct pcmcia_socket *s = class_get_devdata(class_dev);
 	struct class_device_attribute **attr;
Index: linux-2.6.12/include/linux/device.h
===================================================================
--- linux-2.6.12.orig/include/linux/device.h	2005-06-30 11:54:59.000000000 -0500
+++ linux-2.6.12/include/linux/device.h	2005-06-30 15:59:44.921353866 -0500
@@ -246,8 +246,8 @@
 	struct list_head	node;
 	struct class		*class;

-	int (*add)	(struct class_device *);
-	void (*remove)	(struct class_device *);
+	int (*add)	(struct class_interface *, struct class_device *);
+	void (*remove)	(struct class_interface *, struct class_device *);
 };

 extern int class_interface_register(struct class_interface *);



  reply	other threads:[~2005-06-30 21:24 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-06-30  6:02 [GIT PATCH] Driver core patches for 2.6.13-rc1 Greg KH
2005-06-30  6:04 ` [PATCH] driver core: add bus_find_device & driver_find_device functions Greg KH
2005-06-30  6:04   ` [PATCH] driver core: Add the ability to unbind drivers to devices from userspace Greg KH
2005-06-30  6:04     ` [PATCH] driver core: change bus_rescan_devices to return void Greg KH
2005-06-30  6:04       ` [PATCH] driver core: Add the ability to bind drivers to devices from userspace Greg KH
2005-06-30  6:04         ` [PATCH] Driver core: Use klist_del() instead of klist_remove() Greg KH
2005-06-30  6:25     ` [PATCH] driver core: Add the ability to unbind drivers to devices from userspace Dmitry Torokhov
2005-06-30  6:29       ` Greg KH
2005-06-30  6:19 ` [GIT PATCH] Driver core patches for 2.6.13-rc1 Dmitry Torokhov
2005-06-30  6:27   ` Greg KH
2005-06-30 17:22 ` John Lenz
2005-06-30 19:45   ` Greg KH
2005-06-30 21:18     ` John Lenz [this message]
2005-07-03 20:59       ` [PATCH] add class_interface pointer to add and remove functions Greg KH
2005-07-06  2:35         ` John Lenz
2005-07-06  7:17           ` Greg KH

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=37114.127.0.0.1.1120166322.squirrel@localhost \
    --to=lenz@cs.wisc.edu \
    --cc=gregkh@suse.de \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox