Re: [PATCH v11] i2c: virtio: add a virtio i2c frontend driver

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

 



On 02-07-21, 11:36, Jie Deng wrote:
> OK. Let's add the following two lines to make sure that msg_buf is only
> sent when the msgs len is not zero. And backend judges whether it is
> a zero-length request by checking the number of elements received.
> 
>  + if (msgs[i].len) {
>            reqs[i].buf = i2c_get_dma_safe_msg_buf(&msgs[i], 1);
>            if (!reqs[i].buf)
>                    break;
> 
>           sg_init_one(&msg_buf, reqs[i].buf, msgs[i].len);
> 
>           if (msgs[i].flags & I2C_M_RD)
>                   sgs[outcnt + incnt++] = &msg_buf;
>           else
>                   sgs[outcnt++] = &msg_buf;
> +}

Perfect. Thanks.

-- 
viresh



[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