Thread (13 messages) 13 messages, 2 authors, 2018-03-06
STALE3020d

[PATCH 4/7] media: sun6i: Don't emit a warning when the configured format isn't found

From: Maxime Ripard <hidden>
Date: 2018-03-05 09:35:50
Also in: linux-media
Subsystem: allwinner a31 csi driver, media input infrastructure (v4l/dvb), the rest · Maintainers: Yong Deng, Paul Kocialkowski, Mauro Carvalho Chehab, Linus Torvalds

Currently the driver will call WARN when a format isn't available,
resulting in a kernel backtrace in our logs. This makes it look much more
serious than it should be.

Replace the call to the WARN macro to a dev_warn, which will still allow us
to log what happened without making it too dramatic.

Signed-off-by: Maxime Ripard <redacted>
---
 drivers/media/platform/sunxi/sun6i-csi/sun6i_csi.c | 11 +++++++----
 1 file changed, 7 insertions(+), 4 deletions(-)
diff --git a/drivers/media/platform/sunxi/sun6i-csi/sun6i_csi.c b/drivers/media/platform/sunxi/sun6i-csi/sun6i_csi.c
index f10c3bc2a6c5..9a25aad8b6b1 100644
--- a/drivers/media/platform/sunxi/sun6i-csi/sun6i_csi.c
+++ b/drivers/media/platform/sunxi/sun6i-csi/sun6i_csi.c
@@ -299,7 +299,7 @@ static enum csi_output_fmt get_csi_output_format(struct sun6i_csi_dev *sdev,
 		return buf_interlaced ? CSI_FRAME_PLANAR_YUV422 :
 					CSI_FIELD_PLANAR_YUV422;
 	default:
-		WARN(1, "Unsupported pixformat: 0x%x\n", pixformat);
+		dev_warn(sdev->dev, "Unsupported pixformat: 0x%x\n", pixformat);
 		break;
 	}
 
@@ -330,7 +330,8 @@ static enum csi_input_seq get_csi_input_seq(struct sun6i_csi_dev *sdev,
 		case MEDIA_BUS_FMT_YVYU8_2X8:
 			return CSI_INPUT_SEQ_YVYU;
 		default:
-			WARN(1, "Unsupported mbus code: 0x%x\n", mbus_code);
+			dev_warn(sdev->dev, "Unsupported mbus code: 0x%x\n",
+				 mbus_code);
 			break;
 		}
 		break;
@@ -351,12 +352,14 @@ static enum csi_input_seq get_csi_input_seq(struct sun6i_csi_dev *sdev,
 		case MEDIA_BUS_FMT_YVYU8_2X8:
 			return CSI_INPUT_SEQ_YUYV;
 		default:
-			WARN(1, "Unsupported mbus code: 0x%x\n", mbus_code);
+			dev_warn(sdev->dev, "Unsupported mbus code: 0x%x\n",
+				 mbus_code);
 			break;
 		}
 		break;
 	default:
-		WARN(1, "Unsupported pixformat: 0x%x\n", pixformat);
+		dev_warn(sdev->dev, "Unsupported pixformat: 0x%x, defaulting to YUYV\n",
+			 pixformat);
 		break;
 	}
 
-- 
2.14.3
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help