From: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
To: Andre Przywara <andre.przywara@arm.com>
Cc: Maxim Kiselev <bigunclemax@gmail.com>,
linux-iio@vger.kernel.org, Jonathan Cameron <jic23@kernel.org>,
Lars-Peter Clausen <lars@metafoo.de>,
Rob Herring <robh+dt@kernel.org>,
Krzysztof Kozlowski <krzysztof.kozlowski+dt@linaro.org>,
Chen-Yu Tsai <wens@csie.org>,
Jernej Skrabec <jernej.skrabec@gmail.com>,
Samuel Holland <samuel@sholland.org>,
Conor Dooley <conor@kernel.org>,
Paul Walmsley <paul.walmsley@sifive.com>,
Palmer Dabbelt <palmer@dabbelt.com>,
Albert Ou <aou@eecs.berkeley.edu>,
Philipp Zabel <p.zabel@pengutronix.de>,
Cosmin Tanislav <demonsingur@gmail.com>,
Haibo Chen <haibo.chen@nxp.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>,
Arnd Bergmann <arnd@arndb.de>,
AngeloGioacchino Del Regno
<angelogioacchino.delregno@collabora.com>,
Caleb Connolly <caleb.connolly@linaro.org>,
devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org,
linux-sunxi@lists.linux.dev, linux-kernel@vger.kernel.org,
linux-riscv@lists.infradead.org
Subject: Re: [RFC PATCH v1 1/4] iio: adc: Add Allwinner D1/T113s/R329 SoCs GPADC
Date: Wed, 24 May 2023 14:06:55 +0300 [thread overview]
Message-ID: <ZG3vzxWicUgndMqv@smile.fi.intel.com> (raw)
In-Reply-To: <20230524110105.4928906c@donnerap.cambridge.arm.com>
On Wed, May 24, 2023 at 11:01:05AM +0100, Andre Przywara wrote:
> On Wed, 24 May 2023 11:27:30 +0300
> Maxim Kiselev <bigunclemax@gmail.com> wrote:
...
> > +static const struct regmap_config sun20i_gpadc_regmap_config = {
> > + .reg_bits = 32,
> > + .val_bits = 32,
> > + .reg_stride = 4,
> > + .fast_io = true,
> > +};
>
> Is there any particular reason you chose a regmap to model this here?
> Isn't that just straight-forward MMIO, which we could just drive using
> readl()/writel()?
Even though regmap adds a few nice features that might be used.
For example, locking. But I dunno if this driver actually uses it
OR uses it correctly.
...
> > + config = of_device_get_match_data(&pdev->dev);
Please, avoid using OF-centric APIs in the new IIO drivers.
config = device_get_match_data(&pdev->dev);
should suffice.
> > + if (!config)
> > + return -ENODEV;
...
> > + irq = platform_get_irq(pdev, 0);
> > + if (irq < 0)
> > + return dev_err_probe(&pdev->dev, irq, "failed to get irq\n");
We should not repeat the message that printed by platform core.
...
> > + ret = devm_request_irq(&pdev->dev, irq, sun20i_gpadc_irq_handler,
> > + 0, dev_name(&pdev->dev), info);
You can simplify your life with
struct device *dev = &pdev->dev;
at the definition block of the function.
> > + if (ret < 0)
> > + return dev_err_probe(&pdev->dev, ret,
> > + "failed requesting irq %d\n", irq);
...
> > + .data = &sun20i_d1_gpadc_channels[1]
Also, leave comma here.
...
> > + .data = &sun50i_r329_gpadc_channels[2]
Same as above.
--
With Best Regards,
Andy Shevchenko
next prev parent reply other threads:[~2023-05-24 11:07 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-05-24 8:27 [RFC PATCH v1 0/4] Add support for Allwinner GPADC on D1/T113s/R329 SoCs Maxim Kiselev
2023-05-24 8:27 ` [RFC PATCH v1 1/4] iio: adc: Add Allwinner D1/T113s/R329 SoCs GPADC Maxim Kiselev
2023-05-24 10:01 ` Andre Przywara
2023-05-24 11:06 ` Andy Shevchenko [this message]
2023-05-24 12:14 ` Maxim Kiselev
2023-05-28 16:38 ` Jonathan Cameron
2023-05-24 8:27 ` [RFC PATCH v1 2/4] dt-bindings: " Maxim Kiselev
2023-05-24 9:21 ` Rob Herring
2023-05-28 15:28 ` Jonathan Cameron
2023-05-24 8:27 ` [RFC PATCH v1 3/4] ARM: dts: sun8i: t113s: Add GPADC node Maxim Kiselev
2023-05-24 8:27 ` [RFC PATCH v1 4/4] riscv: dts: allwinner: d1: " Maxim Kiselev
2023-05-24 9:34 ` [RFC PATCH v1 0/4] Add support for Allwinner GPADC on D1/T113s/R329 SoCs Andre Przywara
2023-05-24 11:36 ` Maxim Kiselev
2023-05-28 15:22 ` Jonathan Cameron
2023-05-28 15:25 ` Jonathan Cameron
2023-05-28 16:39 ` 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=ZG3vzxWicUgndMqv@smile.fi.intel.com \
--to=andriy.shevchenko@linux.intel.com \
--cc=Ibrahim.Tilki@analog.com \
--cc=andre.przywara@arm.com \
--cc=angelogioacchino.delregno@collabora.com \
--cc=aou@eecs.berkeley.edu \
--cc=arnd@arndb.de \
--cc=bigunclemax@gmail.com \
--cc=caleb.connolly@linaro.org \
--cc=chiaen_wu@richtek.com \
--cc=conor@kernel.org \
--cc=cy_huang@richtek.com \
--cc=demonsingur@gmail.com \
--cc=devicetree@vger.kernel.org \
--cc=haibo.chen@nxp.com \
--cc=jernej.skrabec@gmail.com \
--cc=jic23@kernel.org \
--cc=krzysztof.kozlowski+dt@linaro.org \
--cc=lars@metafoo.de \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-iio@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-riscv@lists.infradead.org \
--cc=linux-sunxi@lists.linux.dev \
--cc=p.zabel@pengutronix.de \
--cc=palmer@dabbelt.com \
--cc=paul.walmsley@sifive.com \
--cc=ramona.bolboaca@analog.com \
--cc=robh+dt@kernel.org \
--cc=samuel@sholland.org \
--cc=wens@csie.org \
--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).