diff options
author | Greg Kroah-Hartman <gregkh@suse.de> | 2009-05-01 02:02:47 -0400 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2009-05-06 15:15:01 -0400 |
commit | 928841b1538df117658ec5977bcf336c27f7747b (patch) | |
tree | ea2b5ac0353b5bbdab4c10402403a0da5a108bd4 /drivers/net/wireless/iwlwifi/iwl-agn.c | |
parent | 8bce6121706dd82c266c3f527e592abfb3e164d1 (diff) |
Wireless: remove driver_data direct access of struct device
In the near future, the driver core is going to not allow direct access
to the driver_data pointer in struct device. Instead, the functions
dev_get_drvdata() and dev_set_drvdata() should be used. These functions
have been around since the beginning, so are backwards compatible with
all older kernel versions.
Cc: John W. Linville <linville@tuxdriver.com>
Cc: linux-wireless@vger.kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless/iwlwifi/iwl-agn.c')
-rw-r--r-- | drivers/net/wireless/iwlwifi/iwl-agn.c | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/drivers/net/wireless/iwlwifi/iwl-agn.c b/drivers/net/wireless/iwlwifi/iwl-agn.c index dd8b15ed8296..6cdee0b4b486 100644 --- a/drivers/net/wireless/iwlwifi/iwl-agn.c +++ b/drivers/net/wireless/iwlwifi/iwl-agn.c | |||
@@ -2268,7 +2268,7 @@ static int iwl_mac_get_stats(struct ieee80211_hw *hw, | |||
2268 | static ssize_t show_debug_level(struct device *d, | 2268 | static ssize_t show_debug_level(struct device *d, |
2269 | struct device_attribute *attr, char *buf) | 2269 | struct device_attribute *attr, char *buf) |
2270 | { | 2270 | { |
2271 | struct iwl_priv *priv = d->driver_data; | 2271 | struct iwl_priv *priv = dev_get_drvdata(d); |
2272 | 2272 | ||
2273 | return sprintf(buf, "0x%08X\n", priv->debug_level); | 2273 | return sprintf(buf, "0x%08X\n", priv->debug_level); |
2274 | } | 2274 | } |
@@ -2276,7 +2276,7 @@ static ssize_t store_debug_level(struct device *d, | |||
2276 | struct device_attribute *attr, | 2276 | struct device_attribute *attr, |
2277 | const char *buf, size_t count) | 2277 | const char *buf, size_t count) |
2278 | { | 2278 | { |
2279 | struct iwl_priv *priv = d->driver_data; | 2279 | struct iwl_priv *priv = dev_get_drvdata(d); |
2280 | unsigned long val; | 2280 | unsigned long val; |
2281 | int ret; | 2281 | int ret; |
2282 | 2282 | ||
@@ -2299,7 +2299,7 @@ static DEVICE_ATTR(debug_level, S_IWUSR | S_IRUGO, | |||
2299 | static ssize_t show_version(struct device *d, | 2299 | static ssize_t show_version(struct device *d, |
2300 | struct device_attribute *attr, char *buf) | 2300 | struct device_attribute *attr, char *buf) |
2301 | { | 2301 | { |
2302 | struct iwl_priv *priv = d->driver_data; | 2302 | struct iwl_priv *priv = dev_get_drvdata(d); |
2303 | struct iwl_alive_resp *palive = &priv->card_alive; | 2303 | struct iwl_alive_resp *palive = &priv->card_alive; |
2304 | ssize_t pos = 0; | 2304 | ssize_t pos = 0; |
2305 | u16 eeprom_ver; | 2305 | u16 eeprom_ver; |
@@ -2330,7 +2330,7 @@ static DEVICE_ATTR(version, S_IWUSR | S_IRUGO, show_version, NULL); | |||
2330 | static ssize_t show_temperature(struct device *d, | 2330 | static ssize_t show_temperature(struct device *d, |
2331 | struct device_attribute *attr, char *buf) | 2331 | struct device_attribute *attr, char *buf) |
2332 | { | 2332 | { |
2333 | struct iwl_priv *priv = (struct iwl_priv *)d->driver_data; | 2333 | struct iwl_priv *priv = dev_get_drvdata(d); |
2334 | 2334 | ||
2335 | if (!iwl_is_alive(priv)) | 2335 | if (!iwl_is_alive(priv)) |
2336 | return -EAGAIN; | 2336 | return -EAGAIN; |
@@ -2343,7 +2343,7 @@ static DEVICE_ATTR(temperature, S_IRUGO, show_temperature, NULL); | |||
2343 | static ssize_t show_tx_power(struct device *d, | 2343 | static ssize_t show_tx_power(struct device *d, |
2344 | struct device_attribute *attr, char *buf) | 2344 | struct device_attribute *attr, char *buf) |
2345 | { | 2345 | { |
2346 | struct iwl_priv *priv = (struct iwl_priv *)d->driver_data; | 2346 | struct iwl_priv *priv = dev_get_drvdata(d); |
2347 | 2347 | ||
2348 | if (!iwl_is_ready_rf(priv)) | 2348 | if (!iwl_is_ready_rf(priv)) |
2349 | return sprintf(buf, "off\n"); | 2349 | return sprintf(buf, "off\n"); |
@@ -2355,7 +2355,7 @@ static ssize_t store_tx_power(struct device *d, | |||
2355 | struct device_attribute *attr, | 2355 | struct device_attribute *attr, |
2356 | const char *buf, size_t count) | 2356 | const char *buf, size_t count) |
2357 | { | 2357 | { |
2358 | struct iwl_priv *priv = (struct iwl_priv *)d->driver_data; | 2358 | struct iwl_priv *priv = dev_get_drvdata(d); |
2359 | unsigned long val; | 2359 | unsigned long val; |
2360 | int ret; | 2360 | int ret; |
2361 | 2361 | ||
@@ -2373,7 +2373,7 @@ static DEVICE_ATTR(tx_power, S_IWUSR | S_IRUGO, show_tx_power, store_tx_power); | |||
2373 | static ssize_t show_flags(struct device *d, | 2373 | static ssize_t show_flags(struct device *d, |
2374 | struct device_attribute *attr, char *buf) | 2374 | struct device_attribute *attr, char *buf) |
2375 | { | 2375 | { |
2376 | struct iwl_priv *priv = (struct iwl_priv *)d->driver_data; | 2376 | struct iwl_priv *priv = dev_get_drvdata(d); |
2377 | 2377 | ||
2378 | return sprintf(buf, "0x%04X\n", priv->active_rxon.flags); | 2378 | return sprintf(buf, "0x%04X\n", priv->active_rxon.flags); |
2379 | } | 2379 | } |
@@ -2382,7 +2382,7 @@ static ssize_t store_flags(struct device *d, | |||
2382 | struct device_attribute *attr, | 2382 | struct device_attribute *attr, |
2383 | const char *buf, size_t count) | 2383 | const char *buf, size_t count) |
2384 | { | 2384 | { |
2385 | struct iwl_priv *priv = (struct iwl_priv *)d->driver_data; | 2385 | struct iwl_priv *priv = dev_get_drvdata(d); |
2386 | unsigned long val; | 2386 | unsigned long val; |
2387 | u32 flags; | 2387 | u32 flags; |
2388 | int ret = strict_strtoul(buf, 0, &val); | 2388 | int ret = strict_strtoul(buf, 0, &val); |
@@ -2411,7 +2411,7 @@ static DEVICE_ATTR(flags, S_IWUSR | S_IRUGO, show_flags, store_flags); | |||
2411 | static ssize_t show_filter_flags(struct device *d, | 2411 | static ssize_t show_filter_flags(struct device *d, |
2412 | struct device_attribute *attr, char *buf) | 2412 | struct device_attribute *attr, char *buf) |
2413 | { | 2413 | { |
2414 | struct iwl_priv *priv = (struct iwl_priv *)d->driver_data; | 2414 | struct iwl_priv *priv = dev_get_drvdata(d); |
2415 | 2415 | ||
2416 | return sprintf(buf, "0x%04X\n", | 2416 | return sprintf(buf, "0x%04X\n", |
2417 | le32_to_cpu(priv->active_rxon.filter_flags)); | 2417 | le32_to_cpu(priv->active_rxon.filter_flags)); |
@@ -2421,7 +2421,7 @@ static ssize_t store_filter_flags(struct device *d, | |||
2421 | struct device_attribute *attr, | 2421 | struct device_attribute *attr, |
2422 | const char *buf, size_t count) | 2422 | const char *buf, size_t count) |
2423 | { | 2423 | { |
2424 | struct iwl_priv *priv = (struct iwl_priv *)d->driver_data; | 2424 | struct iwl_priv *priv = dev_get_drvdata(d); |
2425 | unsigned long val; | 2425 | unsigned long val; |
2426 | u32 filter_flags; | 2426 | u32 filter_flags; |
2427 | int ret = strict_strtoul(buf, 0, &val); | 2427 | int ret = strict_strtoul(buf, 0, &val); |