diff options
author | Kylene Hall <kjhall@us.ibm.com> | 2005-06-23 22:02:00 -0700 |
---|---|---|
committer | Linus Torvalds <torvalds@ppc970.osdl.org> | 2005-06-24 00:05:26 -0700 |
commit | 6659ca2ab6730c3bbb9fa495f2327b95b955decd (patch) | |
tree | 1b8a9a09a830b0a5233c6e9f073c53260dbef819 /drivers/char/tpm/tpm_atmel.c | |
parent | 81179bb6a54c2c626b4cbcc084ca974bb2d7f2a3 (diff) |
[PATCH] tpm: sysfs owernship changes
In the current driver all sysfs files end up owned by the base driver module
rather than the module that actually owns the device this is a problem if the
module is unloaded and the file is open. This patch fixes all that and lumps
the files into an attribute_group.
Signed-off-by: Kylene Hall <kjhall@us.ibm.com>
Signed-off-by: Yani Ioannou <yani.ioannou@gmail.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'drivers/char/tpm/tpm_atmel.c')
-rw-r--r-- | drivers/char/tpm/tpm_atmel.c | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/drivers/char/tpm/tpm_atmel.c b/drivers/char/tpm/tpm_atmel.c index 3271391892e..07abfb7143b 100644 --- a/drivers/char/tpm/tpm_atmel.c +++ b/drivers/char/tpm/tpm_atmel.c @@ -126,6 +126,21 @@ static struct file_operations atmel_ops = { .release = tpm_release, }; +static DEVICE_ATTR(pubek, S_IRUGO, tpm_show_pubek, NULL); +static DEVICE_ATTR(pcrs, S_IRUGO, tpm_show_pcrs, NULL); +static DEVICE_ATTR(caps, S_IRUGO, tpm_show_caps, NULL); +static DEVICE_ATTR(cancel, S_IWUSR |S_IWGRP, NULL, tpm_store_cancel); + +static struct attribute* atmel_attrs[] = { + &dev_attr_pubek.attr, + &dev_attr_pcrs.attr, + &dev_attr_caps.attr, + &dev_attr_cancel.attr, + 0, +}; + +static struct attribute_group atmel_attr_grp = { .attrs = atmel_attrs }; + static struct tpm_vendor_specific tpm_atmel = { .recv = tpm_atml_recv, .send = tpm_atml_send, @@ -133,6 +148,7 @@ static struct tpm_vendor_specific tpm_atmel = { .req_complete_mask = ATML_STATUS_BUSY | ATML_STATUS_DATA_AVAIL, .req_complete_val = ATML_STATUS_DATA_AVAIL, .base = TPM_ATML_BASE, + .attr_group = &atmel_attr_grp, .miscdev = { .fops = &atmel_ops, }, }; |