aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorJames Morris <james.l.morris@oracle.com>2012-10-11 06:40:09 -0400
committerJames Morris <james.l.morris@oracle.com>2012-10-11 06:40:09 -0400
commitbb95a0d73bb69d73c16d32c10a0c31a32abddb03 (patch)
tree1ed36ec9effac9185636446fd445b11db6a15ad7 /drivers
parent12250d843e8489ee00b5b7726da855e51694e792 (diff)
parent1631cfb7cee28388b04aef6c0a73050f6fd76e4d (diff)
Merge branch 'tpmdd-fixes-v3.6' of git://github.com/shpedoikal/linux into for-linus
Diffstat (limited to 'drivers')
-rw-r--r--drivers/char/tpm/tpm.c3
-rw-r--r--drivers/char/tpm/tpm.h9
-rw-r--r--drivers/char/tpm/tpm_ppi.c18
3 files changed, 19 insertions, 11 deletions
diff --git a/drivers/char/tpm/tpm.c b/drivers/char/tpm/tpm.c
index f26afdb1a702..b429f1ea1b97 100644
--- a/drivers/char/tpm/tpm.c
+++ b/drivers/char/tpm/tpm.c
@@ -1259,6 +1259,7 @@ void tpm_remove_hardware(struct device *dev)
1259 1259
1260 misc_deregister(&chip->vendor.miscdev); 1260 misc_deregister(&chip->vendor.miscdev);
1261 sysfs_remove_group(&dev->kobj, chip->vendor.attr_group); 1261 sysfs_remove_group(&dev->kobj, chip->vendor.attr_group);
1262 tpm_remove_ppi(&dev->kobj);
1262 tpm_bios_log_teardown(chip->bios_dir); 1263 tpm_bios_log_teardown(chip->bios_dir);
1263 1264
1264 /* write it this way to be explicit (chip->dev == dev) */ 1265 /* write it this way to be explicit (chip->dev == dev) */
@@ -1476,7 +1477,7 @@ struct tpm_chip *tpm_register_hardware(struct device *dev,
1476 goto put_device; 1477 goto put_device;
1477 } 1478 }
1478 1479
1479 if (sys_add_ppi(&dev->kobj)) { 1480 if (tpm_add_ppi(&dev->kobj)) {
1480 misc_deregister(&chip->vendor.miscdev); 1481 misc_deregister(&chip->vendor.miscdev);
1481 goto put_device; 1482 goto put_device;
1482 } 1483 }
diff --git a/drivers/char/tpm/tpm.h b/drivers/char/tpm/tpm.h
index 02c266aa2bf7..8ef7649a50aa 100644
--- a/drivers/char/tpm/tpm.h
+++ b/drivers/char/tpm/tpm.h
@@ -329,10 +329,15 @@ extern int wait_for_tpm_stat(struct tpm_chip *, u8, unsigned long,
329 wait_queue_head_t *); 329 wait_queue_head_t *);
330 330
331#ifdef CONFIG_ACPI 331#ifdef CONFIG_ACPI
332extern ssize_t sys_add_ppi(struct kobject *parent); 332extern int tpm_add_ppi(struct kobject *);
333extern void tpm_remove_ppi(struct kobject *);
333#else 334#else
334static inline ssize_t sys_add_ppi(struct kobject *parent) 335static inline int tpm_add_ppi(struct kobject *parent)
335{ 336{
336 return 0; 337 return 0;
337} 338}
339
340static inline void tpm_remove_ppi(struct kobject *parent)
341{
342}
338#endif 343#endif
diff --git a/drivers/char/tpm/tpm_ppi.c b/drivers/char/tpm/tpm_ppi.c
index f27b58cfae98..720ebcf29fdf 100644
--- a/drivers/char/tpm/tpm_ppi.c
+++ b/drivers/char/tpm/tpm_ppi.c
@@ -444,18 +444,20 @@ static struct attribute *ppi_attrs[] = {
444 &dev_attr_vs_operations.attr, NULL, 444 &dev_attr_vs_operations.attr, NULL,
445}; 445};
446static struct attribute_group ppi_attr_grp = { 446static struct attribute_group ppi_attr_grp = {
447 .name = "ppi",
447 .attrs = ppi_attrs 448 .attrs = ppi_attrs
448}; 449};
449 450
450ssize_t sys_add_ppi(struct kobject *parent) 451int tpm_add_ppi(struct kobject *parent)
451{ 452{
452 struct kobject *ppi; 453 return sysfs_create_group(parent, &ppi_attr_grp);
453 ppi = kobject_create_and_add("ppi", parent); 454}
454 if (sysfs_create_group(ppi, &ppi_attr_grp)) 455EXPORT_SYMBOL_GPL(tpm_add_ppi);
455 return -EFAULT; 456
456 else 457void tpm_remove_ppi(struct kobject *parent)
457 return 0; 458{
459 sysfs_remove_group(parent, &ppi_attr_grp);
458} 460}
459EXPORT_SYMBOL_GPL(sys_add_ppi); 461EXPORT_SYMBOL_GPL(tpm_remove_ppi);
460 462
461MODULE_LICENSE("GPL"); 463MODULE_LICENSE("GPL");