[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <CAHp75Vc-NNZfSaM8wwf+558aHKU9ZL0Fp3aJEop475mHTExKjw@mail.gmail.com>
Date: Tue, 30 Aug 2022 23:02:08 +0300
From: Andy Shevchenko <andy.shevchenko@...il.com>
To: Oleksij Rempel <o.rempel@...gutronix.de>
Cc: Jonathan Cameron <jic23@...nel.org>,
Lars-Peter Clausen <lars@...afoo.de>,
Rob Herring <robh+dt@...nel.org>,
Krzysztof Kozlowski <krzysztof.kozlowski+dt@...aro.org>,
Sascha Hauer <kernel@...gutronix.de>,
Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
linux-iio <linux-iio@...r.kernel.org>,
devicetree <devicetree@...r.kernel.org>
Subject: Re: [PATCH v1 3/3] iio: adc: tsc2046: silent spi_device_id warning
On Tue, Aug 30, 2022 at 2:19 PM Oleksij Rempel <o.rempel@...gutronix.de> wrote:
>
> Add spi_device_id to silent following warning:
> SPI driver tsc2046 has no spi_device_id for ti,tsc2046e-adc
Missed period.
...
> - dcfg = device_get_match_data(dev);
Why remove this and duplicate the check below with the inverted conditional?
> + if (!dev_fwnode(dev)) {
> + const struct spi_device_id *id;
> +
> + id = spi_get_device_id(spi);
> + dcfg = (const struct tsc2046_adc_dcfg *)id->driver_data;
> + } else {
> + dcfg = device_get_match_data(dev);
> + }
if (!dcfg) {
...try SPI ID...
}
if (!dfg)
return -E...
--
With Best Regards,
Andy Shevchenko
Powered by blists - more mailing lists