Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

iio: light: opt4060: Switch to sparse friendly iio_device_claim/release_direct()

These new functions allow sparse to find failures to release
direct mode reducing chances of bugs over the claim_direct_mode()
functions that are deprecated. This is a case where the code
is pinning down the mode so also has a claim on buffered mode.
A follow up set may move those calls over to a sparse friendly
form as well.

Tested-by: Per-Daniel Olsson <perdaniel.olsson@axis.com>
Reviewed-by: Per-Daniel Olsson <perdaniel.olsson@axis.com>
Reviewed-by: David Lechner <dlechner@baylibre.com>
Link: https://patch.msgid.link/20250309170633.1347476-10-jic23@kernel.org
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>

+3 -2
+3 -2
drivers/iio/light/opt4060.c
··· 311 311 * concurrently change. And we just keep trying until we get one 312 312 * of the modes... 313 313 */ 314 - if (iio_device_claim_direct_mode(indio_dev)) 314 + if (!iio_device_claim_direct(indio_dev)) 315 315 goto any_mode_retry; 316 316 /* 317 317 * This path means that we managed to claim direct mode. In ··· 320 320 */ 321 321 ret = opt4060_set_state_common(chip, continuous_sampling, 322 322 continuous_irq); 323 - iio_device_release_direct_mode(indio_dev); 323 + iio_device_release_direct(indio_dev); 324 + return ret; 324 325 } else { 325 326 /* 326 327 * This path means that we managed to claim buffer mode. In