]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
iio: adc: ad7949: use spi_is_bpw_supported()
authorDavid Lechner <dlechner@baylibre.com>
Wed, 11 Jun 2025 15:04:58 +0000 (10:04 -0500)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 1 Aug 2025 08:47:28 +0000 (09:47 +0100)
commit881f3066fd8dfb91a1cdb8dbee142ab45e08fcfc
tree8bb0d0705cd0aef71e5b5c399fc0c24873fddef6
parent6a85c96e61c1fb99b4bc298a8448787269db5836
iio: adc: ad7949: use spi_is_bpw_supported()

[ Upstream commit 7b86482632788acd48d7b9ee1867f5ad3a32ccbb ]

Use spi_is_bpw_supported() instead of directly accessing spi->controller
->bits_per_word_mask. bits_per_word_mask may be 0, which implies that
8-bits-per-word is supported. spi_is_bpw_supported() takes this into
account while spi_ctrl_mask == SPI_BPW_MASK(8) does not.

Fixes: 0b2a740b424e ("iio: adc: ad7949: enable use with non 14/16-bit controllers")
Closes: https://lore.kernel.org/linux-spi/c8b8a963-6cef-4c9b-bfef-dab2b7bd0b0f@sirena.org.uk/
Signed-off-by: David Lechner <dlechner@baylibre.com>
Reviewed-by: Andy Shevchenko <andy@kernel.org>
Link: https://patch.msgid.link/20250611-iio-adc-ad7949-use-spi_is_bpw_supported-v1-1-c4e15bfd326e@baylibre.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/iio/adc/ad7949.c