Commit 65da0350 authored by Sachin Kamat's avatar Sachin Kamat Committed by Inki Dae

drm/exynos: hdmi: Add CONFIG_OF and use of_match_ptr() macro

Add CONFIG_OF to compile conditionally. of_match_ptr eliminates having
an #ifdef returning NULL for the case when OF is disabled.
Signed-off-by: default avatarSachin Kamat <sachin.kamat@linaro.org>
Signed-off-by: default avatarInki Dae <inki.dae@samsung.com>
parent a5562257
...@@ -48,6 +48,7 @@ static struct i2c_device_id ddc_idtable[] = { ...@@ -48,6 +48,7 @@ static struct i2c_device_id ddc_idtable[] = {
{ }, { },
}; };
#ifdef CONFIG_OF
static struct of_device_id hdmiddc_match_types[] = { static struct of_device_id hdmiddc_match_types[] = {
{ {
.compatible = "samsung,exynos5-hdmiddc", .compatible = "samsung,exynos5-hdmiddc",
...@@ -55,12 +56,13 @@ static struct of_device_id hdmiddc_match_types[] = { ...@@ -55,12 +56,13 @@ static struct of_device_id hdmiddc_match_types[] = {
/* end node */ /* end node */
} }
}; };
#endif
struct i2c_driver ddc_driver = { struct i2c_driver ddc_driver = {
.driver = { .driver = {
.name = "exynos-hdmiddc", .name = "exynos-hdmiddc",
.owner = THIS_MODULE, .owner = THIS_MODULE,
.of_match_table = hdmiddc_match_types, .of_match_table = of_match_ptr(hdmiddc_match_types),
}, },
.id_table = ddc_idtable, .id_table = ddc_idtable,
.probe = s5p_ddc_probe, .probe = s5p_ddc_probe,
......
...@@ -2440,6 +2440,7 @@ static struct platform_device_id hdmi_driver_types[] = { ...@@ -2440,6 +2440,7 @@ static struct platform_device_id hdmi_driver_types[] = {
} }
}; };
#ifdef CONFIG_OF
static struct of_device_id hdmi_match_types[] = { static struct of_device_id hdmi_match_types[] = {
{ {
.compatible = "samsung,exynos5-hdmi", .compatible = "samsung,exynos5-hdmi",
...@@ -2448,6 +2449,7 @@ static struct of_device_id hdmi_match_types[] = { ...@@ -2448,6 +2449,7 @@ static struct of_device_id hdmi_match_types[] = {
/* end node */ /* end node */
} }
}; };
#endif
static int __devinit hdmi_probe(struct platform_device *pdev) static int __devinit hdmi_probe(struct platform_device *pdev)
{ {
...@@ -2710,6 +2712,6 @@ struct platform_driver hdmi_driver = { ...@@ -2710,6 +2712,6 @@ struct platform_driver hdmi_driver = {
.name = "exynos-hdmi", .name = "exynos-hdmi",
.owner = THIS_MODULE, .owner = THIS_MODULE,
.pm = &hdmi_pm_ops, .pm = &hdmi_pm_ops,
.of_match_table = hdmi_match_types, .of_match_table = of_match_ptr(hdmi_match_types),
}, },
}; };
...@@ -46,6 +46,7 @@ static const struct i2c_device_id hdmiphy_id[] = { ...@@ -46,6 +46,7 @@ static const struct i2c_device_id hdmiphy_id[] = {
{ }, { },
}; };
#ifdef CONFIG_OF
static struct of_device_id hdmiphy_match_types[] = { static struct of_device_id hdmiphy_match_types[] = {
{ {
.compatible = "samsung,exynos5-hdmiphy", .compatible = "samsung,exynos5-hdmiphy",
...@@ -53,12 +54,13 @@ static struct of_device_id hdmiphy_match_types[] = { ...@@ -53,12 +54,13 @@ static struct of_device_id hdmiphy_match_types[] = {
/* end node */ /* end node */
} }
}; };
#endif
struct i2c_driver hdmiphy_driver = { struct i2c_driver hdmiphy_driver = {
.driver = { .driver = {
.name = "exynos-hdmiphy", .name = "exynos-hdmiphy",
.owner = THIS_MODULE, .owner = THIS_MODULE,
.of_match_table = hdmiphy_match_types, .of_match_table = of_match_ptr(hdmiphy_match_types),
}, },
.id_table = hdmiphy_id, .id_table = hdmiphy_id,
.probe = hdmiphy_probe, .probe = hdmiphy_probe,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment