mirror of
https://github.com/torvalds/linux.git
synced 2025-12-07 20:06:24 +00:00
iio: adc: ad7124: use devm_mutex_init()
Use devm_mutex_init() to initialize the mutex to handle automatically freeing in debug builds. Signed-off-by: David Lechner <dlechner@baylibre.com> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
This commit is contained in:
committed by
Jonathan Cameron
parent
b8579b7c6e
commit
0b028373f8
@@ -1486,7 +1486,10 @@ static int ad7124_setup(struct ad7124_state *st)
|
||||
st->adc_control &= ~AD7124_ADC_CONTROL_MODE;
|
||||
st->adc_control |= FIELD_PREP(AD7124_ADC_CONTROL_MODE, AD_SD_MODE_IDLE);
|
||||
|
||||
mutex_init(&st->cfgs_lock);
|
||||
ret = devm_mutex_init(dev, &st->cfgs_lock);
|
||||
if (ret)
|
||||
return ret;
|
||||
|
||||
INIT_KFIFO(st->live_cfgs_fifo);
|
||||
for (i = 0; i < st->num_channels; i++) {
|
||||
struct ad7124_channel_config *cfg = &st->channels[i].cfg;
|
||||
|
||||
Reference in New Issue
Block a user