File tree Expand file tree Collapse file tree 1 file changed +12
-1
lines changed Expand file tree Collapse file tree 1 file changed +12
-1
lines changed Original file line number Diff line number Diff line change 5
5
6
6
#include <linux/clk.h>
7
7
#include <linux/module.h>
8
+ #include <linux/of.h>
8
9
#include <linux/platform_device.h>
9
10
#include <linux/watchdog.h>
10
11
@@ -112,7 +113,7 @@ static int ls1x_wdt_probe(struct platform_device *pdev)
112
113
if (IS_ERR (drvdata -> base ))
113
114
return PTR_ERR (drvdata -> base );
114
115
115
- drvdata -> clk = devm_clk_get_enabled (dev , pdev -> name );
116
+ drvdata -> clk = devm_clk_get_enabled (dev , NULL );
116
117
if (IS_ERR (drvdata -> clk ))
117
118
return PTR_ERR (drvdata -> clk );
118
119
@@ -144,10 +145,20 @@ static int ls1x_wdt_probe(struct platform_device *pdev)
144
145
return 0 ;
145
146
}
146
147
148
+ #ifdef CONFIG_OF
149
+ static const struct of_device_id ls1x_wdt_dt_ids [] = {
150
+ { .compatible = "loongson,ls1b-wdt" , },
151
+ { .compatible = "loongson,ls1c-wdt" , },
152
+ { /* sentinel */ }
153
+ };
154
+ MODULE_DEVICE_TABLE (of , ls1x_wdt_dt_ids );
155
+ #endif
156
+
147
157
static struct platform_driver ls1x_wdt_driver = {
148
158
.probe = ls1x_wdt_probe ,
149
159
.driver = {
150
160
.name = "ls1x-wdt" ,
161
+ .of_match_table = of_match_ptr (ls1x_wdt_dt_ids ),
151
162
},
152
163
};
153
164
You can’t perform that action at this time.
0 commit comments