Commit 44e2aa2b authored by Cyril Bur's avatar Cyril Bur Committed by Michael Ellerman

mtd: powernv_flash: Use WARN_ON_ONCE() rather than BUG_ON()

BUG_ON() should be reserved in situations where we can not longer
guarantee the integrity of the system. In the case where
powernv_flash_async_op() receives an impossible op, we can still
guarantee the integrity of the system.
Signed-off-by: default avatarCyril Bur <cyrilbur@gmail.com>
Acked-by: default avatarBoris Brezillon <boris.brezillon@free-electrons.com>
Signed-off-by: default avatarMichael Ellerman <mpe@ellerman.id.au>
parent 71e24d77
......@@ -78,7 +78,9 @@ static int powernv_flash_async_op(struct mtd_info *mtd, enum flash_op op,
rc = opal_flash_erase(info->id, offset, len, token);
break;
default:
BUG_ON(1);
WARN_ON_ONCE(1);
opal_async_release_token(token);
return -EIO;
}
if (rc != OPAL_ASYNC_COMPLETION) {
......
Markdown is supported
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