Re: [PATCH v1 3/3] iio: adc: tsc2046: silent spi_device_id warning

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue, Aug 30, 2022 at 2:19 PM Oleksij Rempel <o.rempel@xxxxxxxxxxxxxx> 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



[Index of Archives]     [Device Tree Compilter]     [Device Tree Spec]     [Linux Driver Backports]     [Video for Linux]     [Linux USB Devel]     [Linux PCI Devel]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [XFree86]     [Yosemite Backpacking]


  Powered by Linux