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-input" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html