[PATCH 4/7] cfi_flash: use flash_write_word instead of reimplementing it again

Sascha Hauer s.hauer at pengutronix.de
Thu Apr 22 07:31:22 EDT 2010


On Mon, Apr 19, 2010 at 10:28:15AM +0200, Wolfram Sang wrote:
> From: Uwe Kleine-König <u.kleine-koenig at pengutronix.de>
> 
> While at it remove some unused code and an unbalanced
> enable_interrupts().
> 
> Signed-off-by: Uwe Kleine-König <u.kleine-koenig at pengutronix.de>
> Signed-off-by: Wolfram Sang <w.sang at pengutronix.de>
> ---
>  drivers/nor/cfi_flash.c |   19 +------------------
>  1 files changed, 1 insertions(+), 18 deletions(-)

applied to next.

> 
> diff --git a/drivers/nor/cfi_flash.c b/drivers/nor/cfi_flash.c
> index 0f7a483..dbfb004 100644
> --- a/drivers/nor/cfi_flash.c
> +++ b/drivers/nor/cfi_flash.c
> @@ -116,11 +116,9 @@ static void flash_add_byte (flash_info_t * info, cfiword_t * cword, uchar c)
>  static int flash_write_cfiword (flash_info_t * info, ulong dest,
>  				cfiword_t cword)
>  {
> -	cfiptr_t ctladdr;
>  	cfiptr_t cptr;
>  	int flag;
>  
> -	ctladdr.cp = flash_make_addr (info, 0, 0);
>  	cptr.cp = (uchar *) dest;
>  
>  	/* Check if Flash is (sufficiently) erased */
> @@ -138,24 +136,9 @@ static int flash_write_cfiword (flash_info_t * info, ulong dest,
>  	if (!flag)
>  		return 2;
>  
> -	/* Disable interrupts which might cause a timeout here */
> -//	flag = disable_interrupts ();
> -
>  	info->cfi_cmd_set->flash_prepare_write(info);
>  
> -	if (bankwidth_is_1(info)) {
> -		cptr.cp[0] = cword.c;
> -	} else if (bankwidth_is_2(info)) {
> -		cptr.wp[0] = cword.w;
> -	} else if (bankwidth_is_4(info)) {
> -		cptr.lp[0] = cword.l;
> -	} else if (bankwidth_is_8(info)) {
> -		cptr.llp[0] = cword.ll;
> -	}
> -
> -	/* re-enable interrupts if necessary */
> -	if (flag)
> -		enable_interrupts ();
> +	flash_write_word(info, cword, (void *)dest);
>  
>  	return flash_status_check (info, find_sector (info, dest),
>  					info->write_tout, "write");
> -- 
> 1.7.0
> 
> 
> _______________________________________________
> barebox mailing list
> barebox at lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/barebox

-- 
Pengutronix e.K.                           |                             |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |



More information about the barebox mailing list