xiaoxiang781216 commented on code in PR #7472: URL: https://github.com/apache/incubator-nuttx/pull/7472#discussion_r1011965503
########## arch/arm/src/samd2l2/sam_i2c_master.c: ########## @@ -1253,83 +1307,59 @@ struct i2c_master_s *sam_i2c_master_initialize(int bus) #ifdef SAMD2L2_HAVE_I2C0 if (bus == 0) { - /* Select up I2C0 and setup invariant attributes */ + /* Select up I2C0 and the (initial) I2C frequency */ priv = &g_i2c0; - priv->attr = &g_i2c0attr; Review Comment: yes ########## arch/arm/src/samd2l2/sam_i2c_master.c: ########## @@ -359,16 +412,17 @@ static const struct i2c_attr_s g_i2c5attr = .base = SAM_SERCOM5_BASE, }; -static struct sam_i2c_dev_s g_i2c5; -#endif - -struct i2c_ops_s g_i2cops = +static struct sam_i2c_dev_s g_i2c5 = { - .transfer = sam_i2c_transfer, -#ifdef CONFIG_I2C_RESET - .reset = sam_i2c_reset, -#endif + .dev = + { + .ops = &g_i2cops, + }, + .attr = &g_i2c5attr, Review Comment: yes ########## arch/arm/src/samd2l2/sam_i2c_master.c: ########## @@ -341,7 +385,16 @@ static const struct i2c_attr_s g_i2c4attr = .base = SAM_SERCOM4_BASE, }; -static struct sam_i2c_dev_s g_i2c4; +static struct sam_i2c_dev_s g_i2c4 = +{ + .dev = + { + .ops = &g_i2cops, + }, + .attr = &g_i2c4attr, 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