Skip to content

Commit

Permalink
Merge branch 'tpmdd-fixes-v3.6' of git://github.com/shpedoikal/linux …
Browse files Browse the repository at this point in the history
…into for-linus
  • Loading branch information
James Morris committed Oct 11, 2012
2 parents 12250d8 + 1631cfb commit bb95a0d
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 11 deletions.
3 changes: 2 additions & 1 deletion drivers/char/tpm/tpm.c
Original file line number Diff line number Diff line change
Expand Up @@ -1259,6 +1259,7 @@ void tpm_remove_hardware(struct device *dev)

misc_deregister(&chip->vendor.miscdev);
sysfs_remove_group(&dev->kobj, chip->vendor.attr_group);
tpm_remove_ppi(&dev->kobj);
tpm_bios_log_teardown(chip->bios_dir);

/* write it this way to be explicit (chip->dev == dev) */
Expand Down Expand Up @@ -1476,7 +1477,7 @@ struct tpm_chip *tpm_register_hardware(struct device *dev,
goto put_device;
}

if (sys_add_ppi(&dev->kobj)) {
if (tpm_add_ppi(&dev->kobj)) {
misc_deregister(&chip->vendor.miscdev);
goto put_device;
}
Expand Down
9 changes: 7 additions & 2 deletions drivers/char/tpm/tpm.h
Original file line number Diff line number Diff line change
Expand Up @@ -329,10 +329,15 @@ extern int wait_for_tpm_stat(struct tpm_chip *, u8, unsigned long,
wait_queue_head_t *);

#ifdef CONFIG_ACPI
extern ssize_t sys_add_ppi(struct kobject *parent);
extern int tpm_add_ppi(struct kobject *);
extern void tpm_remove_ppi(struct kobject *);
#else
static inline ssize_t sys_add_ppi(struct kobject *parent)
static inline int tpm_add_ppi(struct kobject *parent)
{
return 0;
}

static inline void tpm_remove_ppi(struct kobject *parent)
{
}
#endif
18 changes: 10 additions & 8 deletions drivers/char/tpm/tpm_ppi.c
Original file line number Diff line number Diff line change
Expand Up @@ -444,18 +444,20 @@ static struct attribute *ppi_attrs[] = {
&dev_attr_vs_operations.attr, NULL,
};
static struct attribute_group ppi_attr_grp = {
.name = "ppi",
.attrs = ppi_attrs
};

ssize_t sys_add_ppi(struct kobject *parent)
int tpm_add_ppi(struct kobject *parent)
{
struct kobject *ppi;
ppi = kobject_create_and_add("ppi", parent);
if (sysfs_create_group(ppi, &ppi_attr_grp))
return -EFAULT;
else
return 0;
return sysfs_create_group(parent, &ppi_attr_grp);
}
EXPORT_SYMBOL_GPL(tpm_add_ppi);

void tpm_remove_ppi(struct kobject *parent)
{
sysfs_remove_group(parent, &ppi_attr_grp);
}
EXPORT_SYMBOL_GPL(sys_add_ppi);
EXPORT_SYMBOL_GPL(tpm_remove_ppi);

MODULE_LICENSE("GPL");

0 comments on commit bb95a0d

Please sign in to comment.