xiaoxiang781216 commented on code in PR #7472: URL: https://github.com/apache/incubator-nuttx/pull/7472#discussion_r1011967771
########## arch/arm/src/sama5/sam_tsd.c: ########## @@ -245,7 +245,12 @@ static const struct file_operations g_tsdops = /* The driver state structure is pre-allocated. */ -static struct sam_tsd_s g_tsd; +static struct sam_tsd_s g_tsd = +{ + .threshx = INVALID_THRESHOLD, + .threshy = INVALID_THRESHOLD, + .waitsem = SEM_INITIALIZER(0), Review Comment: yes ########## arch/arm/src/sama5/sam_tsd.c: ########## @@ -1650,11 +1655,7 @@ int sam_tsd_register(struct sam_adc_s *adc, int minor) /* Initialize the touchscreen device driver instance */ - memset(priv, 0, sizeof(struct sam_tsd_s)); - priv->adc = adc; /* Save the ADC device handle */ - priv->threshx = INVALID_THRESHOLD; /* Initialize thresholding logic */ - priv->threshy = INVALID_THRESHOLD; /* Initialize thresholding logic */ Review Comment: yes -- 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