Re: [PATCH] i2c: virtio: Add support for zero-length requests

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

 



On Fri, Oct 22, 2021 at 8:58 AM Viresh Kumar <viresh.kumar@xxxxxxxxxx> wrote:
> On 22-10-21, 14:51, Jie Deng wrote:
> > > +   if (!virtio_has_feature(vdev, VIRTIO_I2C_F_ZERO_LENGTH_REQUEST)) {
> > > +           dev_err(&vdev->dev, "Zero-length request feature is mandatory\n");
> > > +           return -EINVAL;
> >
> >
> > It might be better to return -EOPNOTSUPP ?
>
> Maybe that or one of these:
>
> #define EBADE           52      /* Invalid exchange */
> #define EPROTO          71      /* Protocol error */
> #define EPFNOSUPPORT    96      /* Protocol family not supported */
> #define ECONNREFUSED    111     /* Connection refused */
>
> Arnd, any suggestions ? This is about the mandatory feature not being offered by
> the device.

These are mostly used for network operations, I'd stick with either EINVAL
or ENXIO in this case.

        Arnd



[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