[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <8F888FAFF364DD4D9683684315E0207DD26171E591@SAFEX1MAIL3.st.com>
Date: Mon, 19 Sep 2011 15:37:47 +0200
From: Mohamed TABET <mohamed.tabet@...com>
To: Rajiv Andrade <srajiv@...ux.vnet.ibm.com>,
Christophe DELAUNAY <christophe.delaunay@...com>
Cc: Christophe Henri RICARD <christophe-h.ricard@...com>,
Marcel Selhorst <m.selhorst@...rix.com>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
James Morris <jmorris@...ei.org>,
"joe@...ches.com" <joe@...ches.com>,
matt mooney <mfm@...eddisk.com>,
Sean NEWTON <sean.newton@...com>,
Jean-Luc BLANC <jean-luc.blanc@...com>
Subject: RE: [PATCH 1/1] TPM: new stm i2c device driver
Adding Christophe Delaunay in the loop.
M.Tabet
-----Original Message-----
From: Rajiv Andrade [mailto:srajiv@...ux.vnet.ibm.com]
Sent: 16 September, 2011 21:01
To: Rajiv Andrade
Cc: Christophe Henri RICARD; Mohamed TABET; Marcel Selhorst; linux-kernel@...r.kernel.org; James Morris; joe@...ches.com; matt mooney; Sean NEWTON; Jean-Luc BLANC
Subject: Re: [PATCH 1/1] TPM: new stm i2c device driver
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
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists