Search Linux Wireless

Re: [ath9k-devel] [PATCH v4 07/11] ath9k: get EEPROM contents from platform data on AHB bus

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Sujith írta:
> Gabor Juhos wrote:
>> +static bool ath_ahb_eeprom_read(struct ath_hal *ah, u32 off, u16 *data)
>> +{
>> +	struct ath_softc *sc = ah->ah_sc;
>> +	struct platform_device *pdev = to_platform_device(sc->dev);
>> +	struct ath9k_platform_data *pdata;
>> +
>> +	pdata = (struct ath9k_platform_data *) pdev->dev.platform_data;
>> +	if (off >= (ARRAY_SIZE(pdata->eeprom_data))) {
>> +		DPRINTF(ah->ah_sc, ATH_DBG_FATAL,
>> +			"%s: flash read failed, offset %08x is out of range\n",
>> +				__func__, off);
>> +		return false;
>> +	}
>> +
>> +	*data = pdata->eeprom_data[off];
>> +	return true;
>> +}
>> +
> 
> Shouldn't pdev->dev.platform_data be initalized somewhere ?

It must be initialized by the board specific setup code,

> @@ -48,6 +69,12 @@ static int ath_ahb_probe(struct platform_device *pdev)
>  	int ret = 0;
>  	struct ath_hal *ah;
>  
> +	if (!pdev->dev.platform_data) {
> +		dev_err(&pdev->dev, "no platform data specified\n");
> +		ret = -EINVAL;
> +		goto err_out;
> +	}
> +

... and we have checked it in the probe routine anyway.

-Gabor

--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Host AP]     [ATH6KL]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [Linux Kernel]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Samba]     [Device Mapper]
  Powered by Linux