Skip to content

Commit

Permalink
drm/exynos: hdmi: Add CONFIG_OF and use of_match_ptr() macro
Browse files Browse the repository at this point in the history
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: Sachin Kamat <sachin.kamat@linaro.org>
Signed-off-by: Inki Dae <inki.dae@samsung.com>
  • Loading branch information
Sachin Kamat authored and Inki Dae committed Dec 14, 2012
1 parent a556225 commit 65da035
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 3 deletions.
4 changes: 3 additions & 1 deletion drivers/gpu/drm/exynos/exynos_ddc.c
Original file line number Diff line number Diff line change
Expand Up @@ -48,19 +48,21 @@ static struct i2c_device_id ddc_idtable[] = {
{ },
};

#ifdef CONFIG_OF
static struct of_device_id hdmiddc_match_types[] = {
{
.compatible = "samsung,exynos5-hdmiddc",
}, {
/* end node */
}
};
#endif

struct i2c_driver ddc_driver = {
.driver = {
.name = "exynos-hdmiddc",
.owner = THIS_MODULE,
.of_match_table = hdmiddc_match_types,
.of_match_table = of_match_ptr(hdmiddc_match_types),
},
.id_table = ddc_idtable,
.probe = s5p_ddc_probe,
Expand Down
4 changes: 3 additions & 1 deletion drivers/gpu/drm/exynos/exynos_hdmi.c
Original file line number Diff line number Diff line change
Expand Up @@ -2440,6 +2440,7 @@ static struct platform_device_id hdmi_driver_types[] = {
}
};

#ifdef CONFIG_OF
static struct of_device_id hdmi_match_types[] = {
{
.compatible = "samsung,exynos5-hdmi",
Expand All @@ -2448,6 +2449,7 @@ static struct of_device_id hdmi_match_types[] = {
/* end node */
}
};
#endif

static int __devinit hdmi_probe(struct platform_device *pdev)
{
Expand Down Expand Up @@ -2710,6 +2712,6 @@ struct platform_driver hdmi_driver = {
.name = "exynos-hdmi",
.owner = THIS_MODULE,
.pm = &hdmi_pm_ops,
.of_match_table = hdmi_match_types,
.of_match_table = of_match_ptr(hdmi_match_types),
},
};
4 changes: 3 additions & 1 deletion drivers/gpu/drm/exynos/exynos_hdmiphy.c
Original file line number Diff line number Diff line change
Expand Up @@ -46,19 +46,21 @@ static const struct i2c_device_id hdmiphy_id[] = {
{ },
};

#ifdef CONFIG_OF
static struct of_device_id hdmiphy_match_types[] = {
{
.compatible = "samsung,exynos5-hdmiphy",
}, {
/* end node */
}
};
#endif

struct i2c_driver hdmiphy_driver = {
.driver = {
.name = "exynos-hdmiphy",
.owner = THIS_MODULE,
.of_match_table = hdmiphy_match_types,
.of_match_table = of_match_ptr(hdmiphy_match_types),
},
.id_table = hdmiphy_id,
.probe = hdmiphy_probe,
Expand Down

0 comments on commit 65da035

Please sign in to comment.