From: Mark Brown <broonie@kernel.org>
To: Krishna Yarlagadda <kyarlagadda@nvidia.com>,
Philipp Zabel <p.zabel@pengutronix.de>
Cc: Laxman Dewangan <ldewangan@nvidia.com>,
Thierry Reding <thierry.reding@gmail.com>,
Jonathan Hunter <jonathanh@nvidia.com>,
Sowjanya Komatineni <skomatineni@nvidia.com>,
"linux-tegra@vger.kernel.org" <linux-tegra@vger.kernel.org>,
"linux-spi@vger.kernel.org" <linux-spi@vger.kernel.org>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH 2/2] spi: tegra210-quad: add acpi support
Date: Mon, 29 Nov 2021 12:27:22 +0000 [thread overview]
Message-ID: <YaTHKuohUNt/hVLq@sirena.org.uk> (raw)
In-Reply-To: <BN6PR12MB124973BF5CBB4AB35CC59B8AC3669@BN6PR12MB1249.namprd12.prod.outlook.com>
[-- Attachment #1: Type: text/plain, Size: 1088 bytes --]
On Mon, Nov 29, 2021 at 09:09:30AM +0000, Krishna Yarlagadda wrote:
> > > +#ifdef CONFIG_ACPI
> > > + if (ACPI_FAILURE(acpi_evaluate_object(ACPI_HANDLE(tqspi->dev),
> > > + "_RST", NULL, NULL)))
> > > + dev_err(tqspi->dev, "failed to reset device\n"); #endif
> > What happens when this runs on a DT system?
> For a DT system reset handle would be present and this code will not run
This code is really unclearly structured, the early return doesn't
match the normal kernel style and the ifdefs aren't helping with
clarity. Please restructure it so it's clear that *both* cases have
checks for the correct firmware type being present.
That said frankly I'd expect this handling of ACPI reset to be pushed
into the reset code, it's obviously not good to be open coding this in
drivers when this looks like it's completely generic to any ACPI object
so shouldn't be being open coded in individual driers especially with
the ifdefery. Shouldn't the reset API be able to figure out that an
object with _RST has a reset control and provide access to it through
the reset API?
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]
next prev parent reply other threads:[~2021-11-29 13:44 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-11-25 9:55 [PATCH 1/2] spi: tegra210-quad: use devm call for cdata memory Krishna Yarlagadda
2021-11-25 9:55 ` [PATCH 2/2] spi: tegra210-quad: add acpi support Krishna Yarlagadda
2021-11-25 12:59 ` Mark Brown
2021-11-29 9:09 ` Krishna Yarlagadda
2021-11-29 12:27 ` Mark Brown [this message]
2021-11-30 1:50 ` Krishna Yarlagadda
2021-11-30 13:05 ` Mark Brown
2021-11-30 14:14 ` Dmitry Osipenko
2021-11-30 16:13 ` Mark Brown
2021-11-27 1:30 ` (subset) [PATCH 1/2] spi: tegra210-quad: use devm call for cdata memory Mark Brown
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=YaTHKuohUNt/hVLq@sirena.org.uk \
--to=broonie@kernel.org \
--cc=jonathanh@nvidia.com \
--cc=kyarlagadda@nvidia.com \
--cc=ldewangan@nvidia.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-spi@vger.kernel.org \
--cc=linux-tegra@vger.kernel.org \
--cc=p.zabel@pengutronix.de \
--cc=skomatineni@nvidia.com \
--cc=thierry.reding@gmail.com \
/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