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: 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>

authored by

David Lechner and committed by
Jonathan Cameron
0b028373 b8579b7c

+4 -1
+4 -1
drivers/iio/adc/ad7124.c
··· 1486 1486 st->adc_control &= ~AD7124_ADC_CONTROL_MODE; 1487 1487 st->adc_control |= FIELD_PREP(AD7124_ADC_CONTROL_MODE, AD_SD_MODE_IDLE); 1488 1488 1489 - mutex_init(&st->cfgs_lock); 1489 + ret = devm_mutex_init(dev, &st->cfgs_lock); 1490 + if (ret) 1491 + return ret; 1492 + 1490 1493 INIT_KFIFO(st->live_cfgs_fifo); 1491 1494 for (i = 0; i < st->num_channels; i++) { 1492 1495 struct ad7124_channel_config *cfg = &st->channels[i].cfg;