aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/char/tpm/tpm_nsc.c
diff options
context:
space:
mode:
authorKylene Hall <kjhall@us.ibm.com>2005-06-24 01:02:00 -0400
committerLinus Torvalds <torvalds@ppc970.osdl.org>2005-06-24 03:05:26 -0400
commit6659ca2ab6730c3bbb9fa495f2327b95b955decd (patch)
tree1b8a9a09a830b0a5233c6e9f073c53260dbef819 /drivers/char/tpm/tpm_nsc.c
parent81179bb6a54c2c626b4cbcc084ca974bb2d7f2a3 (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_nsc.c')
-rw-r--r--drivers/char/tpm/tpm_nsc.c17
1 files changed, 16 insertions, 1 deletions
diff --git a/drivers/char/tpm/tpm_nsc.c b/drivers/char/tpm/tpm_nsc.c
index 24832abe0b2d..675290169508 100644
--- a/drivers/char/tpm/tpm_nsc.c
+++ b/drivers/char/tpm/tpm_nsc.c
@@ -224,6 +224,21 @@ static struct file_operations nsc_ops = {
224 .release = tpm_release, 224 .release = tpm_release,
225}; 225};
226 226
227static DEVICE_ATTR(pubek, S_IRUGO, tpm_show_pubek, NULL);
228static DEVICE_ATTR(pcrs, S_IRUGO, tpm_show_pcrs, NULL);
229static DEVICE_ATTR(caps, S_IRUGO, tpm_show_caps, NULL);
230static DEVICE_ATTR(cancel, S_IWUSR|S_IWGRP, NULL, tpm_store_cancel);
231
232static struct attribute * nsc_attrs[] = {
233 &dev_attr_pubek.attr,
234 &dev_attr_pcrs.attr,
235 &dev_attr_caps.attr,
236 &dev_attr_cancel.attr,
237 0,
238};
239
240static struct attribute_group nsc_attr_grp = { .attrs = nsc_attrs };
241
227static struct tpm_vendor_specific tpm_nsc = { 242static struct tpm_vendor_specific tpm_nsc = {
228 .recv = tpm_nsc_recv, 243 .recv = tpm_nsc_recv,
229 .send = tpm_nsc_send, 244 .send = tpm_nsc_send,
@@ -231,8 +246,8 @@ static struct tpm_vendor_specific tpm_nsc = {
231 .req_complete_mask = NSC_STATUS_OBF, 246 .req_complete_mask = NSC_STATUS_OBF,
232 .req_complete_val = NSC_STATUS_OBF, 247 .req_complete_val = NSC_STATUS_OBF,
233 .base = TPM_NSC_BASE, 248 .base = TPM_NSC_BASE,
249 .attr_group = &nsc_attr_grp,
234 .miscdev = { .fops = &nsc_ops, }, 250 .miscdev = { .fops = &nsc_ops, },
235
236}; 251};
237 252
238static int __devinit tpm_nsc_init(struct pci_dev *pci_dev, 253static int __devinit tpm_nsc_init(struct pci_dev *pci_dev,