No need for BUG_ON, WARN_ON is a lot friendlier.
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
struct av7110 *av7110;
/* pointer casting paranoia... */
- BUG_ON(!demux);
+ if (WARN_ON(!demux))
+ return -EIO;
dvbdemux = demux->priv;
- BUG_ON(!dvbdemux);
+ if (WARN_ON(!dvbdemux))
+ return -EIO;
av7110 = dvbdemux->priv;
dprintk(4, "%p\n", av7110);
if (av7110->bmp_state == BMP_LOADING) {
/* possible if syscall is repeated by -ERESTARTSYS and if firmware cannot abort */
- BUG_ON (FW_VERSION(av7110->arm_app) >= 0x261e);
+ if (WARN_ON(FW_VERSION(av7110->arm_app) >= 0x261e))
+ return -EIO;
rc = WaitUntilBmpLoaded(av7110);
if (rc)
return rc;