Skip to content

Commit 66d4374

Browse files
dlechjic23
authored andcommitted
iio: adc: ad_sigma_delta: change to buffer predisable
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 <[email protected]> Reviewed-by: Nuno Sá <[email protected]> Link: https://patch.msgid.link/20250703-iio-adc-ad_sigma_delta-buffer-predisable-v1-1-f2ab85138f1f@baylibre.com Cc: <[email protected]> Signed-off-by: Jonathan Cameron <[email protected]>
1 parent 9b71d26 commit 66d4374

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
@@ -582,7 +582,7 @@ static int ad_sd_buffer_postenable(struct iio_dev *indio_dev)
582582
return ret;
583583
}
584584

585-
static int ad_sd_buffer_postdisable(struct iio_dev *indio_dev)
585+
static int ad_sd_buffer_predisable(struct iio_dev *indio_dev)
586586
{
587587
struct ad_sigma_delta *sigma_delta = iio_device_get_drvdata(indio_dev);
588588

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

683683
static const struct iio_buffer_setup_ops ad_sd_buffer_setup_ops = {
684684
.postenable = &ad_sd_buffer_postenable,
685-
.postdisable = &ad_sd_buffer_postdisable,
685+
.predisable = &ad_sd_buffer_predisable,
686686
.validate_scan_mask = &ad_sd_validate_scan_mask,
687687
};
688688

0 commit comments

Comments
 (0)