iio: adc: ad7944: Consolidate spi_sync() wrapper
Since commit 6020ca4d ("iio: adc: ad7944: use spi_optimize_message()"), The helper functions wrapping spi_sync() for 3-wire and 4-wire modes are virtually identical. Since gpiod_set_value_cansleep() does a NULL check internally, we can consolidate the two functions into one and avoid switch statements at the call sites. The default cases of the removed switch statement were just to make the compiler happy and are not reachable since the mode is validated in the probe function. So removing those should be safe. Signed-off-by:David Lechner <dlechner@baylibre.com> Link: https://lore.kernel.org/r/20240412-ad7944-consolidate-msg-v1-1-7fdeff89172f@baylibre.comSigned-off-by:
Jonathan Cameron <Jonathan.Cameron@huawei.com>
Showing
Please register or sign in to comment