drm/exynos: clean up machine compatible string check
Use 'for' statemant instead of hard-coded 'if' statement. Signed-off-by: Inki Dae <inki.dae@samsung.com>
This commit is contained in:
@@ -610,6 +610,12 @@ static int exynos_drm_platform_remove(struct platform_device *pdev)
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static const char * const strings[] = {
|
||||||
|
"samsung,exynos3",
|
||||||
|
"samsung,exynos4",
|
||||||
|
"samsung,exynos5",
|
||||||
|
};
|
||||||
|
|
||||||
static struct platform_driver exynos_drm_platform_driver = {
|
static struct platform_driver exynos_drm_platform_driver = {
|
||||||
.probe = exynos_drm_platform_probe,
|
.probe = exynos_drm_platform_probe,
|
||||||
.remove = exynos_drm_platform_remove,
|
.remove = exynos_drm_platform_remove,
|
||||||
@@ -622,6 +628,7 @@ static struct platform_driver exynos_drm_platform_driver = {
|
|||||||
|
|
||||||
static int exynos_drm_init(void)
|
static int exynos_drm_init(void)
|
||||||
{
|
{
|
||||||
|
bool is_exynos = false;
|
||||||
int ret, i, j;
|
int ret, i, j;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@@ -631,9 +638,14 @@ static int exynos_drm_init(void)
|
|||||||
* by Exynos drm driver when using multi-platform kernel.
|
* by Exynos drm driver when using multi-platform kernel.
|
||||||
* So these codes will be replaced with more generic way later.
|
* So these codes will be replaced with more generic way later.
|
||||||
*/
|
*/
|
||||||
if (!of_machine_is_compatible("samsung,exynos3") &&
|
for (i = 0; i < ARRAY_SIZE(strings); i++) {
|
||||||
!of_machine_is_compatible("samsung,exynos4") &&
|
if (of_machine_is_compatible(strings[i])) {
|
||||||
!of_machine_is_compatible("samsung,exynos5"))
|
is_exynos = true;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!is_exynos)
|
||||||
return -ENODEV;
|
return -ENODEV;
|
||||||
|
|
||||||
exynos_drm_pdev = platform_device_register_simple("exynos-drm", -1,
|
exynos_drm_pdev = platform_device_register_simple("exynos-drm", -1,
|
||||||
|
|||||||
Reference in New Issue
Block a user