1818#include <linux/io.h>
1919#include <linux/module.h>
2020#include <linux/of.h>
21+ #include <linux/of_device.h>
2122#include <linux/of_gpio.h>
2223#include <linux/pm_runtime.h>
2324
@@ -1106,21 +1107,6 @@ static struct i2s_dai *i2s_alloc_dai(struct platform_device *pdev, bool sec)
11061107 return i2s ;
11071108}
11081109
1109- static const struct of_device_id exynos_i2s_match [];
1110-
1111- static inline const struct samsung_i2s_dai_data * samsung_i2s_get_driver_data (
1112- struct platform_device * pdev )
1113- {
1114- if (IS_ENABLED (CONFIG_OF ) && pdev -> dev .of_node ) {
1115- const struct of_device_id * match ;
1116- match = of_match_node (exynos_i2s_match , pdev -> dev .of_node );
1117- return match ? match -> data : NULL ;
1118- } else {
1119- return (struct samsung_i2s_dai_data * )
1120- platform_get_device_id (pdev )-> driver_data ;
1121- }
1122- }
1123-
11241110#ifdef CONFIG_PM
11251111static int i2s_runtime_suspend (struct device * dev )
11261112{
@@ -1233,9 +1219,13 @@ static int samsung_i2s_probe(struct platform_device *pdev)
12331219 const struct samsung_i2s_dai_data * i2s_dai_data ;
12341220 int ret ;
12351221
1236- /* Call during Seconday interface registration */
1237- i2s_dai_data = samsung_i2s_get_driver_data (pdev );
1222+ if (IS_ENABLED (CONFIG_OF ) && pdev -> dev .of_node )
1223+ i2s_dai_data = of_device_get_match_data (& pdev -> dev );
1224+ else
1225+ i2s_dai_data = (struct samsung_i2s_dai_data * )
1226+ platform_get_device_id (pdev )-> driver_data ;
12381227
1228+ /* Call during the secondary interface registration */
12391229 if (i2s_dai_data -> dai_type == TYPE_SEC ) {
12401230 sec_dai = dev_get_drvdata (& pdev -> dev );
12411231 if (!sec_dai ) {
@@ -1477,10 +1467,6 @@ static const struct samsung_i2s_dai_data i2sv5_dai_type_i2s1 = {
14771467 .i2s_variant_regs = & i2sv5_i2s1_regs ,
14781468};
14791469
1480- static const struct samsung_i2s_dai_data samsung_dai_type_pri = {
1481- .dai_type = TYPE_PRI ,
1482- };
1483-
14841470static const struct samsung_i2s_dai_data samsung_dai_type_sec = {
14851471 .dai_type = TYPE_SEC ,
14861472};
@@ -1492,9 +1478,6 @@ static const struct platform_device_id samsung_i2s_driver_ids[] = {
14921478 }, {
14931479 .name = "samsung-i2s-sec" ,
14941480 .driver_data = (kernel_ulong_t )& samsung_dai_type_sec ,
1495- }, {
1496- .name = "samsung-i2sv4" ,
1497- .driver_data = (kernel_ulong_t )& i2sv5_dai_type ,
14981481 },
14991482 {},
15001483};
0 commit comments