summaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorSascha Hauer <s.hauer@pengutronix.de>2010-02-08 13:37:01 +0100
committerSascha Hauer <s.hauer@pengutronix.de>2010-02-08 14:37:49 +0100
commit8b828993411963d261ed6760b6fb7cea19b2cce3 (patch)
tree20977da60d23471f4a9d6db26ad5949eb0e6b597 /drivers
parent089066237d84e1451d2810a37a8084981665d8b8 (diff)
downloadbarebox-8b828993411963d261ed6760b6fb7cea19b2cce3.tar.gz
barebox-8b828993411963d261ed6760b6fb7cea19b2cce3.tar.xz
cfi_flash_new: make code more readable, return is not a function
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/nor/cfi_flash_new.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/drivers/nor/cfi_flash_new.c b/drivers/nor/cfi_flash_new.c
index f9306cb4a2..88432c8507 100644
--- a/drivers/nor/cfi_flash_new.c
+++ b/drivers/nor/cfi_flash_new.c
@@ -123,7 +123,6 @@ static int flash_write_cfiword (flash_info_t * info, ulong dest,
ctladdr.cp = flash_make_addr (info, 0, 0);
cptr.cp = (uchar *) dest;
-
/* Check if Flash is (sufficiently) erased */
if (bankwidth_is_1(info)) {
flag = ((cptr.cp[0] & cword.c) == cword.c);
@@ -488,7 +487,7 @@ static ulong flash_get_size (flash_info_t *info, ulong base)
}
flash_write_cmd (info, 0, 0, info->cmd_reset);
- return (info->size);
+ return info->size;
}
/* loop through the sectors from the highest address
@@ -563,7 +562,9 @@ static int write_buff (flash_info_t * info, const uchar * src, ulong addr, ulong
}
for (; (cnt == 0) && (i < info->portwidth); ++i, ++cp)
flash_add_byte (info, &cword, (*(uchar *) cp));
- if ((rc = flash_write_cfiword (info, wp, cword)) != 0)
+
+ rc = flash_write_cfiword (info, wp, cword);
+ if (rc)
return rc;
wp = cp;
}
@@ -609,7 +610,7 @@ static int write_buff (flash_info_t * info, const uchar * src, ulong addr, ulong
}
#endif /* CONFIG_CFI_BUFFER_WRITE */
if (cnt == 0) {
- return (0);
+ return 0;
}
/*