[PATCH] mtd: nand: print erase size on init

Ezequiel Garcia ezequiel at vanguardiasur.com.ar
Wed Oct 22 15:48:44 PDT 2014



On 10/20/2014 07:01 PM, Rafał Miłecki wrote:
> It may be useful info, e.g. if someone wants to use ubinize.
> 
> Signed-off-by: Rafał Miłecki <zajec5 at gmail.com>
> ---
>  drivers/mtd/nand/nand_base.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/mtd/nand/nand_base.c b/drivers/mtd/nand/nand_base.c
> index 5b5c627..5e9ffbe 100644
> --- a/drivers/mtd/nand/nand_base.c
> +++ b/drivers/mtd/nand/nand_base.c
> @@ -3765,9 +3765,9 @@ ident_done:
>  		pr_info("%s %s\n", nand_manuf_ids[maf_idx].name,
>  				type->name);
>  
> -	pr_info("%dMiB, %s, page size: %d, OOB size: %d\n",
> +	pr_info("%d MiB, %s, erase size: %d KiB, page size: %d, OOB size: %d\n",
>  		(int)(chip->chipsize >> 20), nand_is_slc(chip) ? "SLC" : "MLC",
> -		mtd->writesize, mtd->oobsize);
> +		mtd->erasesize >> 10, mtd->writesize, mtd->oobsize);
>  	return type;
>  }
>  
> 

Hm, this line is already way too long! I'd say we should try to make it
shorter, instead of longer.

Moreover, you have a /proc and a /sysfs interface to retrieve the erasesize:

What's wrong with using any of the currently available interfaces:

$ cat /sys/class/mtd/mtd0/erasesize 
131072

$ cat /proc/mtd | grep mtd0 | awk '{print $3}'
00020000

Any reason why you want the info in the kernel log?
-- 
Ezequiel Garcia, VanguardiaSur
www.vanguardiasur.com.ar

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: OpenPGP digital signature
URL: <http://lists.infradead.org/pipermail/linux-mtd/attachments/20141022/1cbd5b98/attachment.sig>


More information about the linux-mtd mailing list