[U-Boot] [PATCH v6 05/21] sf: nr_sectors -> n_sectors

Siva Durga Prasad Paladugu siva.durga.paladugu at xilinx.com
Wed Nov 16 06:52:39 CET 2016


Hi,

> -----Original Message-----
> From: Jagan Teki [mailto:jagan at openedev.com]
> Sent: Wednesday, November 16, 2016 9:33 AM
> To: u-boot at lists.denx.de
> Cc: Jagan Teki <jagan at openedev.com>; Bin Meng <bmeng.cn at gmail.com>;
> York Sun <york.sun at nxp.com>; Vignesh R <vigneshr at ti.com>; Mugunthan V
> N <mugunthanvnm at ti.com>; Michal Simek <michal.simek at xilinx.com>; Siva
> Durga Prasad Paladugu <sivadur at xilinx.com>
> Subject: [PATCH v6 05/21] sf: nr_sectors -> n_sectors
> 
> Rename nr_sectors as n_sectors to sync with Linux.
> 
> Cc: Bin Meng <bmeng.cn at gmail.com>
> Cc: York Sun <york.sun at nxp.com>
> Cc: Vignesh R <vigneshr at ti.com>
> Cc: Mugunthan V N <mugunthanvnm at ti.com>
> Cc: Michal Simek <michal.simek at xilinx.com>
> Cc: Siva Durga Prasad Paladugu <sivadur at xilinx.com>
> Signed-off-by: Jagan Teki <jagan at openedev.com>
> Reviewed-by: Simon Glass <sjg at chromium.org>
> Reviewed-by: Jagan Teki <jagan at openedev.com>
> Tested-by: Jagan Teki <jagan at openedev.com>
Reviewed-by: Siva Durga Prasad Paladugu <sivadur at xilinx.com>


Thanks,
Siva

> ---
>  drivers/mtd/spi/sandbox.c     | 2 +-
>  drivers/mtd/spi/sf_internal.h | 2 +-
>  drivers/mtd/spi/sf_params.c   | 2 +-
>  drivers/mtd/spi/spi_flash.c   | 2 +-
>  4 files changed, 4 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/mtd/spi/sandbox.c b/drivers/mtd/spi/sandbox.c index
> 09ce783..4944059 100644
> --- a/drivers/mtd/spi/sandbox.c
> +++ b/drivers/mtd/spi/sandbox.c
> @@ -289,7 +289,7 @@ static int sandbox_sf_process_cmd(struct
> sandbox_spi_flash *sbsf, const u8 *rx,
>  		/* we only support erase here */
>  		if (sbsf->cmd == CMD_ERASE_CHIP) {
>  			sbsf->erase_size = sbsf->data->sector_size *
> -				sbsf->data->nr_sectors;
> +				sbsf->data->n_sectors;
>  		} else if (sbsf->cmd == CMD_ERASE_4K && (flags & SECT_4K))
> {
>  			sbsf->erase_size = 4 << 10;
>  		} else if (sbsf->cmd == CMD_ERASE_64K && !(flags &
> SECT_4K)) { diff --git a/drivers/mtd/spi/sf_internal.h
> b/drivers/mtd/spi/sf_internal.h index d7ac6b3..70617f2 100644
> --- a/drivers/mtd/spi/sf_internal.h
> +++ b/drivers/mtd/spi/sf_internal.h
> @@ -125,7 +125,7 @@ struct spi_flash_info {
>  	 * necessarily called a "sector" by the vendor.
>  	 */
>  	u32		sector_size;
> -	u32		nr_sectors;
> +	u32		n_sectors;
> 
>  	u16		page_size;
> 
> diff --git a/drivers/mtd/spi/sf_params.c b/drivers/mtd/spi/sf_params.c index
> 7fcc3bc..d46a276 100644
> --- a/drivers/mtd/spi/sf_params.c
> +++ b/drivers/mtd/spi/sf_params.c
> @@ -23,7 +23,7 @@
>  			},						\
>  		.id_len = (!(_jedec_id) ? 0 : (3 + ((_ext_id) ? 2 : 0))),	\
>  		.sector_size = (_sector_size),				\
> -		.nr_sectors = (_n_sectors),				\
> +		.n_sectors = (_n_sectors),				\
>  		.page_size = 256,					\
>  		.flags = (_flags),
> 
> diff --git a/drivers/mtd/spi/spi_flash.c b/drivers/mtd/spi/spi_flash.c index
> 220c961..f7634df 100644
> --- a/drivers/mtd/spi/spi_flash.c
> +++ b/drivers/mtd/spi/spi_flash.c
> @@ -1144,7 +1144,7 @@ int spi_flash_scan(struct spi_flash *flash)
>  	}
>  	flash->page_size <<= flash->shift;
>  	flash->sector_size = info->sector_size << flash->shift;
> -	flash->size = flash->sector_size * info->nr_sectors << flash->shift;
> +	flash->size = flash->sector_size * info->n_sectors << flash->shift;
>  #ifdef CONFIG_SF_DUAL_FLASH
>  	if (flash->dual_flash & SF_DUAL_STACKED_FLASH)
>  		flash->size <<= 1;
> --
> 1.9.1



More information about the U-Boot mailing list