From 93f665e61920195963ec26db9fe2b9e34345ef2c Mon Sep 17 00:00:00 2001 From: Keith Short Date: Tue, 5 Oct 2021 17:15:46 -0600 Subject: [PATCH] net: if: Fix parameter in NET_DEVICE_DT_DEFINE_INSTANCE The NET_DEVICE_DT_DEFINE_INSTANCE() macro was passing an invalid dev_name to Z_NET_DEVICE_INIT_INSTANCE(). Change this parameter to get device name based on the node_id, matching other macros. Signed-off-by: Keith Short --- include/net/net_if.h | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/include/net/net_if.h b/include/net/net_if.h index 4822cd42c99..3f2b3e7c3f0 100644 --- a/include/net/net_if.h +++ b/include/net/net_if.h @@ -2391,13 +2391,14 @@ struct net_if_api { * @param l2_ctx_type Type of L2 context data. * @param mtu Maximum transfer unit in bytes for this network interface. */ -#define NET_DEVICE_DT_DEFINE_INSTANCE(node_id, instance, init_fn, \ - pm_control_fn, data, cfg, prio, \ - api, l2, l2_ctx_type, mtu) \ - Z_NET_DEVICE_INIT_INSTANCE(node_id, node_id, DT_LABEL(node_id), \ - instance, init_fn, pm_control_fn, \ - data, cfg, prio, api, l2, \ - l2_ctx_type, mtu) +#define NET_DEVICE_DT_DEFINE_INSTANCE(node_id, instance, init_fn, \ + pm_control_fn, data, cfg, prio, \ + api, l2, l2_ctx_type, mtu) \ + Z_NET_DEVICE_INIT_INSTANCE(node_id, \ + Z_DEVICE_DT_DEV_NAME(node_id), \ + DT_LABEL(node_id), instance, \ + pm_control_fn, data, cfg, prio, api, \ + l2, l2_ctx_type, mtu) /** * @def NET_DEVICE_DT_INST_DEFINE_INSTANCE