From: Yani Ioannou <yani.ioannou@gmail.com>
To: Greg KH <greg@kroah.com>, linux-kernel@vger.kernel.org
Subject: [PATCH 2.6.12-rc4] include/linux:(dynamic sysfs callbacks) new attribute macros
Date: Sat, 14 May 2005 05:38:43 -0400 [thread overview]
Message-ID: <2538186705051402386375a3d9@mail.gmail.com> (raw)
[-- Attachment #1: Type: text/plain, Size: 341 bytes --]
Hi,
The following patch adds a new __ATTR_PRIVATE macro and a
DEVICE_ATTR_PRIVATE macro to be used when creating static device
attributes with a void * member.
Signed-off-by: Yani Ioannou <yani.ioannou@gmail.com>
Thanks,
Yani
---
device.h | 3 +++
sysfs.h | 11 +++++++++++
2 files changed, 14 insertions(+)
---
[-- Attachment #2: patch-linux-2.6.12-rc4-sysfsdyncallback-deviceattr-macro.diff --]
[-- Type: text/x-patch, Size: 1711 bytes --]
diff -uprN -X dontdiff linux-2.6.12-rc4-sysfsdyncallback-deviceattr/include/linux/device.h linux-2.6.12-rc4-sysfsdyncallback-deviceattr-macro/include/linux/device.h
--- linux-2.6.12-rc4-sysfsdyncallback-deviceattr/include/linux/device.h 2005-05-13 01:02:10.000000000 -0400
+++ linux-2.6.12-rc4-sysfsdyncallback-deviceattr-macro/include/linux/device.h 2005-05-13 01:09:27.000000000 -0400
@@ -343,6 +343,9 @@ struct device_attribute {
#define DEVICE_ATTR(_name,_mode,_show,_store) \
struct device_attribute dev_attr_##_name = __ATTR(_name,_mode,_show,_store)
+#define DEVICE_ATTR_PRIVATE(_name,_mode,_show,_store,_private) \
+struct device_attribute dev_attr_##_name = \
+ __ATTR_PRIVATE(_name,_mode,_show,_store,_private)
extern int device_create_file(struct device *device, struct device_attribute * entry);
extern void device_remove_file(struct device * dev, struct device_attribute * attr);
diff -uprN -X dontdiff linux-2.6.12-rc4-sysfsdyncallback-deviceattr/include/linux/sysfs.h linux-2.6.12-rc4-sysfsdyncallback-deviceattr-macro/include/linux/sysfs.h
--- linux-2.6.12-rc4-sysfsdyncallback-deviceattr/include/linux/sysfs.h 2005-05-13 01:02:10.000000000 -0400
+++ linux-2.6.12-rc4-sysfsdyncallback-deviceattr-macro/include/linux/sysfs.h 2005-05-13 01:08:09.000000000 -0400
@@ -45,6 +45,17 @@ struct attribute_group {
.store = _store, \
}
+#define __ATTR_PRIVATE(_name,_mode,_show,_store,_private) { \
+ .attr = { \
+ .name = __stringify(_name), \
+ .mode = _mode, \
+ .private = _private, \
+ .owner = THIS_MODULE, \
+ }, \
+ .show = _show, \
+ .store = _store, \
+}
+
#define __ATTR_RO(_name) { \
.attr = { \
.name = __stringify(_name), \
reply other threads:[~2005-05-14 10:04 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=2538186705051402386375a3d9@mail.gmail.com \
--to=yani.ioannou@gmail.com \
--cc=greg@kroah.com \
--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