All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jon Smirl <jonsmirl@yahoo.com>
To: linux-hotplug@vger.kernel.org
Subject: PATCH: adding set hotplug function to class_simple
Date: Mon, 26 Jan 2004 18:44:27 +0000	[thread overview]
Message-ID: <20040126184427.48357.qmail@web14912.mail.yahoo.com> (raw)

[-- Attachment #1: Type: text/plain, Size: 340 bytes --]

I'm not sure this made it through the mail problems at sourceforge.
It's a patch to add a set hotplug function to class_simple.

I need this for the DRI driver.

=====
Jon Smirl
jonsmirl@yahoo.com

__________________________________
Do you Yahoo!?
Yahoo! SiteBuilder - Free web site building tool. Try it!
http://webhosting.yahoo.com/ps/sb/

[-- Attachment #2: simple_hotplug.patch --]
[-- Type: application/octet-stream, Size: 1708 bytes --]

===== drivers/base/class_simple.c 1.1 vs edited =====
--- 1.1/drivers/base/class_simple.c	Thu Jan 15 06:06:03 2004
+++ edited/drivers/base/class_simple.c	Fri Jan 23 19:04:55 2004
@@ -170,6 +170,24 @@
 EXPORT_SYMBOL(class_simple_device_add);
 
 /**
+ * class_simple_set_hotplug - set the hotplug callback in the embedded struct class
+ * @cs: pointer to the struct class_simple to hold the pointer
+ * @hotplug: function pointer to the hotplug function
+ *
+ * Implement and set a hotplug function to add environment variables specific to this 
+ * class on the hotplug event.
+ */
+int class_simple_set_hotplug(struct class_simple *cs, 
+	int (*hotplug)(struct class_device *dev, char **envp, int num_envp, char *buffer, int buffer_size))
+{
+	if ((cs == NULL) || (IS_ERR(cs)))
+		return -ENODEV;
+	cs->class.hotplug = hotplug;
+	return 0;
+}
+EXPORT_SYMBOL(class_simple_set_hotplug);
+	
+/**
  * class_simple_device_remove - removes a class device that was created with class_simple_device_add()
  * @dev: the dev_t of the device that was previously registered.
  *
===== include/linux/device.h 1.113 vs edited =====
--- 1.113/include/linux/device.h	Thu Jan 15 06:05:58 2004
+++ edited/include/linux/device.h	Fri Jan 23 19:06:04 2004
@@ -253,6 +253,8 @@
 extern void class_simple_destroy(struct class_simple *cs);
 extern struct class_device *class_simple_device_add(struct class_simple *cs, dev_t dev, struct device *device, const char *fmt, ...)
 	__attribute__((format(printf,4,5)));
+extern int class_simple_set_hotplug(struct class_simple *, 
+	int (*hotplug)(struct class_device *dev, char **envp, int num_envp, char *buffer, int buffer_size));
 extern void class_simple_device_remove(dev_t dev);
 
 

                 reply	other threads:[~2004-01-26 18:44 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=20040126184427.48357.qmail@web14912.mail.yahoo.com \
    --to=jonsmirl@yahoo.com \
    --cc=linux-hotplug@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.