From patchwork Wed Nov 1 13:13:51 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kieran Bingham X-Patchwork-Id: 160541 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:abcd:0:b0:403:3b70:6f57 with SMTP id f13csp408713vqx; Wed, 1 Nov 2023 06:14:28 -0700 (PDT) X-Google-Smtp-Source: AGHT+IG67/zw4FfPq5816gxlRjAyPa4ZCPJsJSyo05zkirpkhaa2ZRupHk0tFvqEUS8xzIYPCegk X-Received: by 2002:a05:6a20:3d0b:b0:16b:79c2:7d6e with SMTP id y11-20020a056a203d0b00b0016b79c27d6emr15691847pzi.30.1698844468425; Wed, 01 Nov 2023 06:14:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1698844468; cv=none; d=google.com; s=arc-20160816; b=Hx2dWxY41Knpm5Ie1EfAZoABwlCNb0LGjU+VzdF2/OhlPTbFu5YG2KN3kNpBpEpa6P H/I5XsSFbfjbrAHg3ILcnAsERHIFm0+v7fHpm/a9R8aMY9CGxvz5K525fCWkK/6qXTUb gWSfmvcPsx/29ZlkowSNfh0EY9Xouxh5c62kevkLRgJsNqT42Doet8OLSp/iCJQeC/tl m131ghPqBJy5gxyWj/HUaSVB/cnNcKD3mCs3RE+MJBjJhzHRE2AVSeQVvB9WaydMecWr AKBP43fmuREZiJ6EAF0pTZET2YxjhsbBFBB0Z+47Bu80l7YK2qIIrrguoqheag0/eIrU F6NA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=IuuDjy2pmUZk2Ukm2/UmxOOb+HQE3/PmtWEZLUghAXM=; fh=L7bdhVUSRGewbZGUqR4L3H+66lE0SlV2odlkQU7WUEM=; b=vBtG12AGUrJlsXSYJGzhR1e05hhePhAujQkUygFvgEaYVBp5EkW2qN61OfCt/2wsPO iV+trx+tIFldguwduKQLGcJPywhnBpWr440G1SSdljgoEmQzeO91VKmSa6hM1A6JqxA9 AiEGTGpZxWJOPRhZxI8q8Ko6qh59nl1bN6KRAKPM1yM7Yr9xhjn6hMXETAc5mTE5PVrt r+n/3+13kyfvLgyGt5svmGuQb+gaUspKTfOCRvkSv1xuSkzkxIsM/JrZ6j//1iKFotgJ rMePzs4Wq1fdbTjgBAj0xX0YoIah4QEe5SHN5tDv55CzFCScI1mLgdXY4CWcKK8PCWn+ 4tcA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass (test mode) header.i=@ideasonboard.com header.s=mail header.b=HSM+abDc; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from snail.vger.email (snail.vger.email. [2620:137:e000::3:7]) by mx.google.com with ESMTPS id bo7-20020a17090b090700b00278f5fad9b6si810001pjb.139.2023.11.01.06.14.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 01 Nov 2023 06:14:28 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) client-ip=2620:137:e000::3:7; Authentication-Results: mx.google.com; dkim=pass (test mode) header.i=@ideasonboard.com header.s=mail header.b=HSM+abDc; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by snail.vger.email (Postfix) with ESMTP id 520E5801B9FF; Wed, 1 Nov 2023 06:14:23 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at snail.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1344051AbjKANOR (ORCPT + 35 others); Wed, 1 Nov 2023 09:14:17 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54160 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1343851AbjKANON (ORCPT ); Wed, 1 Nov 2023 09:14:13 -0400 Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [IPv6:2001:4b98:dc2:55:216:3eff:fef7:d647]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7C2FFF4; Wed, 1 Nov 2023 06:14:07 -0700 (PDT) Received: from Monstersaurus.local (aztw-30-b2-v4wan-166917-cust845.vm26.cable.virginm.net [82.37.23.78]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id 1AF14E52; Wed, 1 Nov 2023 14:13:44 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1698844424; bh=cqUYU2q4hDhZpxo1Fi1Ix4DPuhuP0paFGsY1V5zSNXY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=HSM+abDc4nh4X1w6CkN20KztnDROtn/zTk28cdU2ACq5iJhBOF9BDE5xnWJpaCI6O 7cbMhav8/xZw6XUmxLt7GHeMCjSTRjKbWIf4o6RASH/JEdejrN9Avjj3UZRkGqmE+w f38jTHAVGLWJDqUqEpiB9qmZEB/YEJe1JlPhljdE= From: Kieran Bingham To: devicetree@vger.kernel.org, linux-media@vger.kernel.org Cc: Kieran Bingham , Umang Jain , "Paul J. Murphy" , Daniele Alessandrelli , Sakari Ailus , Mauro Carvalho Chehab , linux-kernel@vger.kernel.org (open list) Subject: [PATCH v2 3/6] media: i2c: imx335: Improve configuration error reporting Date: Wed, 1 Nov 2023 13:13:51 +0000 Message-Id: <20231101131354.2333498-4-kieran.bingham@ideasonboard.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20231101131354.2333498-1-kieran.bingham@ideasonboard.com> References: <20231101131354.2333498-1-kieran.bingham@ideasonboard.com> MIME-Version: 1.0 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_BLOCKED, SPF_HELO_PASS,SPF_PASS,T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (snail.vger.email [0.0.0.0]); Wed, 01 Nov 2023 06:14:23 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1781367537271901754 X-GMAIL-MSGID: 1781367537271901754 The existing imx335_parse_hw_config function has two paths that can be taken without reporting to the user the reason for failing to accept the hardware configuration. Extend the error reporting paths to identify failures when probing the device. Reviewed-by: Umang Jain Signed-off-by: Kieran Bingham --- v2: - Fix line endings Signed-off-by: Kieran Bingham --- drivers/media/i2c/imx335.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/drivers/media/i2c/imx335.c b/drivers/media/i2c/imx335.c index cbabef968e21..31c612c6bdd8 100644 --- a/drivers/media/i2c/imx335.c +++ b/drivers/media/i2c/imx335.c @@ -795,8 +795,10 @@ static int imx335_parse_hw_config(struct imx335 *imx335) } ep = fwnode_graph_get_next_endpoint(fwnode, NULL); - if (!ep) + if (!ep) { + dev_err(imx335->dev, "Failed to get next endpoint\n"); return -ENXIO; + } ret = v4l2_fwnode_endpoint_alloc_parse(ep, &bus_cfg); fwnode_handle_put(ep); @@ -821,6 +823,8 @@ static int imx335_parse_hw_config(struct imx335 *imx335) if (bus_cfg.link_frequencies[i] == IMX335_LINK_FREQ) goto done_endpoint_free; + dev_err(imx335->dev, "no compatible link frequencies found\n"); + ret = -EINVAL; done_endpoint_free: