Generic Platform NAND Driver

Vladimir A. Barinov vbarinov at ru.mvista.com
Tue May 22 07:19:36 EDT 2007


Hi Semih,

Semih Hazar wrote:
> Vladimir A. Barinov wrote:
>> You can look at the first (I guess) usage example here:
>> http://www.arm.linux.org.uk/developer/patches/viewpatch.php?id=4385/2
>>
>>   
>
> +ixdp425_flash_nand_cmd_ctrl(struct mtd_info *mtd, int cmd, unsigned 
> int ctrl)
> +{
> +    struct nand_chip *this = mtd->priv;
> +    int offset = (int)this->priv;
>
> Here offset is read from nand_chip->priv, which actually points to 
> struct plat_nand_data of plat_nand.c
>
> Am I wrong ? 
I agree with you.
And you are right that all things work fine because the 
mtd_info->priv->priv that points to plat_nand_data is not used.

I agree that the line 54 in plat_nand.c should be removed:

-	data->chip.priv = &data;


But does it really usefull to create void * host pointer if it could be 
done in arch code like the above patch does?

Vladimir




More information about the linux-mtd mailing list