From: Rajiv Andrade <srajiv@linux.vnet.ibm.com>
To: Rajiv Andrade <srajiv@linux.vnet.ibm.com>
Cc: Christophe Henri RICARD <christophe-h.ricard@st.com>,
Mohamed TABET <mohamed.tabet@st.com>,
Marcel Selhorst <m.selhorst@sirrix.com>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
James Morris <jmorris@namei.org>,
"joe@perches.com" <joe@perches.com>,
matt mooney <mfm@muteddisk.com>, Sean NEWTON <sean.newton@st.com>,
Jean-Luc BLANC <jean-luc.blanc@st.com>
Subject: Re: [PATCH 1/1] TPM: new stm i2c device driver
Date: Fri, 16 Sep 2011 16:01:11 -0300 [thread overview]
Message-ID: <4E739CF7.2000202@linux.vnet.ibm.com> (raw)
In-Reply-To: <4E60EC61.4030004@linux.vnet.ibm.com>
On 02-09-2011 11:46, Rajiv Andrade wrote:
>>>>> +static int wait_for_stat(struct tpm_chip *chip, u8 mask, unsigned long timeout,
>>>>> >>>> + wait_queue_head_t *queue)
> Sounds a copy & paste issue here, but *queue isn't being used here.
>>>>> >>>> +{
>>>>> >>>> + unsigned long stop;
>>>>> >>>> + u8 status;
>>>>> >>>> +
>>>>> >>>> + FUNC_ENTER();
>>>>> >>>> +
>>>>> >>>> + /* check current status */
>>>>> >>>> + status = tpm_stm_i2c_status(chip);
>>>>> >>>> + if (status == mask)
>>>>> >>>> + return 0;
>>>>> >>>> + if (status == TPM_STS_CANCEL)
>>>>> >>>> + goto end;
>>>>> >>>> + stop = jiffies + timeout;
>>>>> >>>> + do {
>>>>> >>>> + msleep(TPM_TIMEOUT);
>>>>> >>>> + status = tpm_stm_i2c_status(chip);
>>>>> >>>> + if ((status & mask) == mask)
>>>>> >>>> + return 0;
>>>>> >>>> + } while (time_before(jiffies, stop));
>>>>> >>>> +end:
>>>>> >>>> + return -ETIME;
>>>>> >>>> +}
>>>>> >>>> +
> This is very similar to what's in tpm_tis.c, given there's one more user for it now, it's a good time
> to move it to tpm.c and provide it tpm_stm_i2c_status or tpm_tis_status as a function pointer.
Just moved wait_for_stat to tpm.c so other drivers can use it. The changes were committed to:
github.com:srajiv/tpm.git
Rajiv
next prev parent reply other threads:[~2011-09-16 19:01 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-01-17 23:34 [PATCH 1/3] TPM: new stm i2c device driver Christophe Henri RICARD
2011-08-25 14:34 ` Christophe Henri RICARD
2011-08-25 15:00 ` Mohamed TABET
2011-08-25 18:53 ` Rajiv Andrade
2011-08-25 19:05 ` [PATCH 1/1] " Christophe Henri RICARD
2011-09-02 12:55 ` Mohamed TABET
2011-09-02 14:46 ` Rajiv Andrade
2011-09-16 19:01 ` Rajiv Andrade [this message]
2011-09-19 13:37 ` Mohamed TABET
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=4E739CF7.2000202@linux.vnet.ibm.com \
--to=srajiv@linux.vnet.ibm.com \
--cc=christophe-h.ricard@st.com \
--cc=jean-luc.blanc@st.com \
--cc=jmorris@namei.org \
--cc=joe@perches.com \
--cc=linux-kernel@vger.kernel.org \
--cc=m.selhorst@sirrix.com \
--cc=mfm@muteddisk.com \
--cc=mohamed.tabet@st.com \
--cc=sean.newton@st.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.