From: Jonathan Cameron <jic23@kernel.org>
To: "Nuno Sá" <noname.nuno@gmail.com>
Cc: "Dumitru Ceclan" <mitrutzceclan@gmail.com>,
"Lars-Peter Clausen" <lars@metafoo.de>,
"Michael Hennerich" <Michael.Hennerich@analog.com>,
"Rob Herring" <robh+dt@kernel.org>,
"Krzysztof Kozlowski" <krzysztof.kozlowski+dt@linaro.org>,
"Conor Dooley" <conor+dt@kernel.org>,
"Andy Shevchenko" <andriy.shevchenko@linux.intel.com>,
"Arnd Bergmann" <arnd@arndb.de>,
"Cosmin Tanislav" <demonsingur@gmail.com>,
"Alexander Sverdlin" <alexander.sverdlin@gmail.com>,
"Hugo Villeneuve" <hvilleneuve@dimonoff.com>,
"Okan Sahin" <okan.sahin@analog.com>,
"Niklas Schnelle" <schnelle@linux.ibm.com>,
"ChiYuan Huang" <cy_huang@richtek.com>,
"Ramona Bolboaca" <ramona.bolboaca@analog.com>,
"Ibrahim Tilki" <Ibrahim.Tilki@analog.com>,
"ChiaEn Wu" <chiaen_wu@richtek.com>,
"William Breathitt Gray" <william.gray@linaro.org>,
"Lee Jones" <lee@kernel.org>, "Haibo Chen" <haibo.chen@nxp.com>,
"Mike Looijmans" <mike.looijmans@topic.nl>,
"Leonard Göhrs" <l.goehrs@pengutronix.de>,
"Ceclan Dumitru" <dumitru.ceclan@analog.com>,
linux-iio@vger.kernel.org, devicetree@vger.kernel.org,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH 2/2] iio: adc: ad717x: add AD717X driver
Date: Mon, 28 Aug 2023 17:52:06 +0100 [thread overview]
Message-ID: <20230828175206.7353ffba@jic23-huawei> (raw)
In-Reply-To: <34f5e2118a4714048231e6ee9a8f244248616bd0.camel@gmail.com>
On Thu, 10 Aug 2023 13:57:02 +0200
Nuno Sá <noname.nuno@gmail.com> wrote:
> Hi Dumitru,
>
> Thanks for taking care of this driver which is out of tree for a long time... Some
> comments below.
Hi.
A few follow ups...
> > +static int ad717x_setup(struct iio_dev *indio_dev)
> > +{
> > + struct ad717x_state *st = iio_priv(indio_dev);
> > + unsigned int id;
> > + u8 *buf;
> > + int ret;
> > +
> > + /* reset the serial interface */
> > + buf = kcalloc(8, sizeof(*buf), GFP_KERNEL);
> > + if (!buf)
> > + return -ENOMEM;
> > +
> > + memset(buf, 0xff, 8);
> > + ret = spi_write(st->sd.spi, buf, 8);
> > + kfree(buf);
>
> Hmm, why allocating the buffer? I guess one could argue that we'll get DMA safe
> alignment but then maybe use some define instead of the magic 8.
>
Just use spi_write_then_read() without an read buffer as then it will use
magic bounce buffers for you within the spi subsystem.
> > +static struct spi_driver ad717x_driver = {
> > + .driver = {
> > + .name = "ad717x",
>
> I would keep the name as we have out of tree which is ad7173.c. I'm not sure if
> there's any policy in here but I think typically you just name your driver from the
> first supported device and then extend it from there. Since here you are just adding
> more than one device at once, it would be nice if you could keep the name of the
> driver Lars originally developed...
In this case, indeed the one originally developed is a good choice.
Otherwise, pick a supported part.
Wild cards have bitten us far too many times as manufacturers love to
'use up' gaps in their ID space with parts that are either very different
or even worse look the same but have totally different interfaces...
>
next prev parent reply other threads:[~2023-08-28 16:52 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-08-10 9:33 [PATCH 1/2] dt-bindings: adc: add AD717X Dumitru Ceclan
2023-08-10 9:33 ` [PATCH 2/2] iio: adc: ad717x: add AD717X driver Dumitru Ceclan
2023-08-10 11:57 ` Nuno Sá
2023-08-10 15:36 ` Andy Shevchenko
2023-08-28 17:34 ` Jonathan Cameron
2023-08-29 9:14 ` Nuno Sá
2023-08-29 13:31 ` Andy Shevchenko
2023-08-29 18:38 ` Arnd Bergmann
2023-08-28 16:52 ` Jonathan Cameron [this message]
2023-08-10 19:36 ` kernel test robot
2023-08-11 8:47 ` Andy Shevchenko
2023-08-28 17:58 ` Jonathan Cameron
2023-08-10 10:21 ` [PATCH 1/2] dt-bindings: adc: add AD717X Rob Herring
2023-08-10 20:51 ` Rob Herring
2023-08-28 17:43 ` Jonathan Cameron
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=20230828175206.7353ffba@jic23-huawei \
--to=jic23@kernel.org \
--cc=Ibrahim.Tilki@analog.com \
--cc=Michael.Hennerich@analog.com \
--cc=alexander.sverdlin@gmail.com \
--cc=andriy.shevchenko@linux.intel.com \
--cc=arnd@arndb.de \
--cc=chiaen_wu@richtek.com \
--cc=conor+dt@kernel.org \
--cc=cy_huang@richtek.com \
--cc=demonsingur@gmail.com \
--cc=devicetree@vger.kernel.org \
--cc=dumitru.ceclan@analog.com \
--cc=haibo.chen@nxp.com \
--cc=hvilleneuve@dimonoff.com \
--cc=krzysztof.kozlowski+dt@linaro.org \
--cc=l.goehrs@pengutronix.de \
--cc=lars@metafoo.de \
--cc=lee@kernel.org \
--cc=linux-iio@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mike.looijmans@topic.nl \
--cc=mitrutzceclan@gmail.com \
--cc=noname.nuno@gmail.com \
--cc=okan.sahin@analog.com \
--cc=ramona.bolboaca@analog.com \
--cc=robh+dt@kernel.org \
--cc=schnelle@linux.ibm.com \
--cc=william.gray@linaro.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).