xiaoxiang781216 commented on code in PR #7472: URL: https://github.com/apache/incubator-nuttx/pull/7472#discussion_r1011146474
########## arch/arm/src/sama5/sam_adc.c: ########## @@ -497,11 +497,20 @@ static const struct adc_ops_s g_adcops = /* ADC internal state */ -static struct sam_adc_s g_adcpriv; +static struct sam_adc_s g_adcpriv = +{ + .lock = NXMUTEX_INITIALIZER, +}; /* ADC device instance */ -static struct adc_dev_s g_adcdev; +static struct adc_dev_s g_adcdev = +{ +#ifdef SAMA5_ADC_HAVE_CHANNELS + .ad_ops = &g_adcops, +#endif + .ad_priv = &g_adcpriv, +}; Review Comment: Yes, since the initialization is done in the definition ########## arch/arm/src/sama5/sam_adc.c: ########## @@ -2041,17 +2050,9 @@ struct adc_dev_s *sam_adc_initialize(void) /* Initialize the public ADC device data structure */ #ifdef SAMA5_ADC_HAVE_CHANNELS - g_adcdev.ad_ops = &g_adcops; priv->dev = &g_adcdev; #endif - g_adcdev.ad_priv = priv; Review Comment: Yes, since the initialization is done in the definition -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: commits-unsubscr...@nuttx.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org