From: Rajiv Andrade <srajiv@linux.vnet.ibm.com>
To: linux-kernel@vger.kernel.org
Cc: akpm@linux-foundation.org, jmoriss@namei.org,
serue@linux.vnet.ibm.com, zohar@linux.vnet.ibm.com,
safford@watson.ibm.com, paulmck@linux.vnet.ibm.com,
debora@linux.vnet.ibm.com
Subject: [PATCH 1/4] TPM: update char dev BKL pushdown
Date: Tue, 23 Sep 2008 14:19:26 -0300 [thread overview]
Message-ID: <1222190371-23814-1-git-send-email-srajiv@linux.vnet.ibm.com> (raw)
In-Reply-To: <cover.1222136544.git.srajiv@linux.vnet.ibm.com>
This patch removes 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>
---
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 ae766d8..ceba608 100644
--- a/drivers/char/tpm/tpm.c
+++ b/drivers/char/tpm/tpm.c
@@ -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) {
@@ -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);
--
1.5.6.3
next prev parent reply other threads:[~2008-09-23 17:21 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-09-23 17:19 [PATCH 0/4] BKL removed, RCU addition and pnp remove Rajiv Andrade
2008-09-23 17:19 ` Rajiv Andrade [this message]
2008-09-23 20:58 ` [PATCH 1/4] TPM: update char dev BKL pushdown Jonathan Corbet
2008-09-24 13:14 ` Rajiv Andrade
2008-09-23 17:19 ` [PATCH 2/4] TPM: num_opens to is_open variable change Rajiv Andrade
2008-09-23 17:19 ` [PATCH 3/4] TPM: rcu locking Rajiv Andrade
2008-09-23 18:19 ` Paul E. McKenney
2008-09-23 20:18 ` Rajiv Andrade
2008-09-23 20:27 ` Paul E. McKenney
2008-09-25 13:36 ` Serge E. Hallyn
2008-09-25 14:33 ` Paul E. McKenney
2008-09-25 14:59 ` Serge E. Hallyn
2008-09-23 20:19 ` [PATCH 3/4][resubmit] " Rajiv Andrade
2008-09-23 21:01 ` Jonathan Corbet
2008-09-23 21:27 ` Mimi Zohar
2008-09-24 13:10 ` Rajiv Andrade
2008-09-25 13:39 ` Serge E. Hallyn
2008-09-25 13:29 ` [PATCH 3/4] " Serge E. Hallyn
2008-09-23 17:19 ` [PATCH 4/4] TPM: addition of pnp remove Rajiv Andrade
2008-09-23 17:38 ` about kernel_physical_mapping_init Joilnen Leite
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1222190371-23814-1-git-send-email-srajiv@linux.vnet.ibm.com \
--to=srajiv@linux.vnet.ibm.com \
--cc=akpm@linux-foundation.org \
--cc=debora@linux.vnet.ibm.com \
--cc=jmoriss@namei.org \
--cc=linux-kernel@vger.kernel.org \
--cc=paulmck@linux.vnet.ibm.com \
--cc=safford@watson.ibm.com \
--cc=serue@linux.vnet.ibm.com \
--cc=zohar@linux.vnet.ibm.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®