The patch titled drivers/misc/hmc6352.c: fix wrong return value checking for i2c_master_recv() has been removed from the -mm tree. Its filename was drivers-misc-hmc6352c-fix-wrong-return-value-checking-for-i2c_master_recv.patch This patch was dropped because it was merged into mainline or a subsystem tree The current -mm tree may be found at http://userweb.kernel.org/~akpm/mmotm/ ------------------------------------------------------ Subject: drivers/misc/hmc6352.c: fix wrong return value checking for i2c_master_recv() From: Axel Lin <axel.lin@xxxxxxxxx> i2c_master_recv() returns negative errno, or else the number of bytes read. Thus i2c_master_recv(client, i2c_data, 2) returns 2 instead of 1 in success case. [akpm@xxxxxxxxxxxxxxxxxxxx: make `ret' signed] Signed-off-by: Axel Lin <axel.lin@xxxxxxxxx> Cc: Kalhan Trisal <kalhan.trisal@xxxxxxxxx> Cc: Alan Cox <alan@xxxxxxxxxxxxxxx> Signed-off-by: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx> --- drivers/misc/hmc6352.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff -puN drivers/misc/hmc6352.c~drivers-misc-hmc6352c-fix-wrong-return-value-checking-for-i2c_master_recv drivers/misc/hmc6352.c --- a/drivers/misc/hmc6352.c~drivers-misc-hmc6352c-fix-wrong-return-value-checking-for-i2c_master_recv +++ a/drivers/misc/hmc6352.c @@ -75,7 +75,7 @@ static ssize_t compass_heading_data_show { struct i2c_client *client = to_i2c_client(dev); unsigned char i2c_data[2]; - unsigned int ret; + int ret; mutex_lock(&compass_mutex); ret = compass_command(client, 'A'); @@ -86,7 +86,7 @@ static ssize_t compass_heading_data_show msleep(10); /* sending 'A' cmd we need to wait for 7-10 millisecs */ ret = i2c_master_recv(client, i2c_data, 2); mutex_unlock(&compass_mutex); - if (ret != 1) { + if (ret < 0) { dev_warn(dev, "i2c read data cmd failed\n"); return ret; } _ Patches currently in -mm which might be from axel.lin@xxxxxxxxx are origin.patch linux-next.patch -- To unsubscribe from this list: send the line "unsubscribe mm-commits" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html