Re: [PATCH v2 1/3] hwmon: (pmbus) Add driver for Delta DPS-920AB PSU

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

 



On Fri, Jun 04, 2021 at 02:16:02PM +0200, Robert Marko wrote:
[ ... ]
> >
> > > +}
> > > +
> > > +static int dps920ab_write_word_data(struct i2c_client *client, int page, int reg,
> > > +                                 u16 word)
> > > +{
> > > +     int ret;
> > > +
> > > +     /*
> > > +      * This masks commands which are not supported.
> > > +      * PSU only has one R/W register and that is
> > > +      * for the fan.
> > > +      */
> > > +     switch (reg) {
> > > +     case PMBUS_FAN_COMMAND_1:
> > > +             break;
> > > +     default:
> > > +             ret = -ENODATA;
> > > +     }
> > > +
> >
> > Does this work ? It is the wrong error message for a failed write;
> > it should probably return -EACCES.
> 
> It appears to work fine, I was looking at other drivers, and all of them
> use -ENODATA for unsupported word registers.

No. They return -ENODATA to tell the PMBus core to use standard PMBus
access functions, ie to handle the access in the core. Please see
_pmbus_write_word_data().

Guenter



[Index of Archives]     [Kernel Newbies]     [Security]     [Netfilter]     [Bugtraq]     [Linux FS]     [Yosemite Forum]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Video 4 Linux]     [Device Mapper]     [Linux Resources]

  Powered by Linux