diff options
author | Jingoo Han <jg1.han@samsung.com> | 2013-09-10 04:51:47 -0400 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2013-09-26 15:13:37 -0400 |
commit | b920e375be517524423826a58854b2d76017a2e3 (patch) | |
tree | 7a52b3a92628b6ddf9a87f65b4f66f51758da058 /drivers/net/wireless/ath/ath5k | |
parent | 5bb4101bc93a23dfcac508994378e975702e1abd (diff) |
wireless: ath5k: use dev_get_platdata()
Use the wrapper function for retrieving the platform data instead of
accessing dev->platform_data directly. This is a cosmetic change
to make the code simpler and enhance the readability.
Signed-off-by: Jingoo Han <jg1.han@samsung.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless/ath/ath5k')
-rw-r--r-- | drivers/net/wireless/ath/ath5k/ahb.c | 15 |
1 files changed, 6 insertions, 9 deletions
diff --git a/drivers/net/wireless/ath/ath5k/ahb.c b/drivers/net/wireless/ath/ath5k/ahb.c index e9bc9e616b69..79bffe165cab 100644 --- a/drivers/net/wireless/ath/ath5k/ahb.c +++ b/drivers/net/wireless/ath/ath5k/ahb.c | |||
@@ -37,12 +37,9 @@ ath5k_ahb_eeprom_read(struct ath_common *common, u32 off, u16 *data) | |||
37 | { | 37 | { |
38 | struct ath5k_hw *ah = common->priv; | 38 | struct ath5k_hw *ah = common->priv; |
39 | struct platform_device *pdev = to_platform_device(ah->dev); | 39 | struct platform_device *pdev = to_platform_device(ah->dev); |
40 | struct ar231x_board_config *bcfg = pdev->dev.platform_data; | 40 | struct ar231x_board_config *bcfg = dev_get_platdata(&pdev->dev); |
41 | u16 *eeprom, *eeprom_end; | 41 | u16 *eeprom, *eeprom_end; |
42 | 42 | ||
43 | |||
44 | |||
45 | bcfg = pdev->dev.platform_data; | ||
46 | eeprom = (u16 *) bcfg->radio; | 43 | eeprom = (u16 *) bcfg->radio; |
47 | eeprom_end = ((void *) bcfg->config) + BOARD_CONFIG_BUFSZ; | 44 | eeprom_end = ((void *) bcfg->config) + BOARD_CONFIG_BUFSZ; |
48 | 45 | ||
@@ -57,7 +54,7 @@ ath5k_ahb_eeprom_read(struct ath_common *common, u32 off, u16 *data) | |||
57 | int ath5k_hw_read_srev(struct ath5k_hw *ah) | 54 | int ath5k_hw_read_srev(struct ath5k_hw *ah) |
58 | { | 55 | { |
59 | struct platform_device *pdev = to_platform_device(ah->dev); | 56 | struct platform_device *pdev = to_platform_device(ah->dev); |
60 | struct ar231x_board_config *bcfg = pdev->dev.platform_data; | 57 | struct ar231x_board_config *bcfg = dev_get_platdata(&pdev->dev); |
61 | ah->ah_mac_srev = bcfg->devid; | 58 | ah->ah_mac_srev = bcfg->devid; |
62 | return 0; | 59 | return 0; |
63 | } | 60 | } |
@@ -65,7 +62,7 @@ int ath5k_hw_read_srev(struct ath5k_hw *ah) | |||
65 | static int ath5k_ahb_eeprom_read_mac(struct ath5k_hw *ah, u8 *mac) | 62 | static int ath5k_ahb_eeprom_read_mac(struct ath5k_hw *ah, u8 *mac) |
66 | { | 63 | { |
67 | struct platform_device *pdev = to_platform_device(ah->dev); | 64 | struct platform_device *pdev = to_platform_device(ah->dev); |
68 | struct ar231x_board_config *bcfg = pdev->dev.platform_data; | 65 | struct ar231x_board_config *bcfg = dev_get_platdata(&pdev->dev); |
69 | u8 *cfg_mac; | 66 | u8 *cfg_mac; |
70 | 67 | ||
71 | if (to_platform_device(ah->dev)->id == 0) | 68 | if (to_platform_device(ah->dev)->id == 0) |
@@ -87,7 +84,7 @@ static const struct ath_bus_ops ath_ahb_bus_ops = { | |||
87 | /*Initialization*/ | 84 | /*Initialization*/ |
88 | static int ath_ahb_probe(struct platform_device *pdev) | 85 | static int ath_ahb_probe(struct platform_device *pdev) |
89 | { | 86 | { |
90 | struct ar231x_board_config *bcfg = pdev->dev.platform_data; | 87 | struct ar231x_board_config *bcfg = dev_get_platdata(&pdev->dev); |
91 | struct ath5k_hw *ah; | 88 | struct ath5k_hw *ah; |
92 | struct ieee80211_hw *hw; | 89 | struct ieee80211_hw *hw; |
93 | struct resource *res; | 90 | struct resource *res; |
@@ -96,7 +93,7 @@ static int ath_ahb_probe(struct platform_device *pdev) | |||
96 | int ret = 0; | 93 | int ret = 0; |
97 | u32 reg; | 94 | u32 reg; |
98 | 95 | ||
99 | if (!pdev->dev.platform_data) { | 96 | if (!dev_get_platdata(&pdev->dev)) { |
100 | dev_err(&pdev->dev, "no platform data specified\n"); | 97 | dev_err(&pdev->dev, "no platform data specified\n"); |
101 | ret = -EINVAL; | 98 | ret = -EINVAL; |
102 | goto err_out; | 99 | goto err_out; |
@@ -193,7 +190,7 @@ static int ath_ahb_probe(struct platform_device *pdev) | |||
193 | 190 | ||
194 | static int ath_ahb_remove(struct platform_device *pdev) | 191 | static int ath_ahb_remove(struct platform_device *pdev) |
195 | { | 192 | { |
196 | struct ar231x_board_config *bcfg = pdev->dev.platform_data; | 193 | struct ar231x_board_config *bcfg = dev_get_platdata(&pdev->dev); |
197 | struct ieee80211_hw *hw = platform_get_drvdata(pdev); | 194 | struct ieee80211_hw *hw = platform_get_drvdata(pdev); |
198 | struct ath5k_hw *ah; | 195 | struct ath5k_hw *ah; |
199 | u32 reg; | 196 | u32 reg; |