Skip to contentSkip to conversation

drm/mipi-dsi: Unregister bus at exit

PATCH In review Takashi Iwai 2 participants 3 messages Aug 2, 2016 – Aug 4, 2016

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/2 drm/mipi-dsi: Unregister bus at exit

This is a preliminary patch for building drm-mipi-dsi as a module. Add the module exit callback to unregister the bus properly.

---
 drivers/gpu/drm/drm_mipi_dsi.c | 6 ++++++
 1 file changed, 6 insertions(+)
drivers/gpu/drm/drm_mipi_dsi.c +6 -0
index f5d80839a90c..e2f3441663be 100644
@@ -1069,6 +1069,12 @@ static int __init mipi_dsi_bus_init(void)
 }
 postcore_initcall(mipi_dsi_bus_init);
 
+static void __exit mipi_dsi_bus_exit(void)
+{
+	bus_unregister(&mipi_dsi_bus_type);
+}
+module_exit(mipi_dsi_bus_exit);
+
 MODULE_AUTHOR("Andrzej Hajda <[email protected]>");
 MODULE_DESCRIPTION("MIPI DSI Bus");
 MODULE_LICENSE("GPL and additional rights");
Signature · 6 lines
2.9.2

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
#1 lore raw

PATCH 2/2 drm/mipi-dsi: Allow to build drm-mipi-dsi as a module

The drm-mipi-dsi driver has been only built-in although this isn't strictly required to be so. Since it's referred by lots of DRM drivers nowadays, most of distro kernels include the driver as built-in as a result, even though many systems don't need it at all.

This patch fixes Kconfig to allow drm-mipi-dsi driver built as a module, so that we can save footprint on systems without such DRM drivers. The probe order is managed by the module dependency, and postcore_initcall() works just fine as a module init call.

---
 drivers/gpu/drm/Kconfig | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/Kconfig +1 -1
index fc357319de35..67668a04baf6 100644
@@ -22,7 +22,7 @@ menuconfig DRM
 	  (/dev/agpgart) support if it is available for your platform.
 
 config DRM_MIPI_DSI
-	bool
+	tristate
 	depends on DRM
 
 config DRM_DP_AUX_CHARDEV
Signature · 6 lines
2.9.2

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
Reviewed-by on v1 1/2
#2 lore raw
In reply to Takashi Iwai
Quoted 5 lines · Takashi Iwai

This is a preliminary patch for building drm-mipi-dsi as a module. Add the module exit callback to unregister the bus properly.

For both patches:

--
Regards
Andrzej

Quoted 11 lines
---
 drivers/gpu/drm/drm_mipi_dsi.c | 6 ++++++
 1 file changed, 6 insertions(+)
drivers/gpu/drm/drm_mipi_dsi.c +0 -0
index f5d80839a90c..e2f3441663be 100644
@@ -1069,6 +1069,12 @@ static int __init mipi_dsi_bus_init(void)
 }
 postcore_initcall(mipi_dsi_bus_init);

drivers/gpu/drm/drm_mipi_dsi.c static int __init mipi_dsi_bus_init(void) · line 1080

Quoted 10 lines
drivers/gpu/drm/drm_mipi_dsi.c +6 -0
 
+static void __exit mipi_dsi_bus_exit(void)
+{
+	bus_unregister(&mipi_dsi_bus_type);
+}
+module_exit(mipi_dsi_bus_exit);
+
 MODULE_AUTHOR("Andrzej Hajda <[email protected]>");
 MODULE_DESCRIPTION("MIPI DSI Bus");
 MODULE_LICENSE("GPL and additional rights");

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel