iio: temperature: ltc2983: Make use of device properties
authorAndy Shevchenko <andriy.shevchenko@linux.intel.com>
Mon, 7 Mar 2022 20:36:06 +0000 (22:36 +0200)
committerJonathan Cameron <Jonathan.Cameron@huawei.com>
Mon, 4 Apr 2022 08:11:24 +0000 (09:11 +0100)
commitbc4c94994ffe581bf7d2fbc3bd0974b6d9b0d746
tree9ffab204b9745d7dce2e6963009756f570ad3151
parente59b18a28909af502f41f2201109a1a1ac2d486c
iio: temperature: ltc2983: Make use of device properties

Convert the module to be property provider agnostic and allow
it to be used on non-OF platforms.

The conversion slightly changes the logic behind property reading for
the configuration values. Original code allocates just as much memory
as needed. Then for each separate 32- or 64-bit value it reads it from
the property and converts to a raw one which will be fed to the sensor.
In the new code we allocate the amount of memory needed to retrieve all
values at once from the property and then convert them as required.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Reviewed-by: Nuno Sá <nuno.sa@analog.com>
Tested-by: Nuno Sá <nuno.sa@analog.com>
Link: https://lore.kernel.org/r/20220307203606.87258-3-andriy.shevchenko@linux.intel.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
drivers/iio/temperature/ltc2983.c