@@ -1858,7 +1858,6 @@ void hdmi_attach_hdmiphy_client(struct i2c_client *hdmiphy)
1858
1858
hdmi_hdmiphy = hdmiphy ;
1859
1859
}
1860
1860
1861
- #ifdef CONFIG_OF
1862
1861
static struct s5p_hdmi_platform_data * drm_hdmi_dt_parse_pdata
1863
1862
(struct device * dev )
1864
1863
{
@@ -1882,33 +1881,7 @@ static struct s5p_hdmi_platform_data *drm_hdmi_dt_parse_pdata
1882
1881
err_data :
1883
1882
return NULL ;
1884
1883
}
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
- };
1910
1884
1911
- #ifdef CONFIG_OF
1912
1885
static struct of_device_id hdmi_match_types [] = {
1913
1886
{
1914
1887
.compatible = "samsung,exynos5-hdmi" ,
@@ -1920,7 +1893,6 @@ static struct of_device_id hdmi_match_types[] = {
1920
1893
/* end node */
1921
1894
}
1922
1895
};
1923
- #endif
1924
1896
1925
1897
static int hdmi_probe (struct platform_device * pdev )
1926
1898
{
@@ -1929,30 +1901,21 @@ static int hdmi_probe(struct platform_device *pdev)
1929
1901
struct hdmi_context * hdata ;
1930
1902
struct s5p_hdmi_platform_data * pdata ;
1931
1903
struct resource * res ;
1904
+ const struct of_device_id * match ;
1932
1905
int ret ;
1933
1906
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 ;
1943
1909
1944
- if (! pdata ) {
1945
- DRM_ERROR ( "no platform data specified\n" );
1910
+ pdata = drm_hdmi_dt_parse_pdata ( dev );
1911
+ if (! pdata )
1946
1912
return - EINVAL ;
1947
- }
1948
1913
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 );
1951
1915
if (!drm_hdmi_ctx )
1952
1916
return - ENOMEM ;
1953
1917
1954
- hdata = devm_kzalloc (dev , sizeof (struct hdmi_context ),
1955
- GFP_KERNEL );
1918
+ hdata = devm_kzalloc (dev , sizeof (struct hdmi_context ), GFP_KERNEL );
1956
1919
if (!hdata )
1957
1920
return - ENOMEM ;
1958
1921
@@ -1963,23 +1926,15 @@ static int hdmi_probe(struct platform_device *pdev)
1963
1926
1964
1927
platform_set_drvdata (pdev , drm_hdmi_ctx );
1965
1928
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 ;
1977
1933
1978
1934
hdata -> hpd_gpio = pdata -> hpd_gpio ;
1979
1935
hdata -> dev = dev ;
1980
1936
1981
1937
ret = hdmi_resources_init (hdata );
1982
-
1983
1938
if (ret ) {
1984
1939
DRM_ERROR ("hdmi_resources_init failed\n" );
1985
1940
return - EINVAL ;
@@ -2134,11 +2089,10 @@ static const struct dev_pm_ops hdmi_pm_ops = {
2134
2089
struct platform_driver hdmi_driver = {
2135
2090
.probe = hdmi_probe ,
2136
2091
.remove = hdmi_remove ,
2137
- .id_table = hdmi_driver_types ,
2138
2092
.driver = {
2139
2093
.name = "exynos-hdmi" ,
2140
2094
.owner = THIS_MODULE ,
2141
2095
.pm = & hdmi_pm_ops ,
2142
- .of_match_table = of_match_ptr ( hdmi_match_types ) ,
2096
+ .of_match_table = hdmi_match_types ,
2143
2097
},
2144
2098
};
0 commit comments