mirror of
https://github.com/Stichting-MINIX-Research-Foundation/u-boot.git
synced 2025-09-10 12:39:22 -04:00
nand: Clean up nand_util
This patch cleans up nand_util.c: - Fix tabs. - Fix typos. - Remove space character before opening parenthesis in function calls. - Fix comments. Signed-off-by: Benoît Thébaudeau <benoit.thebaudeau@advansee.com> Cc: Scott Wood <scottwood@freescale.com>
This commit is contained in:
parent
c788ecfdc3
commit
bd74280d62
@ -59,7 +59,7 @@ typedef struct mtd_info mtd_info_t;
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* nand_erase_opts: - erase NAND flash with support for various options
|
* nand_erase_opts: - erase NAND flash with support for various options
|
||||||
* (jffs2 formating)
|
* (jffs2 formatting)
|
||||||
*
|
*
|
||||||
* @param meminfo NAND device to erase
|
* @param meminfo NAND device to erase
|
||||||
* @param opts options, @see struct nand_erase_options
|
* @param opts options, @see struct nand_erase_options
|
||||||
@ -81,7 +81,7 @@ int nand_erase_opts(nand_info_t *meminfo, const nand_erase_options_t *opts)
|
|||||||
struct nand_chip *chip = meminfo->priv;
|
struct nand_chip *chip = meminfo->priv;
|
||||||
|
|
||||||
if ((opts->offset & (meminfo->writesize - 1)) != 0) {
|
if ((opts->offset & (meminfo->writesize - 1)) != 0) {
|
||||||
printf("Attempt to erase non page aligned data\n");
|
printf("Attempt to erase non page-aligned data\n");
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -259,7 +259,7 @@ int nand_lock(struct mtd_info *mtd, int tight)
|
|||||||
* flash
|
* flash
|
||||||
*
|
*
|
||||||
* @param mtd nand mtd instance
|
* @param mtd nand mtd instance
|
||||||
* @param offset page address to query (muss be page aligned!)
|
* @param offset page address to query (must be page-aligned!)
|
||||||
*
|
*
|
||||||
* @return -1 in case of error
|
* @return -1 in case of error
|
||||||
* >0 lock status:
|
* >0 lock status:
|
||||||
@ -507,7 +507,7 @@ int nand_write_skip_bad(nand_info_t *nand, loff_t offset, size_t *length,
|
|||||||
* partition boundary). So don't try to handle that.
|
* partition boundary). So don't try to handle that.
|
||||||
*/
|
*/
|
||||||
if ((offset & (nand->writesize - 1)) != 0) {
|
if ((offset & (nand->writesize - 1)) != 0) {
|
||||||
printf ("Attempt to write non page aligned data\n");
|
printf("Attempt to write non page-aligned data\n");
|
||||||
*length = 0;
|
*length = 0;
|
||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
}
|
}
|
||||||
@ -608,13 +608,13 @@ int nand_write_skip_bad(nand_info_t *nand, loff_t offset, size_t *length,
|
|||||||
* nand_read_skip_bad:
|
* nand_read_skip_bad:
|
||||||
*
|
*
|
||||||
* Read image from NAND flash.
|
* Read image from NAND flash.
|
||||||
* Blocks that are marked bad are skipped and the next block is readen
|
* Blocks that are marked bad are skipped and the next block is read
|
||||||
* instead as long as the image is short enough to fit even after skipping the
|
* instead as long as the image is short enough to fit even after skipping the
|
||||||
* bad blocks.
|
* bad blocks.
|
||||||
*
|
*
|
||||||
* @param nand NAND device
|
* @param nand NAND device
|
||||||
* @param offset offset in flash
|
* @param offset offset in flash
|
||||||
* @param length buffer length, on return holds remaining bytes to read
|
* @param length buffer length, on return holds number of read bytes
|
||||||
* @param buffer buffer to write to
|
* @param buffer buffer to write to
|
||||||
* @return 0 in case of success
|
* @return 0 in case of success
|
||||||
*/
|
*/
|
||||||
@ -627,7 +627,7 @@ int nand_read_skip_bad(nand_info_t *nand, loff_t offset, size_t *length,
|
|||||||
int need_skip;
|
int need_skip;
|
||||||
|
|
||||||
if ((offset & (nand->writesize - 1)) != 0) {
|
if ((offset & (nand->writesize - 1)) != 0) {
|
||||||
printf ("Attempt to read non page aligned data\n");
|
printf("Attempt to read non page-aligned data\n");
|
||||||
*length = 0;
|
*length = 0;
|
||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user