[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CACRpkdbWE3enEjweZZQSQpdUDvCPXxQZfzOReS9YvZ2mxmevAg@mail.gmail.com>
Date: Mon, 4 Sep 2023 22:26:38 +0200
From: Linus Walleij <linus.walleij@...aro.org>
To: Krzysztof Kozlowski <krzysztof.kozlowski@...aro.org>
Cc: Mark Brown <broonie@...nel.org>, 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,
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 4, 2023 at 3:02 PM Krzysztof Kozlowski
<krzysztof.kozlowski@...aro.org> wrote:
> On 04/09/2023 14:30, Mark Brown wrote:
> > 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
>
> No, it is neither common nor good. The kernel's job is not to verify the
> supplied DTS. Rob also made here a point:
>
> https://lore.kernel.org/all/CAL_Jsq+wcrOjh7+0c=mrg+Qz6dbhOUE-VEeQ4FoWC3Y7ENoyfQ@mail.gmail.com/
I disagree, if a vendor one day decides to mount a new version of a
component without notifying the community or users this is really
helpful.
The function is named "probe()" for a reason, as in "inspect
the hardware and see what we find" this has always been the case
I think.
Yours,
Linus Walleij
Powered by blists - more mailing lists