Skip to content

Commit 4c6cc6d

Browse files
dlechgregkh
authored andcommitted
iio: adc: ad_sigma_delta: change to buffer predisable
commit 66d4374 upstream. Change the buffer disable callback from postdisable to predisable. This balances the existing posteanble callback. Using postdisable with posteanble can be problematic, for example, if update_scan_mode fails, it would call postdisable without ever having called posteanble, so the drivers using this would be in an unexpected state when postdisable was called. Fixes: af30084 ("iio:adc: Add common code for ADI Sigma Delta devices") Signed-off-by: David Lechner <dlechner@baylibre.com> Reviewed-by: Nuno Sá <nuno.sa@analog.com> Link: https://patch.msgid.link/20250703-iio-adc-ad_sigma_delta-buffer-predisable-v1-1-f2ab85138f1f@baylibre.com Cc: <stable@vger.kernel.org> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 parent 5c2b601 commit 4c6cc6d

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

drivers/iio/adc/ad_sigma_delta.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -520,7 +520,7 @@ static int ad_sd_buffer_postenable(struct iio_dev *indio_dev)
520520
return ret;
521521
}
522522

523-
static int ad_sd_buffer_postdisable(struct iio_dev *indio_dev)
523+
static int ad_sd_buffer_predisable(struct iio_dev *indio_dev)
524524
{
525525
struct ad_sigma_delta *sigma_delta = iio_device_get_drvdata(indio_dev);
526526

@@ -644,7 +644,7 @@ static bool ad_sd_validate_scan_mask(struct iio_dev *indio_dev, const unsigned l
644644

645645
static const struct iio_buffer_setup_ops ad_sd_buffer_setup_ops = {
646646
.postenable = &ad_sd_buffer_postenable,
647-
.postdisable = &ad_sd_buffer_postdisable,
647+
.predisable = &ad_sd_buffer_predisable,
648648
.validate_scan_mask = &ad_sd_validate_scan_mask,
649649
};
650650

0 commit comments

Comments
 (0)