2015-12-04 22:39:37 +00:00
|
|
|
--- a/drivers/net/wireless/ralink/rt2x00/rt2800lib.c
|
|
|
|
+++ b/drivers/net/wireless/ralink/rt2x00/rt2800lib.c
|
2014-01-30 13:21:36 +00:00
|
|
|
@@ -36,6 +36,7 @@
|
2013-04-03 10:00:29 +00:00
|
|
|
#include <linux/kernel.h>
|
|
|
|
#include <linux/module.h>
|
|
|
|
#include <linux/slab.h>
|
|
|
|
+#include <linux/clk.h>
|
|
|
|
|
|
|
|
#include "rt2x00.h"
|
|
|
|
#include "rt2800lib.h"
|
2015-07-06 16:26:34 +00:00
|
|
|
@@ -8481,13 +8482,14 @@ static int rt2800_probe_rt(struct rt2x00
|
2013-04-03 10:00:29 +00:00
|
|
|
|
|
|
|
int rt2800_probe_clk(struct rt2x00_dev *rt2x00dev)
|
|
|
|
{
|
|
|
|
- struct rt2x00_platform_data *pdata = rt2x00dev->dev->platform_data;
|
|
|
|
struct hw_mode_spec *spec = &rt2x00dev->spec;
|
|
|
|
+ struct clk *clk = clk_get(rt2x00dev->dev, NULL);
|
|
|
|
|
|
|
|
- if (!pdata)
|
|
|
|
- return -EINVAL;
|
|
|
|
+ if (IS_ERR(clk))
|
|
|
|
+ return PTR_ERR(clk);
|
|
|
|
|
|
|
|
- spec->clk_is_20mhz = pdata->clk_is_20mhz;
|
|
|
|
+ if (clk_get_rate(clk) == 20000000)
|
|
|
|
+ spec->clk_is_20mhz = 1;
|
|
|
|
|
|
|
|
return 0;
|
|
|
|
}
|