drivers: ieee802154: mcr20a: define as DT device

The device already has a DT compatible (and uses DT properties).
Instantiate the device using the DT-based macros and remove hardcoded
name.

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
This commit is contained in:
Gerard Marull-Paretas 2022-01-31 23:43:26 +01:00 committed by Anas Nashif
commit 5314690c3b
3 changed files with 7 additions and 17 deletions

View file

@ -9,12 +9,6 @@ menuconfig IEEE802154_MCR20A
if IEEE802154_MCR20A
config IEEE802154_MCR20A_DRV_NAME
string "NXP MCR20A Driver's name"
default "mcr20a"
help
This option sets the driver name
config MCR20A_IS_PART_OF_KW2XD_SIP
bool "MCR20A device is part of KW2xD SiP"
help

View file

@ -1477,15 +1477,12 @@ static struct ieee802154_radio_api mcr20a_radio_api = {
};
#if defined(CONFIG_IEEE802154_RAW_MODE)
DEVICE_DEFINE(mcr20a, CONFIG_IEEE802154_MCR20A_DRV_NAME,
mcr20a_init, NULL, &mcr20a_context_data, NULL,
POST_KERNEL, CONFIG_IEEE802154_MCR20A_INIT_PRIO,
&mcr20a_radio_api);
DEVICE_DT_INST_DEFINE(0, mcr20a_init, NULL, &mcr20a_context_data, NULL,
POST_KERNEL, CONFIG_IEEE802154_MCR20A_INIT_PRIO,
&mcr20a_radio_api);
#else
NET_DEVICE_INIT(mcr20a, CONFIG_IEEE802154_MCR20A_DRV_NAME,
mcr20a_init, NULL, &mcr20a_context_data, NULL,
CONFIG_IEEE802154_MCR20A_INIT_PRIO,
&mcr20a_radio_api, IEEE802154_L2,
NET_L2_GET_CTX_TYPE(IEEE802154_L2),
MCR20A_PSDU_LENGTH);
NET_DEVICE_DT_INST_DEFINE(0, mcr20a_init, NULL, &mcr20a_context_data, NULL,
CONFIG_IEEE802154_MCR20A_INIT_PRIO, &mcr20a_radio_api,
IEEE802154_L2, NET_L2_GET_CTX_TYPE(IEEE802154_L2),
MCR20A_PSDU_LENGTH);
#endif

View file

@ -448,7 +448,6 @@ CONFIG_NET_DEBUG_L2_IEEE802154_DISPLAY_PACKET_TX=y
#CONFIG_IEEE802154_KW41Z=y
#CONFIG_SPI=y
#CONFIG_IEEE802154_MCR20A_DRV_NAME="MCR20A2"
#CONFIG_IEEE802154_MCR20A_INIT_PRIO=90
#CONFIG_IEEE802154_MCR20A=y
#CONFIG_IEEE802154_MCR20A_RX_STACK_SIZE=1024