DT_SPI_DEV_CS_GPIOS_DT_SPEC_GET is a layering violation that shouldn't exist #42149
Labels
bug
The issue is a bug, or the PR is fixing a bug
priority: high
High impact/importance bug
Release Blocker
Use this label for justified release blockers
Milestone
Describe the bug
This macro, introduced in commit 4d1c90e (pull request #39116), should not have been added to the devicetree API.
It is a layering violation that introduces an unnecessary circular dependency:
struct gpio_dt_spec
is defined by the GPIO API (drivers/gpio.h
)devicetree.h
), and uses this dependency to definestruct gpio_dt_spec
struct gpio_dt_spec
This is bad design. We don't add such things to the DT API, in order to keep our API dependencies clean.
This should have been added to the SPI API, not the devicetree API.
Impact
DT showstopper for v3.0, since devicetree.h is a stable API, and we really should not have this macro added to it in any release.
We haven't created a release with DT_SPI_DEV_CS_GPIOS_DT_SPEC_GET in it yet as far as I can tell, so there's still time to fix it without having to go through a deprecation cycle and stable API change.
The text was updated successfully, but these errors were encountered: