lkml.org 
[lkml]   [2021]   [Oct]   [22]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
Date
SubjectRe: [PATCH] i2c: virtio: Add support for zero-length requests
On Fri, Oct 22, 2021 at 8:58 AM Viresh Kumar <viresh.kumar@linaro.org> 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

\
 
 \ /
  Last update: 2021-10-22 09:10    [W:0.292 / U:0.308 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site