Skip to content

Commit

Permalink
Remove the BKL calls from the TPM driver, which were added in the ove…
Browse files Browse the repository at this point in the history
…rall

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>
  • Loading branch information
Rajiv Andrade authored and James Morris committed Oct 10, 2008
1 parent b922df7 commit f89c5ed
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions drivers/char/tpm/tpm.c
Original file line number Diff line number Diff line change
Expand Up @@ -954,13 +954,16 @@ EXPORT_SYMBOL_GPL(tpm_store_cancel);

/*
* Device file system interface to the TPM
*
* It's assured that the chip will be opened just once,
* by the check of is_open variable, which is protected
* by driver_lock.
*/
int tpm_open(struct inode *inode, struct file *file)
{
int rc = 0, minor = iminor(inode);
struct tpm_chip *chip = NULL, *pos;

lock_kernel();
spin_lock(&driver_lock);

list_for_each_entry(pos, &tpm_chip_list, list) {
Expand Down Expand Up @@ -990,19 +993,16 @@ int tpm_open(struct inode *inode, struct file *file)
if (chip->data_buffer == NULL) {
chip->num_opens--;
put_device(chip->dev);
unlock_kernel();
return -ENOMEM;
}

atomic_set(&chip->data_pending, 0);

file->private_data = chip;
unlock_kernel();
return 0;

err_out:
spin_unlock(&driver_lock);
unlock_kernel();
return rc;
}
EXPORT_SYMBOL_GPL(tpm_open);
Expand Down

0 comments on commit f89c5ed

Please sign in to comment.