openwrt/package/kernel/mac80211/patches/615-rt2x00-fix_20mhz_clk.patch
Felix Fietkau 1e5b7c17b0 mac80211: update to wireless-testing 2015-03-09
Based on patch by Bryan Forbes <bryan@reigndropsfall.net>

Also update mt76 to update for API changes

Signed-off-by: Felix Fietkau <nbd@openwrt.org>

SVN-Revision: 44655
2015-03-11 15:02:47 +00:00

30 lines
756 B
Diff

--- a/drivers/net/wireless/rt2x00/rt2800lib.c
+++ b/drivers/net/wireless/rt2x00/rt2800lib.c
@@ -36,6 +36,7 @@
#include <linux/kernel.h>
#include <linux/module.h>
#include <linux/slab.h>
+#include <linux/clk.h>
#include "rt2x00.h"
#include "rt2800lib.h"
@@ -8507,13 +8508,14 @@ static int rt2800_probe_rt(struct rt2x00
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;
}