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: NBoris Brezillon <boris.brezillon@bootlin.com> Tested-by: NHeiko Schocher <hs@denx.de> Reviewed-by: NJagan Teki <jagan@openedev.com>
Showing
想要评论请 注册 或 登录