boards: remove extern mtd_dev_t *mtd<n> declarations from board definitions#20104
Conversation
9df918d to
c531cdd
Compare
extern mld_dev_t *mtd<n> declarations from board definitionsextern mtd_dev_t *mtd<n> declarations from board definitions
2a01590 to
1236536
Compare
|
Just wondering: |
No, I just forgot them, |
|
Please squash! |
drivers/include/mtd.h
Outdated
| #ifdef MTD_0 | ||
| extern mtd_dev_t *MTD_0; | ||
| #endif | ||
| #ifdef MTD_1 | ||
| extern mtd_dev_t *MTD_1; | ||
| #endif | ||
| #ifdef MTD_2 | ||
| extern mtd_dev_t *MTD_2; | ||
| #endif | ||
| #ifdef MTD_3 | ||
| extern mtd_dev_t *MTD_3; | ||
| #endif | ||
| #ifdef MTD_4 | ||
| extern mtd_dev_t *MTD_4; | ||
| #endif | ||
| #ifdef MTD_5 | ||
| extern mtd_dev_t *MTD_5; | ||
| #endif | ||
| #endif /* !DOXYGEN */ |
|
Hm why not rip off the band aid completely and replace I might also just submit a PR for that. |
How would you handle this case? RIOT/tests/pkg/littlefs/main.c Line 29 in 848f3d1 |
Do you think that all #define MTD_0 mtd_dev_get(0)instead of #define MTD0 mtd0 |
Assertions are used instead of returning a NULL pointer to detect errors in the MTD definition and access in the case that the return value is not evaluated.
Since the `extern mtd_dev_t *` declarations were removed from board definitions, `mtd_dev_get` has to be used instead.
Since the `extern mtd_dev_t *` declarations were removed from board definitions, `mtd_dev_get` has to be used instead.
Since the `extern mtd_dev_t *` declarations were removed from board definitions, `mtd_dev_get` has to be used instead.
4a21c4c to
c93f0a7
Compare
|
Thanks |
Contribution description
The PR removes the
extern mld_dev_t *mtd<n>declarations from board definitions.For that purpose, the
extern mtd_dev_t *mtd<n>declarations that use theMTD_<n>definitions of the board are moved frommtd_default.htomtd.hto declare them even if themtd_defaultmodule is not used.Testing procedure
Green CI.
Issues/PRs references
Prerequisite for PR #19786
Prerequisite for PR #19540