Skip to content

device: increase consistency in device declarations #25712

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

Merged
merged 2 commits into from
Jun 8, 2020

Conversation

pabigot
Copy link
Contributor

@pabigot pabigot commented May 28, 2020

This PR has two patches (updated) from #25208 to make it easier to locate and possibly transform existing device declarations by using existing helper macros consistently in places where currently the value they expand to is used directly.

Specifically DEVICE_NAME_GET() is used rather than prepending __device_ to the device name, and DEVICE_DECLARE is used rather than an explicit declararation.

@zephyrbot
Copy link

zephyrbot commented May 28, 2020

All checks are passing now.

Tip: The bot edits this comment instead of posting a new one, so you can check the comment's history to see earlier messages.

pabigot added 2 commits June 8, 2020 08:41
Replace individual device instance definitions with the macro that
expands to the equivalent change.

    F='struct device DEVICE_NAME_GET'
    git grep -l "$F" \
     | xargs sed -i -r \
       -e "s@$F"'\(([^)]*)\);@DEVICE_DECLARE(\1);@'

Signed-off-by: Peter Bigot <[email protected]>
Avoid duplication of the encoding of the public device identifier by
using the constructing macro in definitions.

Signed-off-by: Peter Bigot <[email protected]>
@pabigot pabigot force-pushed the nordic/20200528a branch from ab23695 to d9771f1 Compare June 8, 2020 13:42
@pabigot
Copy link
Contributor Author

pabigot commented Jun 8, 2020

Could somebody please merge? I'm starting to investigate techniques for device handles, and making the declarations more uniform will simplify the refactoring.

@nashif nashif merged commit 7d3b299 into zephyrproject-rtos:master Jun 8, 2020
@pabigot pabigot deleted the nordic/20200528a branch June 16, 2020 20:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants