Patchwork [U-Boot,01/24] mxc_i2c: fix i2c_imx_stop

login
register
mail settings
Submitter Troy Kisky
Date June 22, 2012, 4:11 a.m.
Message ID <1340338339-11626-1-git-send-email-troy.kisky@boundarydevices.com>
Download mbox | patch
Permalink /patch/166479/
State Accepted
Commit 1c076dba277fa35384b512841b0b284bdd579383
Delegated to: Heiko Schocher
Headers show

Comments

Troy Kisky - June 22, 2012, 4:11 a.m.
Instead of clearing 2 bits, all the other
bits were set because '|=' was used instead
of '&='.

Signed-off-by: Troy Kisky <troy.kisky@boundarydevices.com>
---
 drivers/i2c/mxc_i2c.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Note:

All patches in the series are based on the i2c/master branch
even though only 1-18 will be applied there.
Marek Vasut - June 22, 2012, 4:55 p.m.
Dear Troy Kisky,

> Instead of clearing 2 bits, all the other
> bits were set because '|=' was used instead
> of '&='.
> 
> Signed-off-by: Troy Kisky <troy.kisky@boundarydevices.com>

Acked-by: Marek Vasut <marex@denx.de>

> ---
>  drivers/i2c/mxc_i2c.c |    2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> Note:
> 
> All patches in the series are based on the i2c/master branch
> even though only 1-18 will be applied there.
> 
> 
> diff --git a/drivers/i2c/mxc_i2c.c b/drivers/i2c/mxc_i2c.c
> index fc68062..c0c45fd 100644
> --- a/drivers/i2c/mxc_i2c.c
> +++ b/drivers/i2c/mxc_i2c.c
> @@ -264,7 +264,7 @@ void i2c_imx_stop(void)
> 
>  	/* Stop I2C transaction */
>  	temp = readb(&i2c_regs->i2cr);
> -	temp |= ~(I2CR_MSTA | I2CR_MTX);
> +	temp &= ~(I2CR_MSTA | I2CR_MTX);
>  	writeb(temp, &i2c_regs->i2cr);
> 
>  	i2c_imx_bus_busy(0);

Best regards,
Marek Vasut
Stefano Babic - June 24, 2012, 7:49 a.m.
On 22/06/2012 06:11, Troy Kisky wrote:
> Instead of clearing 2 bits, all the other
> bits were set because '|=' was used instead
> of '&='.
> 
> Signed-off-by: Troy Kisky <troy.kisky@boundarydevices.com>
> ---
>  drivers/i2c/mxc_i2c.c |    2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> Note:
> 
> All patches in the series are based on the i2c/master branch
> even though only 1-18 will be applied there.
> 
> 
> diff --git a/drivers/i2c/mxc_i2c.c b/drivers/i2c/mxc_i2c.c
> index fc68062..c0c45fd 100644
> --- a/drivers/i2c/mxc_i2c.c
> +++ b/drivers/i2c/mxc_i2c.c
> @@ -264,7 +264,7 @@ void i2c_imx_stop(void)
>  
>  	/* Stop I2C transaction */
>  	temp = readb(&i2c_regs->i2cr);
> -	temp |= ~(I2CR_MSTA | I2CR_MTX);
> +	temp &= ~(I2CR_MSTA | I2CR_MTX);
>  	writeb(temp, &i2c_regs->i2cr);
>  
>  	i2c_imx_bus_busy(0);
> 

Good catch !

Acked-by: Stefano Babic <sbabic@denx.de>

Best regards,
Stefano Babic

Patch

diff --git a/drivers/i2c/mxc_i2c.c b/drivers/i2c/mxc_i2c.c
index fc68062..c0c45fd 100644
--- a/drivers/i2c/mxc_i2c.c
+++ b/drivers/i2c/mxc_i2c.c
@@ -264,7 +264,7 @@  void i2c_imx_stop(void)
 
 	/* Stop I2C transaction */
 	temp = readb(&i2c_regs->i2cr);
-	temp |= ~(I2CR_MSTA | I2CR_MTX);
+	temp &= ~(I2CR_MSTA | I2CR_MTX);
 	writeb(temp, &i2c_regs->i2cr);
 
 	i2c_imx_bus_busy(0);