iio: adc: ad7944: simplify adi,spi-mode property parsing
authorDavid Lechner <dlechner@baylibre.com>
Mon, 25 Mar 2024 19:40:36 +0000 (14:40 -0500)
committerJonathan Cameron <Jonathan.Cameron@huawei.com>
Thu, 28 Mar 2024 13:22:21 +0000 (13:22 +0000)
commit27eea4778db8268cd6dc80a5b853c599bd3099f1
treec5e62cbdd02884f32560e5c5ceff69a38913454c
parent3d797af1d69a23571ec89dc4d95eb0e0e971d3d8
iio: adc: ad7944: simplify adi,spi-mode property parsing

This simplifies the adi,spi-mode property parsing by using
device_property_match_property_string() instead of two separate
functions. Also, the error return value is now more informative
in cases where there was a problem parsing the property.

Suggested-by: Andy Shevchenko <andy.shevchenko@gmail.com>
Signed-off-by: David Lechner <dlechner@baylibre.com>
Link: https://lore.kernel.org/r/20240325-ad7944-cleanups-v3-1-3a19120cdd06@baylibre.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
drivers/iio/adc/ad7944.c