Skip to content
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

drivers/at25xxx: return read/written bytes to match MTD API [backport 2020.04] #13887

Conversation

benpicco
Copy link
Contributor

Backport of #13886

Contribution description

The MTD API expects read() to return the number of read bytes and write() to return the number of written bytes.
This also matches the behavior of periph/eeprom.h.

So change the driver API to match that.

Testing procedure

tests/driver_at25xxx should still work.

2020-04-17 11:58:34,252 # AT25XXX EEPROM driver test application
2020-04-17 11:58:34,252 # 
2020-04-17 11:58:34,254 # EEPROM size: 128 kiB
2020-04-17 11:58:34,257 # EEPROM page size: 256 bytes
2020-04-17 11:58:34,259 # EEPROM address length: 24 bits
2020-04-17 11:58:34,259 # 
2020-04-17 11:58:34,302 # ...
2020-04-17 11:58:34,303 # OK (3 tests)

Issues/PRs references

needed for #13877

The MTD API expects read() to return the number of read bytes and
write() to return the number of written bytes.

So change the driver API to match that.

(cherry picked from commit 8a2a936)
@benpicco benpicco added Area: drivers Area: Device drivers CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR Process: release backport Integration Process: The PR is a release backport of a change previously provided to master Type: cleanup The issue proposes a clean-up / The PR cleans-up parts of the codebase / documentation labels Apr 17, 2020
@benpicco benpicco requested a review from maribu April 17, 2020 11:15
@benpicco benpicco added this to the Release 2020.04 milestone Apr 17, 2020
@benpicco benpicco added the Process: API change Integration Process: PR contains or issue proposes an API change. Should be handled with care. label Apr 17, 2020
@benpicco
Copy link
Contributor Author

The driver was introduced during this release cycle, so the change of the API should also be part of this release.

@maribu
Copy link
Member

maribu commented Apr 17, 2020

I lost track of time. We are still in soft feature freeze, right? If so, we should get this in soon.

@benpicco
Copy link
Contributor Author

It's hard feature freeze already, but I hoped I could still slip this API change it - since the driver was just added during this cycle, it would make it as if there was no API change at all 😉

@leandrolanzieri
Copy link
Contributor

I'm fine with having this in the release. The API has not been released yet

Copy link
Contributor

@leandrolanzieri leandrolanzieri left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As in the original PR, we trust the output provided by @benpicco. ACK

@leandrolanzieri leandrolanzieri merged commit 3fc6264 into RIOT-OS:2020.04-branch Apr 17, 2020
@benpicco benpicco deleted the backport/2020.04/drivers/at25xxx_api_conformity branch April 17, 2020 13:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area: drivers Area: Device drivers CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR Process: API change Integration Process: PR contains or issue proposes an API change. Should be handled with care. Process: release backport Integration Process: The PR is a release backport of a change previously provided to master Type: cleanup The issue proposes a clean-up / The PR cleans-up parts of the codebase / documentation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants