All of lore.kernel.org
 help / color / mirror / Atom feed
* mtd-utils: Proper way to handle erasize=0
@ 2021-07-19 19:12 Fabio Estevam
  2021-07-19 19:36 ` Richard Weinberger
  0 siblings, 1 reply; 4+ messages in thread
From: Fabio Estevam @ 2021-07-19 19:12 UTC (permalink / raw)
  To: david.oberhollenzer, Richard Weinberger
  Cc: linux-mtd, Miquel Raynal, Marek Vasut, Heiko Schocher

Hi,

When using a Microchip 48l640 SRAM (drivers/mtd/devices/mchp48l640.c)
the reported erasesize is 0:

# cat /proc/mtd
dev:    size   erasesize  name
mtd0: 00002000 00000000 "spi0.0"

This causes a division by zero at libmtd.c, as mtd_get_dev_info1() has:

mtd->eb_cnt = mtd->size / mtd->eb_size;

What would be the appropriate way to fix this?

Thanks,

Fabio Estevam

______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2021-07-19 22:34 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-07-19 19:12 mtd-utils: Proper way to handle erasize=0 Fabio Estevam
2021-07-19 19:36 ` Richard Weinberger
2021-07-19 22:20   ` Fabio Estevam
2021-07-19 22:33     ` Richard Weinberger

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.