Re: [PATCH 3/3] mtd/nand : workaround for Freescale FCM to supportlarge-page Nand chip

From: Scott Wood
Date: Mon Nov 28 2011 - 12:20:38 EST


On 11/24/2011 01:37 AM, Li Yang-R58472 wrote:
>> +static void io_to_buffer(struct mtd_info *mtd, int subpage, int oob)
>> +{
>> + struct nand_chip *chip = mtd->priv;
>> + struct fsl_elbc_mtd *priv = chip->priv;
>> + struct fsl_elbc_fcm_ctrl *elbc_fcm_ctrl = priv->ctrl->nand;
>> + void *src, *dst;
>> + int len = (oob ? 64 : 2048);
>> +
>> + if (oob)
>> + dst = elbc_fcm_ctrl->buffer + mtd->writesize + subpage * 64;
>> + else
>> + dst = elbc_fcm_ctrl->buffer + subpage * 2048;
>> +
>> + src = elbc_fcm_ctrl->addr + (oob ? 2048 : 0);
>> + memcpy_fromio(dst, src, len);
>
> Might be safer to use _memcpy_fromio()

How so?

memcpy_fromio() is the public interface that will end up calling
_memcpy_fromio() on powerpc.

-Scott

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