@@ -1080,10 +1080,7 @@ static void adc_context_start_sampling(struct adc_context *ctx)
1080
1080
CONTAINER_OF (ctx , struct adc_stm32_data , ctx );
1081
1081
const struct device * dev = data -> dev ;
1082
1082
const struct adc_stm32_cfg * config = dev -> config ;
1083
- ADC_TypeDef * adc = config -> base ;
1084
-
1085
- /* Remove warning for some series */
1086
- ARG_UNUSED (adc );
1083
+ __maybe_unused ADC_TypeDef * adc = config -> base ;
1087
1084
1088
1085
data -> repeat_buffer = data -> buffer ;
1089
1086
@@ -1154,7 +1151,7 @@ static void adc_context_on_complete(struct adc_context *ctx, int status)
1154
1151
struct adc_stm32_data * data =
1155
1152
CONTAINER_OF (ctx , struct adc_stm32_data , ctx );
1156
1153
const struct adc_stm32_cfg * config = data -> dev -> config ;
1157
- ADC_TypeDef * adc = config -> base ;
1154
+ __maybe_unused ADC_TypeDef * adc = config -> base ;
1158
1155
1159
1156
ARG_UNUSED (status );
1160
1157
@@ -1165,8 +1162,6 @@ static void adc_context_on_complete(struct adc_context *ctx, int status)
1165
1162
#if defined(CONFIG_SOC_SERIES_STM32H7X ) || defined(CONFIG_SOC_SERIES_STM32U5X )
1166
1163
/* Reset channel preselection register */
1167
1164
LL_ADC_SetChannelPreselection (adc , 0 );
1168
- #else
1169
- ARG_UNUSED (adc );
1170
1165
#endif /* CONFIG_SOC_SERIES_STM32H7X || CONFIG_SOC_SERIES_STM32U5X */
1171
1166
}
1172
1167
@@ -1237,7 +1232,7 @@ static int adc_stm32_sampling_time_setup(const struct device *dev, uint8_t id,
1237
1232
const struct adc_stm32_cfg * config =
1238
1233
(const struct adc_stm32_cfg * )dev -> config ;
1239
1234
ADC_TypeDef * adc = config -> base ;
1240
- struct adc_stm32_data * data = dev -> data ;
1235
+ __maybe_unused struct adc_stm32_data * data = dev -> data ;
1241
1236
1242
1237
int acq_time_index ;
1243
1238
@@ -1255,7 +1250,6 @@ static int adc_stm32_sampling_time_setup(const struct device *dev, uint8_t id,
1255
1250
switch (config -> num_sampling_time_common_channels ) {
1256
1251
case 0 :
1257
1252
#if ANY_NUM_COMMON_SAMPLING_TIME_CHANNELS_IS (0 )
1258
- ARG_UNUSED (data );
1259
1253
LL_ADC_SetChannelSamplingTime (adc ,
1260
1254
__LL_ADC_DECIMAL_NB_TO_CHANNEL (id ),
1261
1255
(uint32_t )acq_time_index );
@@ -1491,11 +1485,9 @@ static int adc_stm32_set_clock(const struct device *dev)
1491
1485
{
1492
1486
const struct adc_stm32_cfg * config = dev -> config ;
1493
1487
const struct device * const clk = DEVICE_DT_GET (STM32_CLOCK_CONTROL_NODE );
1494
- ADC_TypeDef * adc = config -> base ;
1488
+ __maybe_unused ADC_TypeDef * adc = config -> base ;
1495
1489
int ret = 0 ;
1496
1490
1497
- ARG_UNUSED (adc ); /* Necessary to avoid warnings on some series */
1498
-
1499
1491
if (clock_control_on (clk ,
1500
1492
(clock_control_subsys_t ) & config -> pclken [0 ]) != 0 ) {
1501
1493
return - EIO ;
@@ -1560,11 +1552,9 @@ static int adc_stm32_init(const struct device *dev)
1560
1552
struct adc_stm32_data * data = dev -> data ;
1561
1553
const struct adc_stm32_cfg * config = dev -> config ;
1562
1554
const struct device * const clk = DEVICE_DT_GET (STM32_CLOCK_CONTROL_NODE );
1563
- ADC_TypeDef * adc = config -> base ;
1555
+ __maybe_unused ADC_TypeDef * adc = config -> base ;
1564
1556
int err ;
1565
1557
1566
- ARG_UNUSED (adc ); /* Necessary to avoid warnings on some series */
1567
-
1568
1558
LOG_DBG ("Initializing %s" , dev -> name );
1569
1559
1570
1560
if (!device_is_ready (clk )) {
0 commit comments