Skip to content

Commit

Permalink
drivers: adc: stm32: use correct device in dma callback
Browse files Browse the repository at this point in the history
The device passed to the DMA callback is the DMA device. Instead use
the ADC device available in the private data.

Signed-off-by: Brett Witherspoon <[email protected]>
  • Loading branch information
bwitherspoon authored and fabiobaltieri committed Jul 3, 2023
1 parent bc60619 commit 8f73a47
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/adc/adc_stm32.c
Original file line number Diff line number Diff line change
Expand Up @@ -707,7 +707,7 @@ static void dma_callback(const struct device *dev, void *user_data,
{
/* user_data directly holds the adc device */
struct adc_stm32_data *data = user_data;
const struct adc_stm32_cfg *config = dev->config;
const struct adc_stm32_cfg *config = data->dev->config;
ADC_TypeDef *adc = (ADC_TypeDef *)config->base;

LOG_DBG("dma callback");
Expand Down

0 comments on commit 8f73a47

Please sign in to comment.