@@ -587,9 +587,16 @@ static struct platform_driver exynos_drm_platform_driver = {
},
};
+static const char * const strings[] = {
+ "samsung,exynos3",
+ "samsung,exynos4",
+ "samsung,exynos5",
+};
+
static int exynos_drm_init(void)
{
- int ret;
+ bool is_exynos = false;
+ int ret, i;
/*
* Register device object only in case of Exynos SoC.
@@ -598,9 +605,14 @@ static int exynos_drm_init(void)
* by Exynos drm driver when using multi-platform kernel.
* So these codes will be replaced with more generic way later.
*/
- if (!of_machine_is_compatible("samsung,exynos3") &&
- !of_machine_is_compatible("samsung,exynos4") &&
- !of_machine_is_compatible("samsung,exynos5"))
+ for (i = 0; i < ARRAY_SIZE(strings); i++) {
+ if (of_machine_is_compatible(strings[i])) {
+ is_exynos = true;
+ break;
+ }
+ }
+
+ if (!is_exynos)
return -ENODEV;
exynos_drm_pdev = platform_device_register_simple("exynos-drm", -1,
Use 'for' statemant instead of hard-coded 'if' statement. Changelog v3: - none Changelog v2: - none Signed-off-by: Inki Dae <inki.dae@samsung.com> --- drivers/gpu/drm/exynos/exynos_drm_drv.c | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-)