Skip to content
Commit 492151b2 authored by Boris Brezillon's avatar Boris Brezillon Committed by Jagan Teki
Browse files

mtd: sf: Make sure we don't register the same device twice

spi_flash_mtd_register() can be called several times and each time it
will register the same mtd_info instance like if it was a new one.
The MTD ID allocation gets crazy when that happens, so let's track the
status of the sf_mtd_info object to avoid that.

Fixes: 9fe6d871

 ("mtd, spi: Add MTD layer driver")
Signed-off-by: default avatarBoris Brezillon <boris.brezillon@bootlin.com>
Tested-by: default avatarHeiko Schocher <hs@denx.de>
Reviewed-by: default avatarJagan Teki <jagan@openedev.com>
parent a02820fc
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment