mirror of
https://github.com/torvalds/linux.git
synced 2026-05-26 08:02:27 +02:00
iio: adc: ade9000: move mutex init before IRQ registration
Move devm_mutex_init() before ade9000_request_irq() calls so that
st->lock is initialized before any handler that depends on it can run.
Fixes: 81de7b4619 ("iio: adc: add ade9000 support")
Signed-off-by: Antoniu Miclaus <antoniu.miclaus@analog.com>
Reviewed-by: Andy Shevchenko <andriy.shevchenko@intel.com>
Cc: <Stable@vger.kernel.org>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
This commit is contained in:
parent
c53bca0924
commit
0206dd3641
|
|
@ -1706,6 +1706,10 @@ static int ade9000_probe(struct spi_device *spi)
|
|||
|
||||
init_completion(&st->reset_completion);
|
||||
|
||||
ret = devm_mutex_init(dev, &st->lock);
|
||||
if (ret)
|
||||
return ret;
|
||||
|
||||
ret = ade9000_request_irq(dev, "irq0", ade9000_irq0_thread, indio_dev);
|
||||
if (ret)
|
||||
return ret;
|
||||
|
|
@ -1718,10 +1722,6 @@ static int ade9000_probe(struct spi_device *spi)
|
|||
if (ret)
|
||||
return ret;
|
||||
|
||||
ret = devm_mutex_init(dev, &st->lock);
|
||||
if (ret)
|
||||
return ret;
|
||||
|
||||
/* External CMOS clock input (optional - crystal can be used instead) */
|
||||
st->clkin = devm_clk_get_optional_enabled(dev, NULL);
|
||||
if (IS_ERR(st->clkin))
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user