Skip to content

Aliases inside dts leads to warnings #13434

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

Closed
tautologyclub opened this issue Feb 15, 2019 · 3 comments
Closed

Aliases inside dts leads to warnings #13434

tautologyclub opened this issue Feb 15, 2019 · 3 comments
Labels
area: Devicetree bug The issue is a bug, or the PR is fixing a bug

Comments

@tautologyclub
Copy link
Contributor

Having something like

aliases {
	apds9306 = &apds9306;
};

inside your dts now triggers the __DEPRECATED_MACRO warning because the dts generation script doesn't prefix alias-based defines with DT_. I doubt this was the intention. This was introduced in
commit 561d6dd with absurdly arbitrary exemptions for #defines that start with LED, SW and PWM_LED.

So the commit should probably be reverted until the dts-alias generation has been fixed so it prefixes its defines with DT_.

@tautologyclub tautologyclub added the bug The issue is a bug, or the PR is fixing a bug label Feb 15, 2019
@ulfalizer
Copy link
Collaborator

ulfalizer commented Feb 15, 2019

Looks like two different macros get generated for aliases - one with a DT_ prefix.

Check new_alias_prefix in add_prop_aliases() in scripts/dts/extract/globals.py, and commit a7c430f ("scripts: dts: Use DT_ prefix in generated labels").

@galak
Copy link
Collaborator

galak commented Feb 16, 2019

When we introduced the alias generation, we added DT_ prefix as @ulfalizer mentioned. So the non-DT_ one's are concerned deprecated.

@zerotri
Copy link

zerotri commented Apr 10, 2019

@galak @ulfalizer As the non-DT_ prefixed macros are being deprecated, is there any plan for generating macro labels that are less hardware specific?

In a prior release I could use an alias to define a macro SERIAL_RS232_LABEL that could translate to either DT_NS16550_SERIAL_RS232_LABEL or DT_ST_STM32_USART_SERIAL_RS232_LABEL depending on which board I was building for. The same code could potentially run unchanged on either. What is the recommended way of achieving this going forward without maintaining multiple configurations per board per application?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: Devicetree bug The issue is a bug, or the PR is fixing a bug
Projects
None yet
Development

No branches or pull requests

4 participants