[PATCH v4 13/25] drm/tilcdc: Remove the useless module list support
From: "Kory Maincent (TI.com)" <kory.maincent@bootlin.com>
Date: 2026-01-16 17:03:21
Also in:
dri-devel, linux-devicetree, linux-omap, lkml
Subsystem:
drm drivers, drm drivers and misc gpu patches, drm drivers for ti lcdc, the rest · Maintainers:
David Airlie, Simona Vetter, Maarten Lankhorst, Maxime Ripard, Thomas Zimmermann, Jyri Sarha, Tomi Valkeinen, Linus Torvalds
The tilcdc driver previously supported a sub-module system where external display drivers (panels, encoders) could register themselves through tilcdc_module_init() and be automatically initialized through a module list. This infrastructure became unused after the component framework support and panel driver was removed. Reviewed-by: Luca Ceresoli <luca.ceresoli@bootlin.com> Signed-off-by: Kory Maincent (TI.com) <kory.maincent@bootlin.com> --- Change in v3: - Move the removal of module_init/exit in a following patch. --- drivers/gpu/drm/tilcdc/tilcdc_drv.c | 29 ----------------------------- drivers/gpu/drm/tilcdc/tilcdc_drv.h | 27 --------------------------- 2 files changed, 56 deletions(-)
diff --git a/drivers/gpu/drm/tilcdc/tilcdc_drv.c b/drivers/gpu/drm/tilcdc/tilcdc_drv.c
index d0503778b5f6f..20f93240b335c 100644
--- a/drivers/gpu/drm/tilcdc/tilcdc_drv.c
+++ b/drivers/gpu/drm/tilcdc/tilcdc_drv.c@@ -7,7 +7,6 @@ /* LCDC DRM driver, based on da8xx-fb */ #include <linux/mod_devicetable.h> -#include <linux/module.h> #include <linux/pinctrl/consumer.h> #include <linux/platform_device.h> #include <linux/pm_runtime.h>
@@ -34,8 +33,6 @@ enum tilcdc_variant { DA850_TILCDC, }; -static LIST_HEAD(module_list); - static const u32 tilcdc_rev1_formats[] = { DRM_FORMAT_RGB565 }; static const u32 tilcdc_straight_formats[] = { DRM_FORMAT_RGB565,
@@ -50,20 +47,6 @@ static const u32 tilcdc_legacy_formats[] = { DRM_FORMAT_RGB565, DRM_FORMAT_RGB888, DRM_FORMAT_XRGB8888 }; -void tilcdc_module_init(struct tilcdc_module *mod, const char *name, - const struct tilcdc_module_ops *funcs) -{ - mod->name = name; - mod->funcs = funcs; - INIT_LIST_HEAD(&mod->list); - list_add(&mod->list, &module_list); -} - -void tilcdc_module_cleanup(struct tilcdc_module *mod) -{ - list_del(&mod->list); -} - static int tilcdc_atomic_check(struct drm_device *dev, struct drm_atomic_state *state) {
@@ -97,12 +80,6 @@ static const struct drm_mode_config_funcs mode_config_funcs = { static void modeset_init(struct drm_device *dev) { struct tilcdc_drm_private *priv = dev->dev_private; - struct tilcdc_module *mod; - - list_for_each_entry(mod, &module_list, list) { - DBG("loading module: %s", mod->name); - mod->funcs->modeset_init(mod, dev); - } dev->mode_config.min_width = 0; dev->mode_config.min_height = 0;
@@ -465,15 +442,9 @@ static struct drm_info_list tilcdc_debugfs_list[] = { static void tilcdc_debugfs_init(struct drm_minor *minor) { - struct tilcdc_module *mod; - drm_debugfs_create_files(tilcdc_debugfs_list, ARRAY_SIZE(tilcdc_debugfs_list), minor->debugfs_root, minor); - - list_for_each_entry(mod, &module_list, list) - if (mod->funcs->debugfs_init) - mod->funcs->debugfs_init(mod, minor); } #endif
diff --git a/drivers/gpu/drm/tilcdc/tilcdc_drv.h b/drivers/gpu/drm/tilcdc/tilcdc_drv.h
index dafb00908d1d4..60e85e29b1063 100644
--- a/drivers/gpu/drm/tilcdc/tilcdc_drv.h
+++ b/drivers/gpu/drm/tilcdc/tilcdc_drv.h@@ -81,33 +81,6 @@ struct tilcdc_drm_private { bool irq_enabled; }; -/* Sub-module for display. Since we don't know at compile time what panels - * or display adapter(s) might be present (for ex, off chip dvi/tfp410, - * hdmi encoder, various lcd panels), the connector/encoder(s) are split into - * separate drivers. If they are probed and found to be present, they - * register themselves with tilcdc_register_module(). - */ -struct tilcdc_module; - -struct tilcdc_module_ops { - /* create appropriate encoders/connectors: */ - int (*modeset_init)(struct tilcdc_module *mod, struct drm_device *dev); -#ifdef CONFIG_DEBUG_FS - /* create debugfs nodes (can be NULL): */ - int (*debugfs_init)(struct tilcdc_module *mod, struct drm_minor *minor); -#endif -}; - -struct tilcdc_module { - const char *name; - struct list_head list; - const struct tilcdc_module_ops *funcs; -}; - -void tilcdc_module_init(struct tilcdc_module *mod, const char *name, - const struct tilcdc_module_ops *funcs); -void tilcdc_module_cleanup(struct tilcdc_module *mod); - #define DBG(fmt, ...) DRM_DEBUG(fmt"\n", ##__VA_ARGS__) int tilcdc_crtc_create(struct drm_device *dev);
--
2.43.0