From: Timur Tabi <timur@freescale.com>
To: linux-kernel@vger.kernel.org, gregkh@suse.de
Cc: Timur Tabi <timur@freescale.com>
Subject: Add a private_data pointer to struct device_attribute
Date: Fri, 16 Nov 2007 18:11:00 -0600 [thread overview]
Message-ID: <11952582603203-git-send-email-timur@freescale.com> (raw)
A private data pointer in struct device_attribute allows the 'show' and 'store'
functions to access instance data. This handy in situations where the
driver_data and platform_data pointers of 'struct device' are already used
for other purposes.
Signed-off-by: Timur Tabi <timur@freescale.com>
---
Greg, can you tell me if you think this patch is a good idea? It doesn't
appear to do any harm, and I'm working on an ALSA driver that could benefit
for this patch. I think 2.6.25 would be a good target.
include/linux/device.h | 1 +
1 files changed, 1 insertions(+), 0 deletions(-)
diff --git a/include/linux/device.h b/include/linux/device.h
index 2e15822..10708ee 100644
--- a/include/linux/device.h
+++ b/include/linux/device.h
@@ -344,6 +344,7 @@ struct device_attribute {
char *buf);
ssize_t (*store)(struct device *dev, struct device_attribute *attr,
const char *buf, size_t count);
+ void *private_data;
};
#define DEVICE_ATTR(_name,_mode,_show,_store) \
--
1.5.2.4
next reply other threads:[~2007-11-17 0:11 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-11-17 0:11 Timur Tabi [this message]
2007-11-17 1:06 ` Add a private_data pointer to struct device_attribute Greg KH
-- strict thread matches above, loose matches on Subject: below --
2007-11-17 1:15 Mikael Pettersson
2007-11-17 14:02 ` Timur Tabi
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=11952582603203-git-send-email-timur@freescale.com \
--to=timur@freescale.com \
--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 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.