Re: [PATCH v3 08/10] iio: adc: ti-ads1015: Convert to OF match data

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

 



On 3/22/22 22:00, Jonathan Cameron wrote:
On Mon, 21 Mar 2022 11:24:12 +0200
Andy Shevchenko <andy.shevchenko@xxxxxxxxx> wrote:

On Sun, Mar 20, 2022 at 8:14 PM Marek Vasut <marex@xxxxxxx> wrote:

Replace chip type enumeration in match data with pointer to static constant
structure which contain all the different chip properties in one place, and

contains

then replace handling of chip type in probe() with simple copy of fields in
the new match data structure into struct iio_dev.

This reduces code and increases static data.

I like this change! My comments below.
Nice work indeed. Nothing else from me on this one.

I like the fact you also got rid of some odd casting away of const
whilst you were doing this.

[...]

+       chip = (const struct ads1015_chip_data *)
+               device_get_match_data(&client->dev);

Redundant casting. After dropping it it will become one line.

+       if (!chip)
+               chip = (const struct ads1015_chip_data *)id->driver_data;

I don't think I can get rid of this ^ id->driver_data one though.

The device_get_match_data() yes, that cast can be removed.



[Index of Archives]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Input]     [Linux Kernel]     [Linux SCSI]     [X.org]

  Powered by Linux