Browse Source

ath5k: fix incorrect use of drvdata in sysfs code

Signed-off-by: Pavel Roskin <proski@gnu.org>
Cc: <stable@kernel.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Pavel Roskin 14 years ago
parent
commit
95acbd432b
1 changed files with 6 additions and 3 deletions
  1. 6 3
      drivers/net/wireless/ath/ath5k/sysfs.c

+ 6 - 3
drivers/net/wireless/ath/ath5k/sysfs.c

@@ -10,7 +10,8 @@ static ssize_t ath5k_attr_show_##name(struct device *dev,		\
 			struct device_attribute *attr,			\
 			struct device_attribute *attr,			\
 			char *buf)					\
 			char *buf)					\
 {									\
 {									\
-	struct ath5k_softc *sc = dev_get_drvdata(dev);			\
+	struct ieee80211_hw *hw = dev_get_drvdata(dev);			\
+	struct ath5k_softc *sc = hw->priv;				\
 	return snprintf(buf, PAGE_SIZE, "%d\n", get); 			\
 	return snprintf(buf, PAGE_SIZE, "%d\n", get); 			\
 }									\
 }									\
 									\
 									\
@@ -18,7 +19,8 @@ static ssize_t ath5k_attr_store_##name(struct device *dev,		\
 			struct device_attribute *attr,			\
 			struct device_attribute *attr,			\
 			const char *buf, size_t count)			\
 			const char *buf, size_t count)			\
 {									\
 {									\
-	struct ath5k_softc *sc = dev_get_drvdata(dev);			\
+	struct ieee80211_hw *hw = dev_get_drvdata(dev);			\
+	struct ath5k_softc *sc = hw->priv;				\
 	int val;							\
 	int val;							\
 									\
 									\
 	val = (int)simple_strtoul(buf, NULL, 10);			\
 	val = (int)simple_strtoul(buf, NULL, 10);			\
@@ -33,7 +35,8 @@ static ssize_t ath5k_attr_show_##name(struct device *dev,		\
 			struct device_attribute *attr,			\
 			struct device_attribute *attr,			\
 			char *buf)					\
 			char *buf)					\
 {									\
 {									\
-	struct ath5k_softc *sc = dev_get_drvdata(dev);			\
+	struct ieee80211_hw *hw = dev_get_drvdata(dev);			\
+	struct ath5k_softc *sc = hw->priv;				\
 	return snprintf(buf, PAGE_SIZE, "%d\n", get); 			\
 	return snprintf(buf, PAGE_SIZE, "%d\n", get); 			\
 }									\
 }									\
 static DEVICE_ATTR(name, S_IRUGO, ath5k_attr_show_##name, NULL)
 static DEVICE_ATTR(name, S_IRUGO, ath5k_attr_show_##name, NULL)