diff --git a/drivers/video/video_mcux_csi.c b/drivers/video/video_mcux_csi.c index a9224145e1c0c8a..101549969d15245 100644 --- a/drivers/video/video_mcux_csi.c +++ b/drivers/video/video_mcux_csi.c @@ -18,16 +18,6 @@ #include #endif -#if defined(CONFIG_VIDEO_MCUX_MIPI_CSI2RX) -#define DEVICE_DT_INST_GET_SOURCE_DEV(n) \ - DEVICE_DT_GET(DT_PARENT(DT_GPARENT(DT_NODELABEL(DT_STRING_TOKEN( \ - DT_CHILD(DT_INST_CHILD(n, port), endpoint), remote_endpoint_label))))) -#else -#define DEVICE_DT_INST_GET_SOURCE_DEV(n) \ - DEVICE_DT_GET(DT_GPARENT(DT_NODELABEL(DT_STRING_TOKEN( \ - DT_CHILD(DT_INST_CHILD(n, port), endpoint), remote_endpoint_label)))) -#endif - struct video_mcux_csi_config { CSI_Type *base; const struct device *source_dev; @@ -502,7 +492,7 @@ PINCTRL_DT_INST_DEFINE(0); static const struct video_mcux_csi_config video_mcux_csi_config_0 = { .base = (CSI_Type *)DT_INST_REG_ADDR(0), - .source_dev = DEVICE_DT_INST_GET_SOURCE_DEV(0), + .source_dev = DEVICE_DT_GET(DT_NODE_REMOTE_DEVICE(DT_INST_ENDPOINT_BY_ID(0, 0, 0))), .pincfg = PINCTRL_DT_INST_DEV_CONFIG_GET(0), }; diff --git a/drivers/video/video_mcux_mipi_csi2rx.c b/drivers/video/video_mcux_mipi_csi2rx.c index e625fe7adb0baea..efb96637c52fad5 100644 --- a/drivers/video/video_mcux_mipi_csi2rx.c +++ b/drivers/video/video_mcux_mipi_csi2rx.c @@ -21,11 +21,6 @@ LOG_MODULE_REGISTER(video_mipi_csi2rx, CONFIG_VIDEO_LOG_LEVEL); #define ABS(a, b) (a > b ? a - b : b - a) -#define DEVICE_DT_INST_GET_SENSOR_DEV(n) \ - DEVICE_DT_GET(DT_GPARENT(DT_NODELABEL( \ - DT_STRING_TOKEN(DT_CHILD(DT_CHILD(DT_INST_CHILD(n, ports), port_1), endpoint), \ - remote_endpoint_label)))) - struct mipi_csi2rx_config { const MIPI_CSI2RX_Type *base; const struct device *sensor_dev; @@ -349,9 +344,7 @@ static int mipi_csi2rx_init(const struct device *dev) #define MIPI_CSI2RX_INIT(n) \ static struct mipi_csi2rx_data mipi_csi2rx_data_##n = { \ - .csi2rxConfig.laneNum = \ - DT_PROP_LEN(DT_CHILD(DT_CHILD(DT_INST_CHILD(n, ports), port_1), endpoint), \ - data_lanes), \ + .csi2rxConfig.laneNum = DT_PROP_LEN(DT_INST_ENDPOINT_BY_ID(n, 1, 0), data_lanes), \ .clock_dev = DEVICE_DT_GET(DT_INST_CLOCKS_CTLR(n)), \ .clock_root = (clock_control_subsys_t)DT_INST_CLOCKS_CELL_BY_IDX(n, 0, name), \ .clock_ui = (clock_control_subsys_t)DT_INST_CLOCKS_CELL_BY_IDX(n, 1, name), \ @@ -360,7 +353,8 @@ static int mipi_csi2rx_init(const struct device *dev) \ static const struct mipi_csi2rx_config mipi_csi2rx_config_##n = { \ .base = (MIPI_CSI2RX_Type *)DT_INST_REG_ADDR(n), \ - .sensor_dev = DEVICE_DT_INST_GET_SENSOR_DEV(n), \ + .sensor_dev = \ + DEVICE_DT_GET(DT_NODE_REMOTE_DEVICE(DT_INST_ENDPOINT_BY_ID(n, 1, 0))), \ }; \ \ DEVICE_DT_INST_DEFINE(n, &mipi_csi2rx_init, NULL, &mipi_csi2rx_data_##n, \