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 | |
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')
-rw-r--r-- | drivers/net/wireless/iwlwifi/iwl-agn.c | 20 | ||||
-rw-r--r-- | drivers/net/wireless/iwlwifi/iwl3945-base.c | 26 |
2 files changed, 24 insertions, 22 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); |
diff --git a/drivers/net/wireless/iwlwifi/iwl3945-base.c b/drivers/net/wireless/iwlwifi/iwl3945-base.c index dc0359ce1ec0..9f5191a84a13 100644 --- a/drivers/net/wireless/iwlwifi/iwl3945-base.c +++ b/drivers/net/wireless/iwlwifi/iwl3945-base.c | |||
@@ -3595,7 +3595,7 @@ static int iwl3945_mac_set_key(struct ieee80211_hw *hw, enum set_key_cmd cmd, | |||
3595 | static ssize_t show_debug_level(struct device *d, | 3595 | static ssize_t show_debug_level(struct device *d, |
3596 | struct device_attribute *attr, char *buf) | 3596 | struct device_attribute *attr, char *buf) |
3597 | { | 3597 | { |
3598 | struct iwl_priv *priv = d->driver_data; | 3598 | struct iwl_priv *priv = dev_get_drvdata(d); |
3599 | 3599 | ||
3600 | return sprintf(buf, "0x%08X\n", priv->debug_level); | 3600 | return sprintf(buf, "0x%08X\n", priv->debug_level); |
3601 | } | 3601 | } |
@@ -3603,7 +3603,7 @@ static ssize_t store_debug_level(struct device *d, | |||
3603 | struct device_attribute *attr, | 3603 | struct device_attribute *attr, |
3604 | const char *buf, size_t count) | 3604 | const char *buf, size_t count) |
3605 | { | 3605 | { |
3606 | struct iwl_priv *priv = d->driver_data; | 3606 | struct iwl_priv *priv = dev_get_drvdata(d); |
3607 | unsigned long val; | 3607 | unsigned long val; |
3608 | int ret; | 3608 | int ret; |
3609 | 3609 | ||
@@ -3624,7 +3624,7 @@ static DEVICE_ATTR(debug_level, S_IWUSR | S_IRUGO, | |||
3624 | static ssize_t show_temperature(struct device *d, | 3624 | static ssize_t show_temperature(struct device *d, |
3625 | struct device_attribute *attr, char *buf) | 3625 | struct device_attribute *attr, char *buf) |
3626 | { | 3626 | { |
3627 | struct iwl_priv *priv = (struct iwl_priv *)d->driver_data; | 3627 | struct iwl_priv *priv = dev_get_drvdata(d); |
3628 | 3628 | ||
3629 | if (!iwl_is_alive(priv)) | 3629 | if (!iwl_is_alive(priv)) |
3630 | return -EAGAIN; | 3630 | return -EAGAIN; |
@@ -3637,7 +3637,7 @@ static DEVICE_ATTR(temperature, S_IRUGO, show_temperature, NULL); | |||
3637 | static ssize_t show_tx_power(struct device *d, | 3637 | static ssize_t show_tx_power(struct device *d, |
3638 | struct device_attribute *attr, char *buf) | 3638 | struct device_attribute *attr, char *buf) |
3639 | { | 3639 | { |
3640 | struct iwl_priv *priv = (struct iwl_priv *)d->driver_data; | 3640 | struct iwl_priv *priv = dev_get_drvdata(d); |
3641 | return sprintf(buf, "%d\n", priv->tx_power_user_lmt); | 3641 | return sprintf(buf, "%d\n", priv->tx_power_user_lmt); |
3642 | } | 3642 | } |
3643 | 3643 | ||
@@ -3645,7 +3645,7 @@ static ssize_t store_tx_power(struct device *d, | |||
3645 | struct device_attribute *attr, | 3645 | struct device_attribute *attr, |
3646 | const char *buf, size_t count) | 3646 | const char *buf, size_t count) |
3647 | { | 3647 | { |
3648 | struct iwl_priv *priv = (struct iwl_priv *)d->driver_data; | 3648 | struct iwl_priv *priv = dev_get_drvdata(d); |
3649 | char *p = (char *)buf; | 3649 | char *p = (char *)buf; |
3650 | u32 val; | 3650 | u32 val; |
3651 | 3651 | ||
@@ -3663,7 +3663,7 @@ static DEVICE_ATTR(tx_power, S_IWUSR | S_IRUGO, show_tx_power, store_tx_power); | |||
3663 | static ssize_t show_flags(struct device *d, | 3663 | static ssize_t show_flags(struct device *d, |
3664 | struct device_attribute *attr, char *buf) | 3664 | struct device_attribute *attr, char *buf) |
3665 | { | 3665 | { |
3666 | struct iwl_priv *priv = (struct iwl_priv *)d->driver_data; | 3666 | struct iwl_priv *priv = dev_get_drvdata(d); |
3667 | 3667 | ||
3668 | return sprintf(buf, "0x%04X\n", priv->active_rxon.flags); | 3668 | return sprintf(buf, "0x%04X\n", priv->active_rxon.flags); |
3669 | } | 3669 | } |
@@ -3672,7 +3672,7 @@ static ssize_t store_flags(struct device *d, | |||
3672 | struct device_attribute *attr, | 3672 | struct device_attribute *attr, |
3673 | const char *buf, size_t count) | 3673 | const char *buf, size_t count) |
3674 | { | 3674 | { |
3675 | struct iwl_priv *priv = (struct iwl_priv *)d->driver_data; | 3675 | struct iwl_priv *priv = dev_get_drvdata(d); |
3676 | u32 flags = simple_strtoul(buf, NULL, 0); | 3676 | u32 flags = simple_strtoul(buf, NULL, 0); |
3677 | 3677 | ||
3678 | mutex_lock(&priv->mutex); | 3678 | mutex_lock(&priv->mutex); |
@@ -3697,7 +3697,7 @@ static DEVICE_ATTR(flags, S_IWUSR | S_IRUGO, show_flags, store_flags); | |||
3697 | static ssize_t show_filter_flags(struct device *d, | 3697 | static ssize_t show_filter_flags(struct device *d, |
3698 | struct device_attribute *attr, char *buf) | 3698 | struct device_attribute *attr, char *buf) |
3699 | { | 3699 | { |
3700 | struct iwl_priv *priv = (struct iwl_priv *)d->driver_data; | 3700 | struct iwl_priv *priv = dev_get_drvdata(d); |
3701 | 3701 | ||
3702 | return sprintf(buf, "0x%04X\n", | 3702 | return sprintf(buf, "0x%04X\n", |
3703 | le32_to_cpu(priv->active_rxon.filter_flags)); | 3703 | le32_to_cpu(priv->active_rxon.filter_flags)); |
@@ -3707,7 +3707,7 @@ static ssize_t store_filter_flags(struct device *d, | |||
3707 | struct device_attribute *attr, | 3707 | struct device_attribute *attr, |
3708 | const char *buf, size_t count) | 3708 | const char *buf, size_t count) |
3709 | { | 3709 | { |
3710 | struct iwl_priv *priv = (struct iwl_priv *)d->driver_data; | 3710 | struct iwl_priv *priv = dev_get_drvdata(d); |
3711 | u32 filter_flags = simple_strtoul(buf, NULL, 0); | 3711 | u32 filter_flags = simple_strtoul(buf, NULL, 0); |
3712 | 3712 | ||
3713 | mutex_lock(&priv->mutex); | 3713 | mutex_lock(&priv->mutex); |
@@ -3992,7 +3992,7 @@ static DEVICE_ATTR(antenna, S_IWUSR | S_IRUGO, show_antenna, store_antenna); | |||
3992 | static ssize_t show_status(struct device *d, | 3992 | static ssize_t show_status(struct device *d, |
3993 | struct device_attribute *attr, char *buf) | 3993 | struct device_attribute *attr, char *buf) |
3994 | { | 3994 | { |
3995 | struct iwl_priv *priv = (struct iwl_priv *)d->driver_data; | 3995 | struct iwl_priv *priv = dev_get_drvdata(d); |
3996 | if (!iwl_is_alive(priv)) | 3996 | if (!iwl_is_alive(priv)) |
3997 | return -EAGAIN; | 3997 | return -EAGAIN; |
3998 | return sprintf(buf, "0x%08x\n", (int)priv->status); | 3998 | return sprintf(buf, "0x%08x\n", (int)priv->status); |
@@ -4004,10 +4004,11 @@ static ssize_t dump_error_log(struct device *d, | |||
4004 | struct device_attribute *attr, | 4004 | struct device_attribute *attr, |
4005 | const char *buf, size_t count) | 4005 | const char *buf, size_t count) |
4006 | { | 4006 | { |
4007 | struct iwl_priv *priv = dev_get_drvdata(d); | ||
4007 | char *p = (char *)buf; | 4008 | char *p = (char *)buf; |
4008 | 4009 | ||
4009 | if (p[0] == '1') | 4010 | if (p[0] == '1') |
4010 | iwl3945_dump_nic_error_log((struct iwl_priv *)d->driver_data); | 4011 | iwl3945_dump_nic_error_log(priv); |
4011 | 4012 | ||
4012 | return strnlen(buf, count); | 4013 | return strnlen(buf, count); |
4013 | } | 4014 | } |
@@ -4018,10 +4019,11 @@ static ssize_t dump_event_log(struct device *d, | |||
4018 | struct device_attribute *attr, | 4019 | struct device_attribute *attr, |
4019 | const char *buf, size_t count) | 4020 | const char *buf, size_t count) |
4020 | { | 4021 | { |
4022 | struct iwl_priv *priv = dev_get_drvdata(d); | ||
4021 | char *p = (char *)buf; | 4023 | char *p = (char *)buf; |
4022 | 4024 | ||
4023 | if (p[0] == '1') | 4025 | if (p[0] == '1') |
4024 | iwl3945_dump_nic_event_log((struct iwl_priv *)d->driver_data); | 4026 | iwl3945_dump_nic_event_log(priv); |
4025 | 4027 | ||
4026 | return strnlen(buf, count); | 4028 | return strnlen(buf, count); |
4027 | } | 4029 | } |