From patchwork Mon Mar 5 09:35:31 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Maxime Ripard X-Patchwork-Id: 10258471 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 9AB9B60365 for ; Mon, 5 Mar 2018 09:35:57 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 8A0B7289AF for ; Mon, 5 Mar 2018 09:35:57 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 7E78C2899E; Mon, 5 Mar 2018 09:35:57 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 074702899E for ; Mon, 5 Mar 2018 09:35:57 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933725AbeCEJfz (ORCPT ); Mon, 5 Mar 2018 04:35:55 -0500 Received: from mail.bootlin.com ([62.4.15.54]:49561 "EHLO mail.bootlin.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933713AbeCEJfu (ORCPT ); Mon, 5 Mar 2018 04:35:50 -0500 Received: by mail.bootlin.com (Postfix, from userid 110) id 14512207D4; Mon, 5 Mar 2018 10:35:48 +0100 (CET) Received: from localhost (LStLambert-657-1-97-87.w90-63.abo.wanadoo.fr [90.63.216.87]) by mail.bootlin.com (Postfix) with ESMTPSA id B8916207E9; Mon, 5 Mar 2018 10:35:37 +0100 (CET) From: Maxime Ripard To: Yong Deng Cc: Mauro Carvalho Chehab , Chen-Yu Tsai , Maxime Ripard , Hans Verkuil , Sakari Ailus , linux-media@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Thomas Petazzoni , Mylene Josserand Subject: [PATCH 4/7] media: sun6i: Don't emit a warning when the configured format isn't found Date: Mon, 5 Mar 2018 10:35:31 +0100 Message-Id: <20180305093535.11801-5-maxime.ripard@bootlin.com> X-Mailer: git-send-email 2.14.3 In-Reply-To: <20180305093535.11801-1-maxime.ripard@bootlin.com> References: <1519697113-32202-1-git-send-email-yong.deng@magewell.com> <20180305093535.11801-1-maxime.ripard@bootlin.com> Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 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 --- 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; }