Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1419259
| Path | csiph.com!feeder.erje.net!1.us.feeder.erje.net!newsfeed.fsmpi.rwth-aachen.de!newsfeed.straub-nv.de!news.mixmin.net!aioe.org!bofh.it!news.nic.it!robomod |
|---|---|
| From | Corey Minyard <minyard@acm.org> |
| Newsgroups | linux.kernel |
| Subject | Re: [v2,04/10] i2c-i801: Consolidate calls to i801_check_pre() |
| Date | Fri, 10 Jun 2016 13:00:02 +0200 |
| Message-ID | <rIskq-3wi-15@gated-at.bofh.it> (permalink) |
| References | <rEk25-5IM-5@gated-at.bofh.it> <rI4L8-4zR-29@gated-at.bofh.it> |
| Dkim-Signature | v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:reply-to:subject:references:to:cc:from:message-id:date :user-agent:mime-version:in-reply-to:content-transfer-encoding; bh=wOi13ky4WvPmzVA21UR34VwLzggsqAWuQqLifFiUX0c=; b=zqDUPMrvSNl119gaTJ/Yiun6nSmxYYtJephQhcTKr7PRDHTZjfU+vwUvlQHw3S50y6 689Ks7xvuYdVdl+mAWnUk4PRdSIgmzAf/w0mg88w+CxWspasdmcB5VdmFoiKZ3nysnww V+MyudSYHivQkLwfbCrtLQYM1RfpBPBa9sKIaVNOImmCdLLnM4lYiHCEdQsbhnA9rR4Z HgyJz2vnIVWrtuc8CHZdFkD09G55EAeKxUATUz6QD9ZP7zsXUhHYGEFkliEqconDCRQK MrkvSTTqksA/XRtywvuH6st2w3Zfs57+1DZaKMVpPN2vyRQgympn0A5FT/9oTAtI6yJS 4Jew== |
| X-Google-Dkim-Signature | v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:sender:reply-to:subject:references:to:cc:from :message-id:date:user-agent:mime-version:in-reply-to :content-transfer-encoding; bh=wOi13ky4WvPmzVA21UR34VwLzggsqAWuQqLifFiUX0c=; b=ACsnmMZECgEPKwBD8wDKzhzeTbt6BTUcHhu3ZalBNoZZPHQqsuaJosLUE8Z0MFbZZi PQkVOR4m1Zle5JHE76WGc2QUf4l1fH6/Xll82zKXqjQR0bt2LqTrQ013in3Rf9aG1j3P 365MFXIQdFKEICcM4x3WkqXs/6qyWcfOAVtZryLNhSDImWxlyzMOYprhTLCv6B0y+BAg DFBRSIM1hurQsFrhXN7XS9L8PTeG0x+Lk/xTzxvNIB0apYbeeYpV0ic3mUSeDNsW6YSS 4EWDgWztGDMz2hqgqYLoCkve3nqBCt0Z9gZMcULYi1B99jBzy2xSZ6qa7jOdeD5tVidp /hgA== |
| X-Gm-Message-State | ALyK8tJKGbbv1JNRTan/WFCd5y4LKj3ao5mTIh6VeS2OUOhPQytptcQubKTaPhj/15jPDQ== |
| X-Received | by 10.157.16.93 with SMTP id o29mr543124oto.155.1465555928469; Fri, 10 Jun 2016 03:52:08 -0700 (PDT) |
| Reply-To | minyard@acm.org |
| User-Agent | Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.8.0 |
| MIME-Version | 1.0 |
| Content-Type | text/plain; charset=utf-8; format=flowed |
| Content-Transfer-Encoding | 7bit |
| Sender | robomod@news.nic.it |
| List-ID | <linux-kernel.vger.kernel.org> |
| X-Mailing-List | linux-kernel@vger.kernel.org |
| Approved | robomod@news.nic.it |
| Lines | 65 |
| Organization | linux.* mail to news gateway |
| X-Original-Cc | Jean Delvare <jdelvare@suse.com>, linux-i2c@vger.kernel.org, linux-kernel@vger.kernel.org, Corey Minyard <cminyard@mvista.com> |
| X-Original-Date | Fri, 10 Jun 2016 05:52:02 -0500 |
| X-Original-Message-ID | <575A9BD2.1070905@acm.org> |
| X-Original-References | <1464570544-975-5-git-send-email-minyard@acm.org> <20160609094402.GF24234@mail.corp.redhat.com> |
| X-Original-Sender | linux-kernel-owner@vger.kernel.org |
| Xref | csiph.com linux.kernel:1419259 |
Show key headers only | View raw
On 06/09/2016 04:44 AM, Benjamin Tissoires wrote:
> On May 29 2016 or thereabouts, Corey Minyard wrote:
>> From: Corey Minyard <cminyard@mvista.com>
>>
>> It was always done before starting the transaction, so do it
>> in common code before the transaction start.
>>
>> Signed-off-by: Corey Minyard <cminyard@mvista.com>
>> ---
>> drivers/i2c/busses/i2c-i801.c | 12 ++++--------
>> 1 file changed, 4 insertions(+), 8 deletions(-)
>>
>> diff --git a/drivers/i2c/busses/i2c-i801.c b/drivers/i2c/busses/i2c-i801.c
>> index 222be9c..8794e70 100644
>> --- a/drivers/i2c/busses/i2c-i801.c
>> +++ b/drivers/i2c/busses/i2c-i801.c
>> @@ -402,10 +402,6 @@ static int i801_transaction(struct i801_priv *priv, int xact)
>> int result;
>> const struct i2c_adapter *adap = &priv->adapter;
>>
>> - result = i801_check_pre(priv);
>> - if (result < 0)
>> - return result;
>> -
>> if (priv->features & FEATURE_IRQ) {
>> outb_p(xact | SMBHSTCNT_INTREN | SMBHSTCNT_START,
>> SMBHSTCNT(priv));
>> @@ -562,10 +558,6 @@ static int i801_block_transaction_byte_by_byte(struct i801_priv *priv,
>> int result;
>> const struct i2c_adapter *adap = &priv->adapter;
>>
>> - result = i801_check_pre(priv);
>> - if (result < 0)
>> - return result;
>> -
>> len = data->block[0];
>>
>> if (read_write == I2C_SMBUS_WRITE) {
>> @@ -789,6 +781,10 @@ static s32 i801_access(struct i2c_adapter *adap, u16 addr,
>> goto out;
>> }
>>
>> + ret = i801_check_pre(priv);
>> + if (ret < 0)
>> + goto out;
>> +
> The calls looks identical (it gets called before each transaction), but
> given that this is a status register, I wonder if this should not be
> checked once the setup has been done, and not at the very early
> beginning.
What I did is not a functional change from what was before, but I
think you may be right, it might be best to move this check this
before the switch statement above. I'm not sure, though.
Jean, do you have any thoughts on this?
-corey
> Cheers,
> Benjamin
>
>> if (block)
>> ret = i801_block_transaction(priv, flags, data, read_write,
>> size);
Back to linux.kernel | Previous | Next — Previous in thread | Find similar | Unroll thread
Re: [v2,04/10] i2c-i801: Consolidate calls to i801_check_pre() Benjamin Tissoires <benjamin.tissoires@redhat.com> - 2016-06-09 11:50 +0200 Re: [v2,04/10] i2c-i801: Consolidate calls to i801_check_pre() Corey Minyard <minyard@acm.org> - 2016-06-10 13:00 +0200
csiph-web