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>
This commit is contained in:
parent
5bb4101bc9
commit
b920e375be
|
@ -37,12 +37,9 @@ ath5k_ahb_eeprom_read(struct ath_common *common, u32 off, u16 *data)
|
||||||
{
|
{
|
||||||
struct ath5k_hw *ah = common->priv;
|
struct ath5k_hw *ah = common->priv;
|
||||||
struct platform_device *pdev = to_platform_device(ah->dev);
|
struct platform_device *pdev = to_platform_device(ah->dev);
|
||||||
struct ar231x_board_config *bcfg = pdev->dev.platform_data;
|
struct ar231x_board_config *bcfg = dev_get_platdata(&pdev->dev);
|
||||||
u16 *eeprom, *eeprom_end;
|
u16 *eeprom, *eeprom_end;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
bcfg = pdev->dev.platform_data;
|
|
||||||
eeprom = (u16 *) bcfg->radio;
|
eeprom = (u16 *) bcfg->radio;
|
||||||
eeprom_end = ((void *) bcfg->config) + BOARD_CONFIG_BUFSZ;
|
eeprom_end = ((void *) bcfg->config) + BOARD_CONFIG_BUFSZ;
|
||||||
|
|
||||||
|
@ -57,7 +54,7 @@ ath5k_ahb_eeprom_read(struct ath_common *common, u32 off, u16 *data)
|
||||||
int ath5k_hw_read_srev(struct ath5k_hw *ah)
|
int ath5k_hw_read_srev(struct ath5k_hw *ah)
|
||||||
{
|
{
|
||||||
struct platform_device *pdev = to_platform_device(ah->dev);
|
struct platform_device *pdev = to_platform_device(ah->dev);
|
||||||
struct ar231x_board_config *bcfg = pdev->dev.platform_data;
|
struct ar231x_board_config *bcfg = dev_get_platdata(&pdev->dev);
|
||||||
ah->ah_mac_srev = bcfg->devid;
|
ah->ah_mac_srev = bcfg->devid;
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
@ -65,7 +62,7 @@ int ath5k_hw_read_srev(struct ath5k_hw *ah)
|
||||||
static int ath5k_ahb_eeprom_read_mac(struct ath5k_hw *ah, u8 *mac)
|
static int ath5k_ahb_eeprom_read_mac(struct ath5k_hw *ah, u8 *mac)
|
||||||
{
|
{
|
||||||
struct platform_device *pdev = to_platform_device(ah->dev);
|
struct platform_device *pdev = to_platform_device(ah->dev);
|
||||||
struct ar231x_board_config *bcfg = pdev->dev.platform_data;
|
struct ar231x_board_config *bcfg = dev_get_platdata(&pdev->dev);
|
||||||
u8 *cfg_mac;
|
u8 *cfg_mac;
|
||||||
|
|
||||||
if (to_platform_device(ah->dev)->id == 0)
|
if (to_platform_device(ah->dev)->id == 0)
|
||||||
|
@ -87,7 +84,7 @@ static const struct ath_bus_ops ath_ahb_bus_ops = {
|
||||||
/*Initialization*/
|
/*Initialization*/
|
||||||
static int ath_ahb_probe(struct platform_device *pdev)
|
static int ath_ahb_probe(struct platform_device *pdev)
|
||||||
{
|
{
|
||||||
struct ar231x_board_config *bcfg = pdev->dev.platform_data;
|
struct ar231x_board_config *bcfg = dev_get_platdata(&pdev->dev);
|
||||||
struct ath5k_hw *ah;
|
struct ath5k_hw *ah;
|
||||||
struct ieee80211_hw *hw;
|
struct ieee80211_hw *hw;
|
||||||
struct resource *res;
|
struct resource *res;
|
||||||
|
@ -96,7 +93,7 @@ static int ath_ahb_probe(struct platform_device *pdev)
|
||||||
int ret = 0;
|
int ret = 0;
|
||||||
u32 reg;
|
u32 reg;
|
||||||
|
|
||||||
if (!pdev->dev.platform_data) {
|
if (!dev_get_platdata(&pdev->dev)) {
|
||||||
dev_err(&pdev->dev, "no platform data specified\n");
|
dev_err(&pdev->dev, "no platform data specified\n");
|
||||||
ret = -EINVAL;
|
ret = -EINVAL;
|
||||||
goto err_out;
|
goto err_out;
|
||||||
|
@ -193,7 +190,7 @@ static int ath_ahb_probe(struct platform_device *pdev)
|
||||||
|
|
||||||
static int ath_ahb_remove(struct platform_device *pdev)
|
static int ath_ahb_remove(struct platform_device *pdev)
|
||||||
{
|
{
|
||||||
struct ar231x_board_config *bcfg = pdev->dev.platform_data;
|
struct ar231x_board_config *bcfg = dev_get_platdata(&pdev->dev);
|
||||||
struct ieee80211_hw *hw = platform_get_drvdata(pdev);
|
struct ieee80211_hw *hw = platform_get_drvdata(pdev);
|
||||||
struct ath5k_hw *ah;
|
struct ath5k_hw *ah;
|
||||||
u32 reg;
|
u32 reg;
|
||||||
|
|
Loading…
Reference in New Issue