diff options
author | Sascha Hauer <s.hauer@pengutronix.de> | 2007-07-15 13:46:45 +0200 |
---|---|---|
committer | Sascha Hauer <s.hauer@pengutronix.de> | 2007-07-15 13:46:45 +0200 |
commit | 9b3761c4459167a335d3a1c30543824afa2d654d (patch) | |
tree | 53f943b954e7d2b217b1c26d601a047f94a07468 /drivers | |
parent | 7ec80eb0e98871fe2ae5ec3ac17147dd6cc89db3 (diff) | |
download | barebox-9b3761c4459167a335d3a1c30543824afa2d654d.tar.gz barebox-9b3761c4459167a335d3a1c30543824afa2d654d.tar.xz |
whitespace cleanup
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/cfi_flash.c | 78 |
1 files changed, 39 insertions, 39 deletions
diff --git a/drivers/cfi_flash.c b/drivers/cfi_flash.c index b635a15b74..4e6820db19 100644 --- a/drivers/cfi_flash.c +++ b/drivers/cfi_flash.c @@ -320,7 +320,7 @@ ulong flash_read_long (flash_info_t * info, flash_sect_t sect, uint offset) int cfi_probe (struct device_d *dev) { unsigned long size = 0; - flash_info_t *info = malloc(sizeof(flash_info_t)); + flash_info_t *info = malloc(sizeof(flash_info_t)); dev->priv = (void *)info; @@ -341,18 +341,18 @@ int cfi_probe (struct device_d *dev) static int flash_find_sector(flash_info_t * info, unsigned long adr) { - int i; - unsigned long end; - - for (i = 0; i < info->sector_count; i++) { - if (i == info->sector_count) - end = info->start[0] + info->size - 1; - else - end = info->start[i + 1] - 1; - if (adr >= info->start[i] && adr <= end) - return i; - } - return -1; + int i; + unsigned long end; + + for (i = 0; i < info->sector_count; i++) { + if (i == info->sector_count) + end = info->start[0] + info->size - 1; + else + end = info->start[i + 1] - 1; + if (adr >= info->start[i] && adr <= end) + return i; + } + return -1; } /*----------------------------------------------------------------------- @@ -387,44 +387,44 @@ int flash_erase_one (flash_info_t * info, long sect) } else putc ('.'); - return rcode; + return rcode; } int cfi_erase(struct device_d *dev, size_t count, unsigned long offset) { - flash_info_t *finfo = (flash_info_t *)dev->priv; - unsigned long start, end; - int i, ret = 0; + flash_info_t *finfo = (flash_info_t *)dev->priv; + unsigned long start, end; + int i, ret = 0; printf("%s: erase 0x%08x (size %d)\n", __FUNCTION__, offset, count); - start = flash_find_sector(finfo, dev->map_base + offset); - end = flash_find_sector(finfo, dev->map_base + offset + count - 1); + start = flash_find_sector(finfo, dev->map_base + offset); + end = flash_find_sector(finfo, dev->map_base + offset + count - 1); - for (i = start; i <= end; i++) { - ret = flash_erase_one (finfo, i); - if (ret) - goto out; - } + for (i = start; i <= end; i++) { + ret = flash_erase_one (finfo, i); + if (ret) + goto out; + } out: - putc('\n'); - return ret; + putc('\n'); + return ret; } static ssize_t cfi_write(struct device_d* dev, const void* buf, size_t count, unsigned long offset, ulong flags) { - flash_info_t *finfo = (flash_info_t *)dev->priv; - int ret; + flash_info_t *finfo = (flash_info_t *)dev->priv; + int ret; debug("cfi_write: buf=0x%08x addr=0x%08x count=0x%08x\n",buf, dev->map_base + offset, count); - ret = write_buff (finfo, buf, dev->map_base + offset, count); - return ret == 0 ? count : -1; + ret = write_buff (finfo, buf, dev->map_base + offset, count); + return ret == 0 ? count : -1; } void cfi_info (struct device_d* dev) { - flash_info_t *info = (flash_info_t *)dev->priv; + flash_info_t *info = (flash_info_t *)dev->priv; int i; if (info->flash_id != FLASH_MAN_CFI) { @@ -513,17 +513,17 @@ void cfi_info (struct device_d* dev) } static struct driver_d cfi_driver = { - .name = "cfi_flash", - .probe = cfi_probe, - .read = mem_read, - .write = cfi_write, - .erase = cfi_erase, - .info = cfi_info, + .name = "cfi_flash", + .probe = cfi_probe, + .read = mem_read, + .write = cfi_write, + .erase = cfi_erase, + .info = cfi_info, }; static int cfi_init(void) { - return register_driver(&cfi_driver); + return register_driver(&cfi_driver); } device_initcall(cfi_init); @@ -729,7 +729,7 @@ static int flash_status_check (flash_info_t * info, flash_sect_t sector, { uint64_t start; - tout *= 1000000; + tout *= 1000000; /* Wait for command completion */ start = get_time_ns(); |