AA: mac80211: backport package from trunk r39886
[openwrt/svn-archive/archive.git] / package / mac80211 / patches / 615-rt2x00-fix_20mhz_clk.patch
1 --- a/drivers/net/wireless/rt2x00/rt2800lib.c
2 +++ b/drivers/net/wireless/rt2x00/rt2800lib.c
3 @@ -36,6 +36,7 @@
4 #include <linux/kernel.h>
5 #include <linux/module.h>
6 #include <linux/slab.h>
7 +#include <linux/clk.h>
8
9 #include "rt2x00.h"
10 #include "rt2800lib.h"
11 @@ -7781,13 +7782,14 @@ static int rt2800_probe_rt(struct rt2x00
12
13 int rt2800_probe_clk(struct rt2x00_dev *rt2x00dev)
14 {
15 - struct rt2x00_platform_data *pdata = rt2x00dev->dev->platform_data;
16 struct hw_mode_spec *spec = &rt2x00dev->spec;
17 + struct clk *clk = clk_get(rt2x00dev->dev, NULL);
18
19 - if (!pdata)
20 - return -EINVAL;
21 + if (IS_ERR(clk))
22 + return PTR_ERR(clk);
23
24 - spec->clk_is_20mhz = pdata->clk_is_20mhz;
25 + if (clk_get_rate(clk) == 20000000)
26 + spec->clk_is_20mhz = 1;
27
28 return 0;
29 }