309-rt2x00-Fix-compile-errors-for-SoC.patch 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136
  1. From e6cbd7e05f7c1fe0a737526d20f39b4a52e03ae8 Mon Sep 17 00:00:00 2001
  2. From: Ivo van Doorn <[email protected]>
  3. Date: Tue, 17 Mar 2009 14:01:29 +0100
  4. Subject: [PATCH] rt2x00: Fix compile errors for SoC
  5. Signed-off-by: Ivo van Doorn <[email protected]>
  6. ---
  7. drivers/net/wireless/rt2x00/rt2800pci.c | 37 +++++++++++++++----------------
  8. 1 files changed, 18 insertions(+), 19 deletions(-)
  9. --- a/drivers/net/wireless/rt2x00/rt2800pci.c
  10. +++ b/drivers/net/wireless/rt2x00/rt2800pci.c
  11. @@ -3186,7 +3186,7 @@ MODULE_LICENSE("GPL");
  12. #define WSOC_RT_CHIPSET RT3052
  13. #endif /* CONFIG_RALINK_RT305X */
  14. -static void rt2800soc_free_reg(struct rt2x00_dev *rt2x00dev)
  15. +static void rt2x00soc_free_reg(struct rt2x00_dev *rt2x00dev)
  16. {
  17. kfree(rt2x00dev->rf);
  18. rt2x00dev->rf = NULL;
  19. @@ -3195,7 +3195,7 @@ static void rt2800soc_free_reg(struct rt
  20. rt2x00dev->eeprom = NULL;
  21. }
  22. -static int rt2800soc_alloc_reg(struct rt2x00_dev *rt2x00dev)
  23. +static int rt2x00soc_alloc_reg(struct rt2x00_dev *rt2x00dev)
  24. {
  25. struct platform_device *pdev = to_platform_device(rt2x00dev->dev);
  26. struct resource *res;
  27. @@ -3219,14 +3219,14 @@ static int rt2800soc_alloc_reg(struct rt
  28. exit:
  29. ERROR_PROBE("Failed to allocate registers.\n");
  30. - rt2800soc_free_reg(rt2x00dev);
  31. + rt2x00soc_free_reg(rt2x00dev);
  32. return -ENOMEM;
  33. }
  34. -static int rt2800soc_probe(struct platform_device *pdev)
  35. +static int rt2x00soc_probe(struct platform_device *pdev)
  36. {
  37. - struct rt2x00_ops *ops = (struct rt2x00_ops *)pdev->driver->p;
  38. + const struct rt2x00_ops *ops = &rt2800pci_ops;
  39. struct ieee80211_hw *hw;
  40. struct rt2x00_dev *rt2x00dev;
  41. int retval;
  42. @@ -3248,7 +3248,7 @@ static int rt2800soc_probe(struct platfo
  43. rt2x00_set_chip_rt(rt2x00dev, WSOC_RT_CHIPSET);
  44. - retval = rt2800soc_alloc_reg(rt2x00dev);
  45. + retval = rt2x00soc_alloc_reg(rt2x00dev);
  46. if (retval)
  47. goto exit_free_device;
  48. @@ -3259,7 +3259,7 @@ static int rt2800soc_probe(struct platfo
  49. return 0;
  50. exit_free_reg:
  51. - rt2800soc_free_reg(rt2x00dev);
  52. + rt2x00soc_free_reg(rt2x00dev);
  53. exit_free_device:
  54. ieee80211_free_hw(hw);
  55. @@ -3267,7 +3267,7 @@ exit_free_device:
  56. return retval;
  57. }
  58. -static int rt2800soc_remove(struct platform_device *pdev)
  59. +static int rt2x00soc_remove(struct platform_device *pdev)
  60. {
  61. struct ieee80211_hw *hw = platform_get_drvdata(pdev);
  62. struct rt2x00_dev *rt2x00dev = hw->priv;
  63. @@ -3276,16 +3276,16 @@ static int rt2800soc_remove(struct platf
  64. * Free all allocated data.
  65. */
  66. rt2x00lib_remove_dev(rt2x00dev);
  67. - rt2800soc_free_reg(rt2x00dev);
  68. + rt2x00soc_free_reg(rt2x00dev);
  69. ieee80211_free_hw(hw);
  70. return 0;
  71. }
  72. #ifdef CONFIG_PM
  73. -int rt2x00soc_suspend(struct device *dev, pm_message_t state)
  74. +int rt2x00soc_suspend(struct platform_device *pdev, pm_message_t state)
  75. {
  76. - struct ieee80211_hw *hw = dev_get_drvdata(dev);
  77. + struct ieee80211_hw *hw = platform_get_drvdata(pdev);
  78. struct rt2x00_dev *rt2x00dev = hw->priv;
  79. int retval;
  80. @@ -3293,14 +3293,14 @@ int rt2x00soc_suspend(struct device *dev
  81. if (retval)
  82. return retval;
  83. - rt2800soc_free_reg(rt2x00dev);
  84. + rt2x00soc_free_reg(rt2x00dev);
  85. return 0;
  86. }
  87. -int rt2x00soc_resume(struct device *dev)
  88. +int rt2x00soc_resume(struct platform_device *pdev)
  89. {
  90. - struct ieee80211_hw *hw = dev_get_drvdata(dev);
  91. + struct ieee80211_hw *hw = platform_get_drvdata(pdev);
  92. struct rt2x00_dev *rt2x00dev = hw->priv;
  93. int retval;
  94. @@ -3315,7 +3315,7 @@ int rt2x00soc_resume(struct device *dev)
  95. return 0;
  96. exit_free_reg:
  97. - rt2x00pci_free_reg(rt2x00dev);
  98. + rt2x00soc_free_reg(rt2x00dev);
  99. return retval;
  100. }
  101. @@ -3326,10 +3326,9 @@ static struct platform_driver rt2800soc_
  102. .name = "rt2800_wmac",
  103. .owner = THIS_MODULE,
  104. .mod_name = KBUILD_MODNAME,
  105. - .p = &rt2800pci_ops;
  106. - }
  107. - .probe = rt2800soc_probe,
  108. - .remove = __devexit_p(rt2800soc_remove),
  109. + },
  110. + .probe = rt2x00soc_probe,
  111. + .remove = __devexit_p(rt2x00soc_remove),
  112. .suspend = rt2x00soc_suspend,
  113. .resume = rt2x00soc_resume,
  114. };