Skip to content

Commit

Permalink
ad4630: handle spi_engine_ex_offload_load_msg() error
Browse files Browse the repository at this point in the history
Add another error unwinding case and check the return value of the
spi_engine_ex_offload_load_msg() function. This isn't currently being
handled in ad4630_buffer_preenable().

Signed-off-by: Trevor Gamblin <[email protected]>
  • Loading branch information
threexc committed Jan 10, 2025
1 parent 930e7a0 commit 95ff279
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion drivers/iio/adc/ad4630.c
Original file line number Diff line number Diff line change
Expand Up @@ -735,7 +735,10 @@ static int ad4630_buffer_preenable(struct iio_dev *indio_dev)
goto out_reset_mode;

spi_bus_lock(st->spi->master);
spi_engine_ex_offload_load_msg(st->spi, &st->offload_msg);
ret = spi_engine_ex_offload_load_msg(st->spi, &st->offload_msg);
if (ret)
goto out_unoptimize;

spi_engine_ex_offload_enable(st->spi, true);

ret = pwm_set_waveform_might_sleep(st->conv_trigger, &st->conv_wf, false);
Expand All @@ -755,6 +758,7 @@ static int ad4630_buffer_preenable(struct iio_dev *indio_dev)
out_offload_disable:
spi_engine_ex_offload_enable(st->spi, false);
spi_bus_unlock(st->spi->master);
out_unoptimize:
spi_unoptimize_message(&st->offload_msg);
out_reset_mode:
/* read this to reenter register configuration mode */
Expand Down

0 comments on commit 95ff279

Please sign in to comment.