can: dts: Convert can-primary alias to zephyr,can-primary chosen prop

Convert CAN to use a chosen node property that is similar to how we
handle zephyr,entroy or zephyr,flash-controller as the means to select a
specific peripheral instance utilized by a subsystem.

Replace references of the form:

alias {
	can-primary = &can1;
};

with:

chosen {
	zephyr,can-primary = &can1;
};

Replace various macro/define references with either
DT_CHOSEN(zephyr_can_primary) or replace DT_ALIAS_CAN_PRIMARY_LABEL
with DT_CHOSEN_ZEPHYR_CAN_PRIMARY_LABEL.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
This commit is contained in:
Kumar Gala 2020-04-28 07:33:18 -05:00 committed by Kumar Gala
commit 3f236f2183
22 changed files with 40 additions and 25 deletions

View file

@ -44,6 +44,15 @@
* a label property, that property's value. Undefined otherwise.
*/
#define DT_CHOSEN_ZEPHYR_FLASH_CONTROLLER_LABEL ""
/**
* @def DT_CHOSEN_ZEPHYR_CAN_PRIMARY_LABEL
*
* @brief If there is a chosen node zephyr,can-primary property which has
* a label property, that property's value. Undefined otherwise.
*/
#define DT_CHOSEN_ZEPHYR_CAN_PRIMARY_LABEL ""
#endif /* DT_DOXYGEN */
#if DT_NODE_HAS_PROP(DT_CHOSEN(zephyr_entropy), label)
@ -55,6 +64,10 @@
DT_LABEL(DT_CHOSEN(zephyr_flash_controller))
#endif
#if DT_NODE_HAS_PROP(DT_CHOSEN(zephyr_can_primary), label)
#define DT_CHOSEN_ZEPHYR_CAN_PRIMARY_LABEL \
DT_LABEL(DT_CHOSEN(zephyr_can_primary))
#endif
/**
* @}
*/