summaryrefslogtreecommitdiffstats
path: root/drivers/char/tpm/tpm_ppi.c
diff options
context:
space:
mode:
authorRalf Baechle <ralf@linux-mips.org>2014-06-04 22:53:02 +0200
committerRalf Baechle <ralf@linux-mips.org>2014-06-04 22:53:02 +0200
commitf8647b506d7116a1a3accd8d618184096e85f50b (patch)
treef10bc7201fda2a36c035548a0ea62210ad57adb6 /drivers/char/tpm/tpm_ppi.c
parentMIPS: IP22/IP28: Improve GIO support (diff)
parentMIPS: Call find_vma with the mmap_sem held (diff)
downloadlinux-f8647b506d7116a1a3accd8d618184096e85f50b.tar.xz
linux-f8647b506d7116a1a3accd8d618184096e85f50b.zip
Merge branch '3.15-fixes' into mips-for-linux-next
Diffstat (limited to 'drivers/char/tpm/tpm_ppi.c')
-rw-r--r--drivers/char/tpm/tpm_ppi.c8
1 files changed, 3 insertions, 5 deletions
diff --git a/drivers/char/tpm/tpm_ppi.c b/drivers/char/tpm/tpm_ppi.c
index b3ea223585bd..61dcc8011ec7 100644
--- a/drivers/char/tpm/tpm_ppi.c
+++ b/drivers/char/tpm/tpm_ppi.c
@@ -328,13 +328,11 @@ int tpm_add_ppi(struct kobject *parent)
/* Cache TPM ACPI handle and version string */
acpi_walk_namespace(ACPI_TYPE_DEVICE, ACPI_ROOT_OBJECT, ACPI_UINT32_MAX,
ppi_callback, NULL, NULL, &tpm_ppi_handle);
- if (tpm_ppi_handle == NULL)
- return -ENODEV;
-
- return sysfs_create_group(parent, &ppi_attr_grp);
+ return tpm_ppi_handle ? sysfs_create_group(parent, &ppi_attr_grp) : 0;
}
void tpm_remove_ppi(struct kobject *parent)
{
- sysfs_remove_group(parent, &ppi_attr_grp);
+ if (tpm_ppi_handle)
+ sysfs_remove_group(parent, &ppi_attr_grp);
}