From: Peter Huewe <peterhuewe@gmx.de>
To: james.l.morris@oracle.com, tpmdd-devel@lists.sourceforge.net,
adlai@linux.vnet.ibm.com
Cc: linux-kernel@vger.kernel.org,
Jason Gunthorpe <jgunthorpe@obsidianresearch.com>,
Mathias Leblanc <mathias.leblanc@st.com>,
Peter Huewe <peterhuewe@gmx.de>
Subject: [PATCH 07/15] tpm: st33: Remove chip->data_buffer access from this driver
Date: Tue, 22 Oct 2013 20:00:32 +0200 [thread overview]
Message-ID: <1382464840-7639-7-git-send-email-peterhuewe@gmx.de> (raw)
In-Reply-To: <1382464840-7639-6-git-send-email-peterhuewe@gmx.de>
From: Jason Gunthorpe <jgunthorpe@obsidianresearch.com>
For some reason this driver thinks that chip->data_buffer needs
to be set before it can call tpm_pm_*. This is not true. data_buffer
is used only by /dev/tpmX, which is why it is managed exclusively
by the fops functions.
Cc: Mathias Leblanc <mathias.leblanc@st.com>
Signed-off-by: Jason Gunthorpe <jgunthorpe@obsidianresearch.com>
Reviewed-by: Joel Schopp <jschopp@linux.vnet.ibm.com>
Signed-off-by: Peter Huewe <peterhuewe@gmx.de>
---
drivers/char/tpm/tpm_i2c_stm_st33.c | 8 --------
1 files changed, 0 insertions(+), 8 deletions(-)
diff --git a/drivers/char/tpm/tpm_i2c_stm_st33.c b/drivers/char/tpm/tpm_i2c_stm_st33.c
index 1c68d93..b2390b6 100644
--- a/drivers/char/tpm/tpm_i2c_stm_st33.c
+++ b/drivers/char/tpm/tpm_i2c_stm_st33.c
@@ -805,24 +805,18 @@ static int tpm_st33_i2c_remove(struct i2c_client *client)
#ifdef CONFIG_PM_SLEEP
/*
* tpm_st33_i2c_pm_suspend suspend the TPM device
- * Added: Work around when suspend and no tpm application is running, suspend
- * may fail because chip->data_buffer is not set (only set in tpm_open in Linux
- * TPM core)
* @param: client, the i2c_client drescription (TPM I2C description).
* @param: mesg, the power management message.
* @return: 0 in case of success.
*/
static int tpm_st33_i2c_pm_suspend(struct device *dev)
{
- struct tpm_chip *chip = dev_get_drvdata(dev);
struct st33zp24_platform_data *pin_infos = dev->platform_data;
int ret = 0;
if (power_mgt) {
gpio_set_value(pin_infos->io_lpcpd, 0);
} else {
- if (chip->data_buffer == NULL)
- chip->data_buffer = pin_infos->tpm_i2c_buffer[0];
ret = tpm_pm_suspend(dev);
}
return ret;
@@ -847,8 +841,6 @@ static int tpm_st33_i2c_pm_resume(struct device *dev)
TPM_STS_VALID) == TPM_STS_VALID,
chip->vendor.timeout_b);
} else {
- if (chip->data_buffer == NULL)
- chip->data_buffer = pin_infos->tpm_i2c_buffer[0];
ret = tpm_pm_resume(dev);
if (!ret)
tpm_do_selftest(chip);
--
1.7.5.4
next prev parent reply other threads:[~2013-10-22 18:01 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-10-22 18:00 [PATCH 06/15] tpm: Remove redundant dev_set_drvdata Peter Huewe
2013-10-22 18:00 ` Peter Huewe [this message]
2013-10-22 18:00 ` [PATCH 08/15] tpm: Remove tpm_show_caps_1_2 Peter Huewe
2013-10-22 18:00 ` [PATCH 09/15] tpm: cleanup checkpatch warnings Peter Huewe
2013-10-22 18:00 ` [PATCH 10/15] tpm: Rename tpm.c to tpm-interface.c Peter Huewe
2013-10-22 18:00 ` [PATCH 11/15] tpm: Merge the tpm-bios module with tpm.o Peter Huewe
2013-10-22 18:00 ` [PATCH 12/15] tpm: Add support for the Nuvoton NPCT501 I2C TPM Peter Huewe
2013-10-22 18:00 ` [PATCH 13/15] tpm: Add support for Atmel I2C TPMs Peter Huewe
2013-10-22 18:00 ` [PATCH 14/15] tpm: Fix module name description in Kconfig for tpm_i2c_infineon Peter Huewe
2013-10-22 18:00 ` [PATCH 15/15] tpm: use tabs instead of whitespaces in Kconfig Peter Huewe
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=1382464840-7639-7-git-send-email-peterhuewe@gmx.de \
--to=peterhuewe@gmx.de \
--cc=adlai@linux.vnet.ibm.com \
--cc=james.l.morris@oracle.com \
--cc=jgunthorpe@obsidianresearch.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mathias.leblanc@st.com \
--cc=tpmdd-devel@lists.sourceforge.net \
/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®