Re: [PATCH] i2c: (i2c-diolan-u2c) Fix master_xfer return code

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

 



Hi Gunter,
A minor suggestion below.

On Thu, Aug 9, 2012 at 9:17 PM, Guenter Roeck <linux@xxxxxxxxxxxx> wrote:
> The master_xfer function returns 0 on success. It should return the number of
> successful transactions.
>
> Signed-off-by: Guenter Roeck <linux@xxxxxxxxxxxx>
> ---
>  drivers/i2c/busses/i2c-diolan-u2c.c |    1 +
>  1 file changed, 1 insertion(+)
>
> diff --git a/drivers/i2c/busses/i2c-diolan-u2c.c b/drivers/i2c/busses/i2c-diolan-u2c.c
> index aedb94f..dae3ddf 100644
> --- a/drivers/i2c/busses/i2c-diolan-u2c.c
> +++ b/drivers/i2c/busses/i2c-diolan-u2c.c
> @@ -405,6 +405,7 @@ static int diolan_usb_xfer(struct i2c_adapter *adapter, struct i2c_msg *msgs,
>                         }
>                 }
>         }
> +       ret = num;
So if all the messages get transferred this is right.

However if only a few go through should we return the number of
successful transactions
instead of error?

>  abort:
>         sret = diolan_i2c_stop(dev);
>         if (sret < 0 && ret >= 0)
> --
> 1.7.9.7
>
> --
> 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
--
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


[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