[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <598febde-429e-4319-98d4-4306a7f8bfe8@sirena.org.uk>
Date: Mon, 4 Sep 2023 13:30:41 +0100
From: Mark Brown <broonie@...nel.org>
To: Krzysztof Kozlowski <krzysztof.kozlowski@...aro.org>
Cc: wangweidong.a@...nic.com, lgirdwood@...il.com, robh+dt@...nel.org,
krzysztof.kozlowski+dt@...aro.org, conor+dt@...nel.org,
perex@...ex.cz, tiwai@...e.com, rf@...nsource.cirrus.com,
herve.codina@...tlin.com, shumingf@...ltek.com,
rdunlap@...radead.org, 13916275206@....com, ryans.lee@...log.com,
linus.walleij@...aro.org, ckeepax@...nsource.cirrus.com,
yijiangtao@...nic.com, liweilei@...nic.com, colin.i.king@...il.com,
trix@...hat.com, alsa-devel@...a-project.org,
devicetree@...r.kernel.org, linux-kernel@...r.kernel.org,
zhangjianming@...nic.com
Subject: Re: [PATCH V1 3/3] ASoC: codecs: Add aw87390 amplifier driver
On Mon, Sep 04, 2023 at 02:17:43PM +0200, Krzysztof Kozlowski wrote:
> On 04/09/2023 13:46, wangweidong.a@...nic.com wrote:
> > + ret = regmap_read(regmap, AW87390_ID_REG, &chip_id);
> > + if (ret) {
> > + dev_err(&i2c->dev, "%s read chipid error. ret = %d\n", __func__, ret);
> > + return ret;
> > + }
> > + if (chip_id != AW87390_CHIP_ID) {
> > + dev_err(&i2c->dev, "unsupported device\n");
> Why? The compatible tells it cannot be anything else.
This is very common good practice, as well as validating communication
with the device it verifies that the device descrbied in the DT is the
one that is actually present in the system. This might create hassle
down the line if there is a backwards compatible upgrade but that's much
rarer for this class of hardware than cut'n'pasting of device trees.
Download attachment "signature.asc" of type "application/pgp-signature" (489 bytes)
Powered by blists - more mailing lists