diff options
author | Rajiv Andrade <srajiv@linux.vnet.ibm.com> | 2008-10-10 18:03:39 -0400 |
---|---|---|
committer | James Morris <jmorris@namei.org> | 2008-10-10 18:03:39 -0400 |
commit | f89c5edb86abfac4c914f4eb808b07684164eca0 (patch) | |
tree | aaaf692aa2c6a3daf9e32c2c4ec337526cd3809d /drivers/char/tpm | |
parent | b922df7383749a1c0b7ea64c50fa839263d3816b (diff) |
Remove the BKL calls from the TPM driver, which were added in the overall
misc-char-dev-BKL-pushdown.patch, as they are not needed.
Signed-off-by: Mimi Zohar <zohar@linux.vnet.ibm.com>
Signed-off-by: Rajiv Andrade <srajiv@linux.vnet.ibm.com>
Cc: "Serge E. Hallyn" <serue@us.ibm.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: James Morris <jmorris@namei.org>
Diffstat (limited to 'drivers/char/tpm')
-rw-r--r-- | drivers/char/tpm/tpm.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/drivers/char/tpm/tpm.c b/drivers/char/tpm/tpm.c index ae766d868454..ceba6082bd96 100644 --- a/drivers/char/tpm/tpm.c +++ b/drivers/char/tpm/tpm.c | |||
@@ -954,13 +954,16 @@ EXPORT_SYMBOL_GPL(tpm_store_cancel); | |||
954 | 954 | ||
955 | /* | 955 | /* |
956 | * Device file system interface to the TPM | 956 | * Device file system interface to the TPM |
957 | * | ||
958 | * It's assured that the chip will be opened just once, | ||
959 | * by the check of is_open variable, which is protected | ||
960 | * by driver_lock. | ||
957 | */ | 961 | */ |
958 | int tpm_open(struct inode *inode, struct file *file) | 962 | int tpm_open(struct inode *inode, struct file *file) |
959 | { | 963 | { |
960 | int rc = 0, minor = iminor(inode); | 964 | int rc = 0, minor = iminor(inode); |
961 | struct tpm_chip *chip = NULL, *pos; | 965 | struct tpm_chip *chip = NULL, *pos; |
962 | 966 | ||
963 | lock_kernel(); | ||
964 | spin_lock(&driver_lock); | 967 | spin_lock(&driver_lock); |
965 | 968 | ||
966 | list_for_each_entry(pos, &tpm_chip_list, list) { | 969 | list_for_each_entry(pos, &tpm_chip_list, list) { |
@@ -990,19 +993,16 @@ int tpm_open(struct inode *inode, struct file *file) | |||
990 | if (chip->data_buffer == NULL) { | 993 | if (chip->data_buffer == NULL) { |
991 | chip->num_opens--; | 994 | chip->num_opens--; |
992 | put_device(chip->dev); | 995 | put_device(chip->dev); |
993 | unlock_kernel(); | ||
994 | return -ENOMEM; | 996 | return -ENOMEM; |
995 | } | 997 | } |
996 | 998 | ||
997 | atomic_set(&chip->data_pending, 0); | 999 | atomic_set(&chip->data_pending, 0); |
998 | 1000 | ||
999 | file->private_data = chip; | 1001 | file->private_data = chip; |
1000 | unlock_kernel(); | ||
1001 | return 0; | 1002 | return 0; |
1002 | 1003 | ||
1003 | err_out: | 1004 | err_out: |
1004 | spin_unlock(&driver_lock); | 1005 | spin_unlock(&driver_lock); |
1005 | unlock_kernel(); | ||
1006 | return rc; | 1006 | return rc; |
1007 | } | 1007 | } |
1008 | EXPORT_SYMBOL_GPL(tpm_open); | 1008 | EXPORT_SYMBOL_GPL(tpm_open); |