
Dear Lubomir Rintel,
In message 1360191866.3594.10.camel@unicorn you wrote:
if (mtd_type != MTD_DATAFLASH)
if (mtd_type && mtd_type != MTD_DATAFLASH)
This change appears to be redundant. If mtd_type is null, then this is already caught iun te test mtd_type != MTD_DATAFLASH, isn't it?
No. We don't want the erase ioctl to be called for non-MTD devices and files (where mtd_type is null).
I see. But you are misusing mtd_type.
You should define something like MTD_NO_FLASH or so, and use that.
perror ("Cannot get MTD information");
perror ("Cannot access MTD device");
I don't understand this. You talk about a MTD device here, but expect that MEMGETINFO will not work on it? Please explain in which exact circumstances such a situation wouldhappen.
The error message (mention of MTD at that point) is incorrect. fstat()
So it needs to be fixed.
if (mtdinfo.type != MTD_NORFLASH && mtdinfo.type != MTD_NANDFLASH &&
mtdinfo.type != MTD_DATAFLASH) {
mtdinfo.type != MTD_DATAFLASH &&
mtdinfo.type) {
Again, this last line appears to be redundant.
The same response again -- if the type is nul, then the device is not a flash device at all.
See above. Please make the code sonsistent and define a proper name for this type.
Best regards,
Wolfgang Denk