[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAHp75VfNmq12Yv7mqVeijqK0vwRdPsSrH5wMzg9qR15+t7ArSQ@mail.gmail.com>
Date: Wed, 27 Jul 2022 12:00:22 +0200
From: Andy Shevchenko <andy.shevchenko@...il.com>
To: Potin Lai <potin.lai.pt@...il.com>
Cc: Jonathan Cameron <jic23@...nel.org>,
Lars-Peter Clausen <lars@...afoo.de>,
Patrick Williams <patrick@...cx.xyz>,
Potin Lai <potin.lai@...ntatw.com>,
linux-iio <linux-iio@...r.kernel.org>,
Linux Kernel Mailing List <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH v2 1/1] iio: humidity: hdc100x: add manufacturer and
device ID cehck
On Wed, Jul 27, 2022 at 8:46 AM Potin Lai <potin.lai.pt@...il.com> wrote:
>
> Add manufacturer and device ID checking during probe, and skip the
> checking if chip model not supported.
>
> Supported:
> - HDC1000
> - HDC1010
> - HDC1050
> - HDC1080
>
> Not supported:
> - HDC1008
Thanks for an update, my comments below.
...
> + const struct of_device_id *match;
Don't you have a compiler warning? Always compile your code with `make W=1`
...
> + data = device_get_match_data(&client->dev);
> + if (data) {
This check is redundant. Too much protective programming. Just oblige
that matched ID has to always have an associated data.
> + if (!data->support_mfr_check)
> + return true;
> + }
...
> - .probe = hdc100x_probe,
> + .probe_new = hdc100x_probe,
Make this a separate patch before the presented one.
--
With Best Regards,
Andy Shevchenko
Powered by blists - more mailing lists