From: Guenter Roeck <linux@roeck-us.net>
To: Robert Marko <robert.marko@sartura.hr>
Cc: robh+dt@kernel.org, jdelvare@suse.com, corbet@lwn.net,
linux-hwmon@vger.kernel.org, linux-doc@vger.kernel.org,
linux-kernel@vger.kernel.org, trivial@kernel.org,
Jonathan.Cameron@huawei.com, alexandre.belloni@bootlin.com,
sst@poczta.fm, krzk@kernel.org, alexandru.ardelean@analog.com,
devicetree@vger.kernel.org, Luka Perkov <luka.perkov@sartura.hr>,
jmp@epiphyte.org, Paul Menzel <pmenzel@molgen.mpg.de>,
Donald Buczek <buczek@molgen.mpg.de>
Subject: Re: [PATCH v2 1/3] hwmon: (pmbus) Add driver for Delta DPS-920AB PSU
Date: Fri, 4 Jun 2021 05:38:29 -0700 [thread overview]
Message-ID: <20210604123829.GA3939356@roeck-us.net> (raw)
In-Reply-To: <CA+HBbNGu6kkp23wHrnVeM7vry6nT0-P66U0V8KXCQ=kCcs+n8g@mail.gmail.com>
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
prev parent reply other threads:[~2021-06-04 12:39 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-05-28 10:38 [PATCH v2 1/3] hwmon: (pmbus) Add driver for Delta DPS-920AB PSU Robert Marko
2021-05-28 10:38 ` [PATCH v2 2/3] dt-bindings: trivial-devices: Add Delta DPS920AB Robert Marko
2021-05-28 10:38 ` [PATCH v2 3/3] MAINTAINERS: Add Delta DPS920AB PSU driver Robert Marko
2021-05-28 13:28 ` [PATCH v2 1/3] hwmon: (pmbus) Add driver for Delta DPS-920AB PSU Guenter Roeck
2021-06-04 12:16 ` Robert Marko
2021-06-04 12:38 ` Guenter Roeck [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20210604123829.GA3939356@roeck-us.net \
--to=linux@roeck-us.net \
--cc=Jonathan.Cameron@huawei.com \
--cc=alexandre.belloni@bootlin.com \
--cc=alexandru.ardelean@analog.com \
--cc=buczek@molgen.mpg.de \
--cc=corbet@lwn.net \
--cc=devicetree@vger.kernel.org \
--cc=jdelvare@suse.com \
--cc=jmp@epiphyte.org \
--cc=krzk@kernel.org \
--cc=linux-doc@vger.kernel.org \
--cc=linux-hwmon@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=luka.perkov@sartura.hr \
--cc=pmenzel@molgen.mpg.de \
--cc=robert.marko@sartura.hr \
--cc=robh+dt@kernel.org \
--cc=sst@poczta.fm \
--cc=trivial@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).