[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <4E739CF7.2000202@linux.vnet.ibm.com>
Date: Fri, 16 Sep 2011 16:01:11 -0300
From: Rajiv Andrade <srajiv@...ux.vnet.ibm.com>
To: Rajiv Andrade <srajiv@...ux.vnet.ibm.com>
CC: Christophe Henri RICARD <christophe-h.ricard@...com>,
Mohamed TABET <mohamed.tabet@...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
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