[PATCH 1/2] mtd: spi-nor: make n_sectors in flash_info 32 bit wide

Marek Vasut marek.vasut at gmail.com
Mon Jan 16 08:06:16 PST 2017


On 01/16/2017 04:12 PM, Bastian Stender wrote:
> Since MRAM chips (like the Everspin mr25h40) are not sector organized
> they should be defined as n_sectors * 1 byte sectors. To be able to
> store the higher number of sectors n_sectors should be an unsigned 32
> bit integer just like sector_size.
> 
> Signed-off-by: Bastian Stender <bst at pengutronix.de>
> ---
>  drivers/mtd/spi-nor/spi-nor.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/mtd/spi-nor/spi-nor.c b/drivers/mtd/spi-nor/spi-nor.c
> index da7cd69d4857..c8399522c69d 100644
> --- a/drivers/mtd/spi-nor/spi-nor.c
> +++ b/drivers/mtd/spi-nor/spi-nor.c
> @@ -55,7 +55,7 @@ struct flash_info {
>  	 * necessarily called a "sector" by the vendor.
>  	 */
>  	unsigned	sector_size;
> -	u16		n_sectors;
> +	unsigned	n_sectors;

Make this u32 then , to make things consistent .

>  	u16		page_size;
>  	u16		addr_width;
> 


-- 
Best regards,
Marek Vasut



More information about the linux-mtd mailing list