* new class_simple support in 2.6.2
@ 2004-01-23 3:48 Jon Smirl
2004-01-23 4:31 ` Greg KH
` (4 more replies)
0 siblings, 5 replies; 6+ messages in thread
From: Jon Smirl @ 2004-01-23 3:48 UTC (permalink / raw)
To: linux-hotplug
The definition of 'struct class_simple' is hidden. How am I supposed to access
the embedded 'struct class' to set the pointer to my hotplug function?
==Jon Smirl
jonsmirl@yahoo.com
__________________________________
Do you Yahoo!?
Yahoo! SiteBuilder - Free web site building tool. Try it!
http://webhosting.yahoo.com/ps/sb/
-------------------------------------------------------
The SF.Net email is sponsored by EclipseCon 2004
Premiere Conference on Open Tools Development and Integration
See the breadth of Eclipse activity. February 3-5 in Anaheim, CA.
http://www.eclipsecon.org/osdn
_______________________________________________
Linux-hotplug-devel mailing list http://linux-hotplug.sourceforge.net
Linux-hotplug-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: new class_simple support in 2.6.2
2004-01-23 3:48 new class_simple support in 2.6.2 Jon Smirl
@ 2004-01-23 4:31 ` Greg KH
2004-01-23 4:36 ` Jon Smirl
` (3 subsequent siblings)
4 siblings, 0 replies; 6+ messages in thread
From: Greg KH @ 2004-01-23 4:31 UTC (permalink / raw)
To: linux-hotplug
On Thu, Jan 22, 2004 at 07:48:07PM -0800, Jon Smirl wrote:
> The definition of 'struct class_simple' is hidden. How am I supposed to access
> the embedded 'struct class' to set the pointer to my hotplug function?
You aren't :)
If you want to do something like set the hotplug function, or anything
else "not simple", you need to just use a struct class, and manage your
struct class_device structures yourself.
Is this ok?
thanks,
greg k-h
-------------------------------------------------------
The SF.Net email is sponsored by EclipseCon 2004
Premiere Conference on Open Tools Development and Integration
See the breadth of Eclipse activity. February 3-5 in Anaheim, CA.
http://www.eclipsecon.org/osdn
_______________________________________________
Linux-hotplug-devel mailing list http://linux-hotplug.sourceforge.net
Linux-hotplug-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: new class_simple support in 2.6.2
2004-01-23 3:48 new class_simple support in 2.6.2 Jon Smirl
2004-01-23 4:31 ` Greg KH
@ 2004-01-23 4:36 ` Jon Smirl
2004-01-23 23:03 ` Greg KH
` (2 subsequent siblings)
4 siblings, 0 replies; 6+ messages in thread
From: Jon Smirl @ 2004-01-23 4:36 UTC (permalink / raw)
To: linux-hotplug
I don't need to do anything to class_simple except set the hotplug pointer.
Everything else it provides was fine for me. Could we just add the hotplug
function as a parameter to class_simple_create()?
--- Greg KH <greg@kroah.com> wrote:
> On Thu, Jan 22, 2004 at 07:48:07PM -0800, Jon Smirl wrote:
> > The definition of 'struct class_simple' is hidden. How am I supposed to
> access
> > the embedded 'struct class' to set the pointer to my hotplug function?
>
> You aren't :)
>
> If you want to do something like set the hotplug function, or anything
> else "not simple", you need to just use a struct class, and manage your
> struct class_device structures yourself.
>
> Is this ok?
>
> thanks,
>
> greg k-h
==Jon Smirl
jonsmirl@yahoo.com
__________________________________
Do you Yahoo!?
Yahoo! SiteBuilder - Free web site building tool. Try it!
http://webhosting.yahoo.com/ps/sb/
-------------------------------------------------------
The SF.Net email is sponsored by EclipseCon 2004
Premiere Conference on Open Tools Development and Integration
See the breadth of Eclipse activity. February 3-5 in Anaheim, CA.
http://www.eclipsecon.org/osdn
_______________________________________________
Linux-hotplug-devel mailing list http://linux-hotplug.sourceforge.net
Linux-hotplug-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: new class_simple support in 2.6.2
2004-01-23 3:48 new class_simple support in 2.6.2 Jon Smirl
2004-01-23 4:31 ` Greg KH
2004-01-23 4:36 ` Jon Smirl
@ 2004-01-23 23:03 ` Greg KH
2004-01-24 0:24 ` Jon Smirl
2004-02-02 23:35 ` Greg KH
4 siblings, 0 replies; 6+ messages in thread
From: Greg KH @ 2004-01-23 23:03 UTC (permalink / raw)
To: linux-hotplug
On Thu, Jan 22, 2004 at 08:36:12PM -0800, Jon Smirl wrote:
> I don't need to do anything to class_simple except set the hotplug pointer.
> Everything else it provides was fine for me. Could we just add the hotplug
> function as a parameter to class_simple_create()?
How about a function that sets the hotplug pointer? Something like:
class_simple_set_hotplug(struct class_simple *, hotplug *...)
That wouldn't burden 99% of the users of the class_simple code :)
Care to send me a patch for it?
thanks,
greg k-h
-------------------------------------------------------
The SF.Net email is sponsored by EclipseCon 2004
Premiere Conference on Open Tools Development and Integration
See the breadth of Eclipse activity. February 3-5 in Anaheim, CA.
http://www.eclipsecon.org/osdn
_______________________________________________
Linux-hotplug-devel mailing list http://linux-hotplug.sourceforge.net
Linux-hotplug-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: new class_simple support in 2.6.2
2004-01-23 3:48 new class_simple support in 2.6.2 Jon Smirl
` (2 preceding siblings ...)
2004-01-23 23:03 ` Greg KH
@ 2004-01-24 0:24 ` Jon Smirl
2004-02-02 23:35 ` Greg KH
4 siblings, 0 replies; 6+ messages in thread
From: Jon Smirl @ 2004-01-24 0:24 UTC (permalink / raw)
To: linux-hotplug
[-- Attachment #1: Type: text/plain, Size: 216 bytes --]
Here's a set hotplug implementation.
=====
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);
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: new class_simple support in 2.6.2
2004-01-23 3:48 new class_simple support in 2.6.2 Jon Smirl
` (3 preceding siblings ...)
2004-01-24 0:24 ` Jon Smirl
@ 2004-02-02 23:35 ` Greg KH
4 siblings, 0 replies; 6+ messages in thread
From: Greg KH @ 2004-02-02 23:35 UTC (permalink / raw)
To: linux-hotplug
On Fri, Jan 23, 2004 at 04:24:00PM -0800, Jon Smirl wrote:
> Here's a set hotplug implementation.
Thanks, I've applied this, and it will show up in the next -mm tree, and
eventually Linus's tree.
greg k-h
-------------------------------------------------------
The SF.Net email is sponsored by EclipseCon 2004
Premiere Conference on Open Tools Development and Integration
See the breadth of Eclipse activity. February 3-5 in Anaheim, CA.
http://www.eclipsecon.org/osdn
_______________________________________________
Linux-hotplug-devel mailing list http://linux-hotplug.sourceforge.net
Linux-hotplug-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2004-02-02 23:35 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-01-23 3:48 new class_simple support in 2.6.2 Jon Smirl
2004-01-23 4:31 ` Greg KH
2004-01-23 4:36 ` Jon Smirl
2004-01-23 23:03 ` Greg KH
2004-01-24 0:24 ` Jon Smirl
2004-02-02 23:35 ` Greg KH
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).