615-rt2x00-fix_20mhz_clk.patch 770 B

1234567891011121314151617181920212223242526272829
  1. --- a/drivers/net/wireless/ralink/rt2x00/rt2800lib.c
  2. +++ b/drivers/net/wireless/ralink/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. #include "rt2x00.h"
  9. #include "rt2800lib.h"
  10. @@ -8482,13 +8483,14 @@ static int rt2800_probe_rt(struct rt2x00
  11. int rt2800_probe_clk(struct rt2x00_dev *rt2x00dev)
  12. {
  13. - struct rt2x00_platform_data *pdata = rt2x00dev->dev->platform_data;
  14. struct hw_mode_spec *spec = &rt2x00dev->spec;
  15. + struct clk *clk = clk_get(rt2x00dev->dev, NULL);
  16. - if (!pdata)
  17. - return -EINVAL;
  18. + if (IS_ERR(clk))
  19. + return PTR_ERR(clk);
  20. - spec->clk_is_20mhz = pdata->clk_is_20mhz;
  21. + if (clk_get_rate(clk) == 20000000)
  22. + spec->clk_is_20mhz = 1;
  23. return 0;
  24. }