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]     [Device Tree Compilter]     [Device Tree Spec]     [Linux Driver Backports]     [Video for Linux]     [Linux USB Devel]     [Linux PCI Devel]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [XFree86]     [Yosemite Backpacking]


  Powered by Linux