aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/char/tpm/tpm.c
diff options
context:
space:
mode:
authorGang Wei <gang.wei@intel.com>2012-10-09 05:35:22 -0400
committerKent Yoder <key@linux.vnet.ibm.com>2012-10-10 10:50:56 -0400
commit1631cfb7cee28388b04aef6c0a73050f6fd76e4d (patch)
treec3c5d069dedb5c1084a18ddb3be06c6e9a6aa9de /drivers/char/tpm/tpm.c
parentecefbd94b834fa32559d854646d777c56749ef1c (diff)
driver/char/tpm: fix regression causesd by ppi
This patch try to fix the S3 regression https://lkml.org/lkml/2012/10/5/433, which includes below line: [ 1554.684638] sysfs: cannot create duplicate filename '/devices/pnp0/00:0c/ppi' The root cause is that ppi sysfs teardown code is MIA, so while S3 resume, the ppi kobject will be created again upon existing one. To make the tear down code simple, change the ppi subfolder creation from using kobject_create_and_add to just using a named ppi attribute_group. Then ppi sysfs teardown could be done with a simple sysfs_remove_group call. Adjusted the name & return type for ppi sysfs init function. Reported-by: Ben Guthro <ben@guthro.net> Signed-off-by: Gang Wei <gang.wei@intel.com> Signed-off-by: Kent Yoder <key@linux.vnet.ibm.com>
Diffstat (limited to 'drivers/char/tpm/tpm.c')
-rw-r--r--drivers/char/tpm/tpm.c3
1 files changed, 2 insertions, 1 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 }