public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] allow struct bin_attributes in class devices
@ 2004-12-22  0:19 Jesse Barnes
  2004-12-22  0:28 ` Greg KH
  0 siblings, 1 reply; 4+ messages in thread
From: Jesse Barnes @ 2004-12-22  0:19 UTC (permalink / raw)
  To: Greg KH, linux-kernel

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

This small patch adds routines to create and remove bin_attribute files for 
class devices.  One intended use is for binary files corresponding to PCI 
busses, like bus legacy I/O ports or ISA memory.

 drivers/base/class.c   |   16 ++++++++++++++++
 include/linux/device.h |    5 ++++-
 2 files changed, 20 insertions(+), 1 deletion(-)

Signed-off-by: Jesse Barnes <jbarnes@sgi.com>

Thanks,
Jesse

[-- Attachment #2: class-device-bin-files.patch --]
[-- Type: text/plain, Size: 1335 bytes --]

===== drivers/base/class.c 1.56 vs edited =====
--- 1.56/drivers/base/class.c	2004-11-12 03:45:39 -08:00
+++ edited/drivers/base/class.c	2004-12-21 13:59:00 -08:00
@@ -179,6 +179,22 @@
 		sysfs_remove_file(&class_dev->kobj, &attr->attr);
 }
 
+int class_device_create_bin_file(struct class_device *class_dev,
+				 struct bin_attribute *attr)
+{
+	int error = -EINVAL;
+	if (class_dev)
+		error = sysfs_create_bin_file(&class_dev->kobj, attr);
+	return error;
+}
+
+void class_device_remove_bin_file(struct class_device *class_dev,
+				  struct bin_attribute *attr)
+{
+	if (class_dev)
+		sysfs_remove_bin_file(&class_dev->kobj, attr);
+}
+
 static int class_device_dev_link(struct class_device * class_dev)
 {
 	if (class_dev->dev)
===== include/linux/device.h 1.133 vs edited =====
--- 1.133/include/linux/device.h	2004-12-08 15:22:36 -08:00
+++ edited/include/linux/device.h	2004-12-21 16:16:06 -08:00
@@ -228,7 +228,10 @@
 				    const struct class_device_attribute *);
 extern void class_device_remove_file(struct class_device *, 
 				     const struct class_device_attribute *);
-
+extern int class_device_create_bin_file(struct class_device *,
+					struct bin_attribute *);
+extern void class_device_remove_bin_file(struct class_device *,
+					 struct bin_attribute *);
 
 struct class_interface {
 	struct list_head	node;

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] allow struct bin_attributes in class devices
  2004-12-22  0:19 [PATCH] allow struct bin_attributes in class devices Jesse Barnes
@ 2004-12-22  0:28 ` Greg KH
  2004-12-22  0:30   ` Jesse Barnes
  0 siblings, 1 reply; 4+ messages in thread
From: Greg KH @ 2004-12-22  0:28 UTC (permalink / raw)
  To: Jesse Barnes; +Cc: linux-kernel

On Tue, Dec 21, 2004 at 04:19:52PM -0800, Jesse Barnes wrote:
> This small patch adds routines to create and remove bin_attribute files for 
> class devices.  One intended use is for binary files corresponding to PCI 
> busses, like bus legacy I/O ports or ISA memory.
> 
>  drivers/base/class.c   |   16 ++++++++++++++++
>  include/linux/device.h |    5 ++++-
>  2 files changed, 20 insertions(+), 1 deletion(-)
> 
> Signed-off-by: Jesse Barnes <jbarnes@sgi.com>

Ugh, we'll get this eventually... You forgot a EXPORT_SYMBOL_GPL() so
that modules can use these functions :)

Third time's a charm :)

thanks,

greg k-h

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] allow struct bin_attributes in class devices
  2004-12-22  0:28 ` Greg KH
@ 2004-12-22  0:30   ` Jesse Barnes
  2004-12-22  0:45     ` Greg KH
  0 siblings, 1 reply; 4+ messages in thread
From: Jesse Barnes @ 2004-12-22  0:30 UTC (permalink / raw)
  To: Greg KH; +Cc: linux-kernel

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

On Tuesday, December 21, 2004 4:28 pm, Greg KH wrote:
> On Tue, Dec 21, 2004 at 04:19:52PM -0800, Jesse Barnes wrote:
> > This small patch adds routines to create and remove bin_attribute files
> > for class devices.  One intended use is for binary files corresponding to
> > PCI busses, like bus legacy I/O ports or ISA memory.
> >
> >  drivers/base/class.c   |   16 ++++++++++++++++
> >  include/linux/device.h |    5 ++++-
> >  2 files changed, 20 insertions(+), 1 deletion(-)
> >
> > Signed-off-by: Jesse Barnes <jbarnes@sgi.com>
>
> Ugh, we'll get this eventually... You forgot a EXPORT_SYMBOL_GPL() so
> that modules can use these functions :)
>
> Third time's a charm :)

Doh!  Here you go.

Jesse


[-- Attachment #2: class-device-bin-files-2.patch --]
[-- Type: text/plain, Size: 1681 bytes --]

===== drivers/base/class.c 1.56 vs edited =====
--- 1.56/drivers/base/class.c	2004-11-12 03:45:39 -08:00
+++ edited/drivers/base/class.c	2004-12-21 16:29:34 -08:00
@@ -179,6 +179,22 @@
 		sysfs_remove_file(&class_dev->kobj, &attr->attr);
 }
 
+int class_device_create_bin_file(struct class_device *class_dev,
+				 struct bin_attribute *attr)
+{
+	int error = -EINVAL;
+	if (class_dev)
+		error = sysfs_create_bin_file(&class_dev->kobj, attr);
+	return error;
+}
+
+void class_device_remove_bin_file(struct class_device *class_dev,
+				  struct bin_attribute *attr)
+{
+	if (class_dev)
+		sysfs_remove_bin_file(&class_dev->kobj, attr);
+}
+
 static int class_device_dev_link(struct class_device * class_dev)
 {
 	if (class_dev->dev)
@@ -576,6 +592,8 @@
 EXPORT_SYMBOL_GPL(class_device_put);
 EXPORT_SYMBOL_GPL(class_device_create_file);
 EXPORT_SYMBOL_GPL(class_device_remove_file);
+EXPORT_SYMBOL_GPL(class_device_create_bin_file);
+EXPORT_SYMBOL_GPL(class_device_remove_bin_file);
 
 EXPORT_SYMBOL_GPL(class_interface_register);
 EXPORT_SYMBOL_GPL(class_interface_unregister);
===== include/linux/device.h 1.133 vs edited =====
--- 1.133/include/linux/device.h	2004-12-08 15:22:36 -08:00
+++ edited/include/linux/device.h	2004-12-21 16:16:06 -08:00
@@ -228,7 +228,10 @@
 				    const struct class_device_attribute *);
 extern void class_device_remove_file(struct class_device *, 
 				     const struct class_device_attribute *);
-
+extern int class_device_create_bin_file(struct class_device *,
+					struct bin_attribute *);
+extern void class_device_remove_bin_file(struct class_device *,
+					 struct bin_attribute *);
 
 struct class_interface {
 	struct list_head	node;

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] allow struct bin_attributes in class devices
  2004-12-22  0:30   ` Jesse Barnes
@ 2004-12-22  0:45     ` Greg KH
  0 siblings, 0 replies; 4+ messages in thread
From: Greg KH @ 2004-12-22  0:45 UTC (permalink / raw)
  To: Jesse Barnes; +Cc: linux-kernel

On Tue, Dec 21, 2004 at 04:30:36PM -0800, Jesse Barnes wrote:
> On Tuesday, December 21, 2004 4:28 pm, Greg KH wrote:
> > On Tue, Dec 21, 2004 at 04:19:52PM -0800, Jesse Barnes wrote:
> > > This small patch adds routines to create and remove bin_attribute files
> > > for class devices.  One intended use is for binary files corresponding to
> > > PCI busses, like bus legacy I/O ports or ISA memory.
> > >
> > >  drivers/base/class.c   |   16 ++++++++++++++++
> > >  include/linux/device.h |    5 ++++-
> > >  2 files changed, 20 insertions(+), 1 deletion(-)
> > >
> > > Signed-off-by: Jesse Barnes <jbarnes@sgi.com>
> >
> > Ugh, we'll get this eventually... You forgot a EXPORT_SYMBOL_GPL() so
> > that modules can use these functions :)
> >
> > Third time's a charm :)
> 
> Doh!  Here you go.

Applied, thanks.

greg k-h

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2004-12-22  0:46 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-12-22  0:19 [PATCH] allow struct bin_attributes in class devices Jesse Barnes
2004-12-22  0:28 ` Greg KH
2004-12-22  0:30   ` Jesse Barnes
2004-12-22  0:45     ` Greg KH

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox