sf: Fix NULL pointer exception for flashes without lock methods
commit c3c016cf "sf: Add SPI NOR protection mechanism" introduced flash_lock()/flash_unlock()/flash_is_locked() methods for SPI flash, but not every flash driver supplies these. We should test these methods against NULL before actually calling them. Signed-off-by: NBin Meng <bmeng.cn@gmail.com> Reviewed-by: NFabio Estevam <fabio.estevam@freescale.com> Reviewed-by: NJagan Teki <jteki@openedev.com>
Showing
想要评论请 注册 或 登录