You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nuttx.apache.org by GitBox <gi...@apache.org> on 2021/02/18 21:02:49 UTC

[GitHub] [incubator-nuttx] Palmitoxico commented on a change in pull request #2867: lpc17xx_40xx/lpc17_40_i2c.c: Propagate I2C I/O errors

Palmitoxico commented on a change in pull request #2867:
URL: https://github.com/apache/incubator-nuttx/pull/2867#discussion_r578742894



##########
File path: arch/arm/src/lpc17xx_40xx/lpc17_40_i2c.c
##########
@@ -242,7 +244,18 @@ static int lpc17_40_i2c_start(struct lpc17_40_i2cdev_s *priv)
            lpc17_40_i2c_timeout, (wdparm_t)priv);
   nxsem_wait(&priv->wait);
 
-  return priv->nmsg;

Review comment:
       I thought that returning the number o messages transmitted was required, but digging a little bit in the source code revealed that it is optional according to the I2C master driver documentation:
   https://github.com/apache/incubator-nuttx/blob/master/include/nuttx/i2c/i2c_master.h#L146-L154
   
   In this case, your suggestion seems cleaner. I'll update the PR.




----------------------------------------------------------------
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.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org