-
Notifications
You must be signed in to change notification settings - Fork 2.1k
drivers/hts221: adapt to i2c api return codes #9298
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Overall changes are OK,
Could you share some debug output or do you know if someone can test this device so we can move forward ?
BTW, why acquire/release are used several times in the init function ? never saw this behaviour.
I looked at the code more in depth, and this is perfectly fine in term of workflow: it's just that some private functions are not acquiring the bus before performing their read/write operations.
|
Sure, but this is first time I saw this. Is there any gain from doing this ? I don't have strong opinion about this. If the driver was already in this state before, this is not our rights to change it with the I2C refactoring. |
I think @smlng has the hardware, since he initially wrote this driver. Maybe he can comment on your other questions. |
drivers/hts221: adapt to i2c api return codes
drivers/hts221: adapt to i2c api return codes
drivers/hts221: adapt to i2c api return codes
Contribution description
This PR readapts the hts221 driver to the I2C return codes (< 0 in case of an error, 0 on success).
Issues/PRs references
Follow-up of #9195 and related to #6577