[U-Boot] [PATCH 5/7] S3C24XX: Add NAND Flash driver

José Miguel Gonçalves jose.goncalves at inov.pt
Thu Sep 13 01:55:21 CEST 2012


On 09/13/2012 12:45 AM, Marek Vasut wrote:
> Dear José Miguel Gonçalves,
>
>> Hi Marek,
>>
>> On 09/12/2012 10:11 PM, Marek Vasut wrote:
>>> Dear José Miguel Gonçalves,
>>>
>>>> +
>>>> +/*
>>>> + * Hardware specific access to control-lines function
>>>> + */
>>>> +static void s3c_nand_hwcontrol(struct mtd_info *mtd, int cmd, unsigned
>>>> int ctrl) +{
>>>> +	s3c24xx_nand *const nand = s3c24xx_get_base_nand();
>>>> +	struct nand_chip *this = mtd->priv;
>>>> +
>>>> +	if (ctrl & NAND_CTRL_CHANGE) {
>>>> +		if (ctrl & NAND_CLE)
>>>> +			this->IO_ADDR_W = (void __iomem *)&nand->nfcmmd;
>>>> +		else if (ctrl & NAND_ALE)
>>>> +			this->IO_ADDR_W = (void __iomem *)&nand->nfaddr;
>>>> +		else
>>>> +			this->IO_ADDR_W = (void __iomem *)&nand->nfdata;
>>> Do you need this cast ?
>> Without it gcc gives me a warning:
>>
>> s3c24xx_nand.c:90:20: warning: assignment discards `volatile' qualifier
>> from pointer target type [enabled by default]
> Not that you need to do the assignment into the structure .... use local
> variable, no ?

Understood. I agree, it makes more sense to use a local variable to 
address the proper NAND controller register.
I will update that.

Best regards,
José Gonçalves


More information about the U-Boot mailing list