xiaoxiang781216 commented on code in PR #7472:
URL: https://github.com/apache/incubator-nuttx/pull/7472#discussion_r1011966979


##########
arch/arm/src/sama5/sam_twi.c:
##########
@@ -1177,55 +1213,39 @@ struct i2c_master_s *sam_i2cbus_initialize(int bus)
 #ifdef CONFIG_SAMA5_TWI0
   if (bus == 0)
     {
-      /* Select up TWI0 and setup invariant attributes */
-
-      priv       = &g_twi0;
-      priv->attr = &g_twi0attr;
-
-      /* Select the (initial) TWI frequency */
+      /* Select up TWI0 and the (initial) TWI frequency */
 
+      priv      = &g_twi0;

Review Comment:
   yes



##########
arch/arm/src/sama5/sam_twi.c:
##########
@@ -282,16 +317,17 @@ static const struct twi_attr_s g_twi3attr =
   .base    = SAM_TWI3_VBASE,
 };
 
-static struct twi_dev_s g_twi3;
-#endif
-
-static const struct i2c_ops_s g_twiops =
+static struct twi_dev_s g_twi3 =
 {
-  .transfer = twi_transfer
-#ifdef CONFIG_I2C_RESET
-  , .reset  = twi_reset
-#endif
+  .dev     =
+  {
+    .ops   = &g_twiops,
+  },
+  .attr    = &g_twi3attr,

Review Comment:
   yes



##########
arch/arm/src/sama5/sam_twi.c:
##########
@@ -268,7 +294,16 @@ static const struct twi_attr_s g_twi2attr =
   .base    = SAM_TWI2_VBASE,
 };
 
-static struct twi_dev_s g_twi2;
+static struct twi_dev_s g_twi2 =
+{
+  .dev     =
+  {
+    .ops   = &g_twiops,
+  },
+  .attr    = &g_twi2attr,

Review Comment:
   yes



##########
arch/arm/src/sama5/sam_twi.c:
##########
@@ -254,7 +271,16 @@ static const struct twi_attr_s g_twi1attr =
   .base    = SAM_TWI1_VBASE,
 };
 
-static struct twi_dev_s g_twi1;
+static struct twi_dev_s g_twi1 =
+{
+  .dev     =
+  {
+    .ops   = &g_twiops,
+  },
+  .attr    = &g_twi1attr,

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

Reply via email to