Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

gpu: drm: replace of_graph_get_next_endpoint()

From DT point of view, in general, drivers should be asking for a
specific port number because their function is fixed in the binding.

of_graph_get_next_endpoint() doesn't match to this concept.

Simply replace

- of_graph_get_next_endpoint(xxx, NULL);
+ of_graph_get_endpoint_by_regs(xxx, 0, -1);

Link: https://lore.kernel.org/r/20240202174941.GA310089-robh@kernel.org
Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
Link: https://patchwork.freedesktop.org/patch/msgid/87frob3neo.wl-kuninori.morimoto.gx@renesas.com

authored by

Kuninori Morimoto and committed by
Thomas Zimmermann
17558f97 d84927a4

+5 -3
+3 -1
drivers/gpu/drm/drm_of.c
··· 564 564 * Gets parent DSI bus for a DSI device controlled through a bus other 565 565 * than MIPI-DCS (SPI, I2C, etc.) using the Device Tree. 566 566 * 567 + * This function assumes that the device's port@0 is the DSI input. 568 + * 567 569 * Returns pointer to mipi_dsi_host if successful, -EINVAL if the 568 570 * request is unsupported, -EPROBE_DEFER if the DSI host is found but 569 571 * not available, or -ENODEV otherwise. ··· 578 576 /* 579 577 * Get first endpoint child from device. 580 578 */ 581 - endpoint = of_graph_get_next_endpoint(dev->of_node, NULL); 579 + endpoint = of_graph_get_endpoint_by_regs(dev->of_node, 0, -1); 582 580 if (!endpoint) 583 581 return ERR_PTR(-ENODEV); 584 582
+1 -1
drivers/gpu/drm/panel/panel-raspberrypi-touchscreen.c
··· 400 400 rpi_touchscreen_i2c_write(ts, REG_POWERON, 0); 401 401 402 402 /* Look up the DSI host. It needs to probe before we do. */ 403 - endpoint = of_graph_get_next_endpoint(dev->of_node, NULL); 403 + endpoint = of_graph_get_endpoint_by_regs(dev->of_node, 0, -1); 404 404 if (!endpoint) 405 405 return -ENODEV; 406 406
+1 -1
drivers/gpu/drm/tiny/arcpgu.c
··· 289 289 * There is only one output port inside each device. It is linked with 290 290 * encoder endpoint. 291 291 */ 292 - endpoint_node = of_graph_get_next_endpoint(pdev->dev.of_node, NULL); 292 + endpoint_node = of_graph_get_endpoint_by_regs(pdev->dev.of_node, 0, -1); 293 293 if (endpoint_node) { 294 294 encoder_node = of_graph_get_remote_port_parent(endpoint_node); 295 295 of_node_put(endpoint_node);