[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20120509055411.GG10514@core.coreip.homeip.net>
Date: Tue, 8 May 2012 22:54:11 -0700
From: Dmitry Torokhov <dmitry.torokhov@...il.com>
To: Daniel Kurtz <djkurtz@...omium.org>
Cc: Henrik Rydberg <rydberg@...omail.se>,
Joonyoung Shim <jy0922.shim@...sung.com>,
Nick Dyer <nick.dyer@...ev.co.uk>, linux-input@...r.kernel.org,
linux-kernel@...r.kernel.org, Benson Leung <bleung@...omium.org>,
Yufeng Shen <miletus@...omium.org>, khali@...ux-fr.org
Subject: Re: [PATCH 03/14 v3] Input: atmel_mxt_ts - refactor
mxt_read/write_reg to take a length
Hi Daniel,
On Wed, Apr 18, 2012 at 09:21:48PM +0800, Daniel Kurtz wrote:
> + ret = i2c_transfer(client->adapter, xfer, 2);
> + if (ret != 2) {
> + dev_err(&client->dev, "i2c read reg failed (%d)\n", ret);
> + if (ret >= 0)
> + ret = -EIO;
> }
>
> - return 0;
> + return (ret == 2) ? 0 : ret;
> }
Would prefer:
ret = i2c_transfer(client->adapter, xfer, ARRAY_SIZE(xfer));
if (ret != ARRAY_SIZE(xfer)) {
if (ret >= 0)
ret = -EIO;
dev_err(&client->dev, "i2c read reg failed (%d)\n", ret);
return ret;
}
return 0;
Or maybe we need i2c_transfer_exact() wrapper? Jean?
Thanks.
--
Dmitry
--
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