Re: [PATCH] fix i2c_pca_pf_waitforcompletion() return value

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mon, Sep 20, 2010 at 11:14:32AM +0200, Yegor Yefremov wrote:
> ret is still -1, if during the polling read_byte() returns at once
> with I2C_PCA_CON_SI set. So ret > 0 would lead 
> i2c_pca_pf_waitforcompletion() to return 0, in spite of
> the proper behavior. That's why only ret should be returned.
> 
> Signed-off-by: Yegor Yefremov <yegorslists@xxxxxxxxxxxxxx>

Thanks for reporting. In deed, this needs to be corrected. However, I think we
should clean up the code some more and get rid of the initialization of ret
altogether (and hopefully make it more readable with this). Do you have time
for this, otherwise I'll have a look later.

Regards,

   Wolfram

> 
> Index: b/drivers/i2c/busses/i2c-pca-platform.c
> ===================================================================
> --- a/drivers/i2c/busses/i2c-pca-platform.c	2010-08-27 01:47:12.000000000 +0200
> +++ b/drivers/i2c/busses/i2c-pca-platform.c	2010-09-20 10:21:05.000000000 +0200
> @@ -96,7 +96,7 @@
>  			udelay(100);
>  	}
>  
> -	return ret > 0;
> +	return ret;
>  }
>  
>  static void i2c_pca_pf_dummyreset(void *pd)
> 
> --
> To unsubscribe from this list: send the line "unsubscribe linux-i2c" in
> the body of a message to majordomo@xxxxxxxxxxxxxxx
> More majordomo info at  http://vger.kernel.org/majordomo-info.html

-- 
Pengutronix e.K.                           | Wolfram Sang                |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |

Attachment: signature.asc
Description: Digital signature


[Index of Archives]     [Linux GPIO]     [Linux SPI]     [Linux Hardward Monitoring]     [LM Sensors]     [Linux USB Devel]     [Linux Media]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux