Skip to content

Commit 88c4981

Browse files
Sachin Kamatdaeinki
authored andcommitted
drm/exynos: Remove non-DT support in exynos_hdmi
Since commit 383ffda ("ARM: EXYNOS: no more support non-DT for EXYNOS SoCs"), Exynos platform is DT only. Hence remove all the conditional macros and make the driver DT only. Signed-off-by: Sachin Kamat <[email protected]> Signed-off-by: Inki Dae <[email protected]>
1 parent 61c48fb commit 88c4981

File tree

1 file changed

+12
-58
lines changed

1 file changed

+12
-58
lines changed

drivers/gpu/drm/exynos/exynos_hdmi.c

Lines changed: 12 additions & 58 deletions
Original file line numberDiff line numberDiff line change
@@ -1858,7 +1858,6 @@ void hdmi_attach_hdmiphy_client(struct i2c_client *hdmiphy)
18581858
hdmi_hdmiphy = hdmiphy;
18591859
}
18601860

1861-
#ifdef CONFIG_OF
18621861
static struct s5p_hdmi_platform_data *drm_hdmi_dt_parse_pdata
18631862
(struct device *dev)
18641863
{
@@ -1882,33 +1881,7 @@ static struct s5p_hdmi_platform_data *drm_hdmi_dt_parse_pdata
18821881
err_data:
18831882
return NULL;
18841883
}
1885-
#else
1886-
static struct s5p_hdmi_platform_data *drm_hdmi_dt_parse_pdata
1887-
(struct device *dev)
1888-
{
1889-
return NULL;
1890-
}
1891-
#endif
1892-
1893-
static struct platform_device_id hdmi_driver_types[] = {
1894-
{
1895-
.name = "s5pv210-hdmi",
1896-
.driver_data = HDMI_TYPE13,
1897-
}, {
1898-
.name = "exynos4-hdmi",
1899-
.driver_data = HDMI_TYPE13,
1900-
}, {
1901-
.name = "exynos4-hdmi14",
1902-
.driver_data = HDMI_TYPE14,
1903-
}, {
1904-
.name = "exynos5-hdmi",
1905-
.driver_data = HDMI_TYPE14,
1906-
}, {
1907-
/* end node */
1908-
}
1909-
};
19101884

1911-
#ifdef CONFIG_OF
19121885
static struct of_device_id hdmi_match_types[] = {
19131886
{
19141887
.compatible = "samsung,exynos5-hdmi",
@@ -1920,7 +1893,6 @@ static struct of_device_id hdmi_match_types[] = {
19201893
/* end node */
19211894
}
19221895
};
1923-
#endif
19241896

19251897
static int hdmi_probe(struct platform_device *pdev)
19261898
{
@@ -1929,30 +1901,21 @@ static int hdmi_probe(struct platform_device *pdev)
19291901
struct hdmi_context *hdata;
19301902
struct s5p_hdmi_platform_data *pdata;
19311903
struct resource *res;
1904+
const struct of_device_id *match;
19321905
int ret;
19331906

1934-
if (dev->of_node) {
1935-
pdata = drm_hdmi_dt_parse_pdata(dev);
1936-
if (IS_ERR(pdata)) {
1937-
DRM_ERROR("failed to parse dt\n");
1938-
return PTR_ERR(pdata);
1939-
}
1940-
} else {
1941-
pdata = dev->platform_data;
1942-
}
1907+
if (!dev->of_node)
1908+
return -ENODEV;
19431909

1944-
if (!pdata) {
1945-
DRM_ERROR("no platform data specified\n");
1910+
pdata = drm_hdmi_dt_parse_pdata(dev);
1911+
if (!pdata)
19461912
return -EINVAL;
1947-
}
19481913

1949-
drm_hdmi_ctx = devm_kzalloc(dev, sizeof(*drm_hdmi_ctx),
1950-
GFP_KERNEL);
1914+
drm_hdmi_ctx = devm_kzalloc(dev, sizeof(*drm_hdmi_ctx), GFP_KERNEL);
19511915
if (!drm_hdmi_ctx)
19521916
return -ENOMEM;
19531917

1954-
hdata = devm_kzalloc(dev, sizeof(struct hdmi_context),
1955-
GFP_KERNEL);
1918+
hdata = devm_kzalloc(dev, sizeof(struct hdmi_context), GFP_KERNEL);
19561919
if (!hdata)
19571920
return -ENOMEM;
19581921

@@ -1963,23 +1926,15 @@ static int hdmi_probe(struct platform_device *pdev)
19631926

19641927
platform_set_drvdata(pdev, drm_hdmi_ctx);
19651928

1966-
if (dev->of_node) {
1967-
const struct of_device_id *match;
1968-
match = of_match_node(of_match_ptr(hdmi_match_types),
1969-
dev->of_node);
1970-
if (match == NULL)
1971-
return -ENODEV;
1972-
hdata->type = (enum hdmi_type)match->data;
1973-
} else {
1974-
hdata->type = (enum hdmi_type)platform_get_device_id
1975-
(pdev)->driver_data;
1976-
}
1929+
match = of_match_node(hdmi_match_types, dev->of_node);
1930+
if (!match)
1931+
return -ENODEV;
1932+
hdata->type = (enum hdmi_type)match->data;
19771933

19781934
hdata->hpd_gpio = pdata->hpd_gpio;
19791935
hdata->dev = dev;
19801936

19811937
ret = hdmi_resources_init(hdata);
1982-
19831938
if (ret) {
19841939
DRM_ERROR("hdmi_resources_init failed\n");
19851940
return -EINVAL;
@@ -2134,11 +2089,10 @@ static const struct dev_pm_ops hdmi_pm_ops = {
21342089
struct platform_driver hdmi_driver = {
21352090
.probe = hdmi_probe,
21362091
.remove = hdmi_remove,
2137-
.id_table = hdmi_driver_types,
21382092
.driver = {
21392093
.name = "exynos-hdmi",
21402094
.owner = THIS_MODULE,
21412095
.pm = &hdmi_pm_ops,
2142-
.of_match_table = of_match_ptr(hdmi_match_types),
2096+
.of_match_table = hdmi_match_types,
21432097
},
21442098
};

0 commit comments

Comments
 (0)