xiaoxiang781216 commented on code in PR #7472: URL: https://github.com/apache/incubator-nuttx/pull/7472#discussion_r1011966630
########## arch/arm/src/sama5/sam_twi.c: ########## @@ -1248,15 +1268,6 @@ struct i2c_master_s *sam_i2cbus_initialize(int bus) goto errout_with_lock; } - /* Initialize the TWI driver structure */ - - priv->dev.ops = &g_twiops; Review Comment: yes ########## 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; frequency = CONFIG_SAMA5_TWI0_FREQUENCY; } else #endif #ifdef CONFIG_SAMA5_TWI1 if (bus == 1) { - /* Select up TWI1 and setup invariant attributes */ - - priv = &g_twi1; - priv->attr = &g_twi1attr; - - /* Select the (initial) TWI frequency */ + /* Select up TWI1 and the (initial) TWI frequency */ + priv = &g_twi1; frequency = CONFIG_SAMA5_TWI1_FREQUENCY; } else #endif #ifdef CONFIG_SAMA5_TWI2 if (bus == 2) { - /* Select up TWI2 and setup invariant attributes */ - - priv = &g_twi2; - priv->attr = &g_twi2attr; - - /* Select the (initial) TWI frequency */ + /* Select up TWI2 and the (initial) TWI frequency */ + priv = &g_twi2; frequency = CONFIG_SAMA5_TWI2_FREQUENCY; } else #endif #ifdef CONFIG_SAMA5_TWI3 if (bus == 3) { - /* Select up TWI3 and setup invariant attributes */ - - priv = &g_twi3; - priv->attr = &g_twi3attr; - - /* Select the (initial) TWI frequency */ + /* Select up TWI3 and the (initial) TWI frequency */ + priv = &g_twi3; Review Comment: yes ########## 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; frequency = CONFIG_SAMA5_TWI0_FREQUENCY; } else #endif #ifdef CONFIG_SAMA5_TWI1 if (bus == 1) { - /* Select up TWI1 and setup invariant attributes */ - - priv = &g_twi1; - priv->attr = &g_twi1attr; - - /* Select the (initial) TWI frequency */ + /* Select up TWI1 and the (initial) TWI frequency */ + priv = &g_twi1; frequency = CONFIG_SAMA5_TWI1_FREQUENCY; } else #endif #ifdef CONFIG_SAMA5_TWI2 if (bus == 2) { - /* Select up TWI2 and setup invariant attributes */ - - priv = &g_twi2; - priv->attr = &g_twi2attr; - - /* Select the (initial) TWI frequency */ + /* Select up TWI2 and the (initial) TWI frequency */ + priv = &g_twi2; Review Comment: yes ########## 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; frequency = CONFIG_SAMA5_TWI0_FREQUENCY; } else #endif #ifdef CONFIG_SAMA5_TWI1 if (bus == 1) { - /* Select up TWI1 and setup invariant attributes */ - - priv = &g_twi1; - priv->attr = &g_twi1attr; - - /* Select the (initial) TWI frequency */ + /* Select up TWI1 and the (initial) TWI frequency */ + priv = &g_twi1; 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