RE: [PATCH 1/1] TPM: new stm i2c device driver

From: Mohamed TABET
Date: Mon Sep 19 2011 - 09:38:31 EST


Adding Christophe Delaunay in the loop.

M.Tabet

-----Original Message-----
From: Rajiv Andrade [mailto:srajiv@xxxxxxxxxxxxxxxxxx]
Sent: 16 September, 2011 21:01
To: Rajiv Andrade
Cc: Christophe Henri RICARD; Mohamed TABET; Marcel Selhorst; linux-kernel@xxxxxxxxxxxxxxx; James Morris; joe@xxxxxxxxxxx; 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@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/