[PATCH] drm/exynos: Use platform_register/unregister_drivers()

Thierry Reding thierry.reding at gmail.com
Wed Dec 2 08:22:36 PST 2015


From: Thierry Reding <treding at nvidia.com>

Replace the driver-specific implementations with the ones implemented in
the core.

Signed-off-by: Thierry Reding <treding at nvidia.com>
---
 drivers/gpu/drm/exynos/exynos_drm_drv.c | 42 +++++++--------------------------
 1 file changed, 8 insertions(+), 34 deletions(-)

diff --git a/drivers/gpu/drm/exynos/exynos_drm_drv.c b/drivers/gpu/drm/exynos/exynos_drm_drv.c
index 2c6019d6a205..3152bca62127 100644
--- a/drivers/gpu/drm/exynos/exynos_drm_drv.c
+++ b/drivers/gpu/drm/exynos/exynos_drm_drv.c
@@ -678,54 +678,28 @@ static int exynos_drm_register_devices(void)
 	return 0;
 }
 
-static void exynos_drm_unregister_drivers(struct platform_driver * const *drv,
-					  int count)
-{
-	while (--count >= 0)
-		platform_driver_unregister(drv[count]);
-}
-
-static int exynos_drm_register_drivers(struct platform_driver * const *drv,
-				       int count)
-{
-	int i, ret;
-
-	for (i = 0; i < count; ++i) {
-		ret = platform_driver_register(drv[i]);
-		if (!ret)
-			continue;
-
-		while (--i >= 0)
-			platform_driver_unregister(drv[i]);
-
-		return ret;
-	}
-
-	return 0;
-}
-
 static inline int exynos_drm_register_kms_drivers(void)
 {
-	return exynos_drm_register_drivers(exynos_drm_kms_drivers,
-					ARRAY_SIZE(exynos_drm_kms_drivers));
+	return platform_register_drivers(exynos_drm_kms_drivers,
+					 ARRAY_SIZE(exynos_drm_kms_drivers));
 }
 
 static inline int exynos_drm_register_non_kms_drivers(void)
 {
-	return exynos_drm_register_drivers(exynos_drm_non_kms_drivers,
-					ARRAY_SIZE(exynos_drm_non_kms_drivers));
+	return platform_register_drivers(exynos_drm_non_kms_drivers,
+					 ARRAY_SIZE(exynos_drm_non_kms_drivers));
 }
 
 static inline void exynos_drm_unregister_kms_drivers(void)
 {
-	exynos_drm_unregister_drivers(exynos_drm_kms_drivers,
-					ARRAY_SIZE(exynos_drm_kms_drivers));
+	platform_unregister_drivers(exynos_drm_kms_drivers,
+				    ARRAY_SIZE(exynos_drm_kms_drivers));
 }
 
 static inline void exynos_drm_unregister_non_kms_drivers(void)
 {
-	exynos_drm_unregister_drivers(exynos_drm_non_kms_drivers,
-					ARRAY_SIZE(exynos_drm_non_kms_drivers));
+	platform_unregister_drivers(exynos_drm_non_kms_drivers,
+				    ARRAY_SIZE(exynos_drm_non_kms_drivers));
 }
 
 static int exynos_drm_init(void)
-- 
2.5.0



More information about the dri-devel mailing list