From patchwork Mon Dec 11 12:59:45 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Umang Jain X-Patchwork-Id: 176698 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:bcd1:0:b0:403:3b70:6f57 with SMTP id r17csp7026750vqy; Mon, 11 Dec 2023 05:00:51 -0800 (PST) X-Google-Smtp-Source: AGHT+IEw3i3ywLQeQywBO735KxHPxtuVHFELvfGtk28uNn771yJaKk+WvP1R9v5ZRqQLRyzz8YTk X-Received: by 2002:a17:902:8301:b0:1d0:bcb2:4b8a with SMTP id bd1-20020a170902830100b001d0bcb24b8amr1518409plb.131.1702299650833; Mon, 11 Dec 2023 05:00:50 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1702299650; cv=none; d=google.com; s=arc-20160816; b=0rE5kriO7enwCxu8Lp5p0ZE9hvKnxIQUOKGV7iOQf754OqKHAYfd7FeoBr0COCtY5c WMG5y+MQUIRML2GyFfq1OkRJBEGwW752eyYO6IbN30gmcVFTG3rXpGVKIuiDnUBcrB36 HNI+gIJ8cHRFRlEXQZ+LxiBHzFp06DQHBzESm7zvoN9lxC0mG8mSxvPOeEPKYq3+RK7m k/7EHGfsRDiXwPHUapjm5LexUSKVqfGIVKf4qs/yK0spR3US2hmnwcyW6FwC7JaQXI8M IZwq3sjMA1/sIxQ6gMjWU5fj7e/igNQVgVL0RKScToPi+cQ7Z42lWuJ/VRMVtry+wvee U7Fg== 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=Xei5QZR7EI9E2ALHhuyyu7xvQSP/1ScbuB7sw/eepHw=; fh=5WFlYumxFb4YMTIyFXnieMfGzo3YjRfO3j2f2Wqiw4A=; b=kZXeY0Sfc/p334ncb31WxIOB5EWNWh7+wYxgMTxoTKOmynSWJV/PjsUdU0rkJYtyjd k4A+pQyFzpYGAUISYgua+V3i8YquH/u0JovPvOgWgJFYOrE3vqySofc39d+nFzDGINb/ vkX6PwauDZFJoltstNYWzmDkKesBp2nYmYeiq88ce3NvPh9DXj7GJmiId0KZes6y8VAt 41856r5GNe1Y8OzNVcTK27e9SsyoQXe0KUizmaQbUrqz4Nn0H72Lpnl/qh2uH25Re87B OljMOeenXlgTh8WXqvfSGBUdsNCG4SMrCvIfU3G9Oqpi2chhkhdI36FezuHq5xddjM8C FQdg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass (test mode) header.i=@ideasonboard.com header.s=mail header.b=SxighCXQ; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.38 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from fry.vger.email (fry.vger.email. [23.128.96.38]) by mx.google.com with ESMTPS id e9-20020a17090301c900b001cfaeeb91a3si6047004plh.474.2023.12.11.05.00.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 11 Dec 2023 05:00:50 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.38 as permitted sender) client-ip=23.128.96.38; Authentication-Results: mx.google.com; dkim=pass (test mode) header.i=@ideasonboard.com header.s=mail header.b=SxighCXQ; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.38 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 fry.vger.email (Postfix) with ESMTP id 89D0D8096463; Mon, 11 Dec 2023 05:00:32 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at fry.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234880AbjLKNAS (ORCPT + 99 others); Mon, 11 Dec 2023 08:00:18 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50510 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1343569AbjLKNAK (ORCPT ); Mon, 11 Dec 2023 08:00:10 -0500 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 8E522C3; Mon, 11 Dec 2023 05:00:16 -0800 (PST) Received: from umang.jain (unknown [103.251.226.68]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id 1D33F1515; Mon, 11 Dec 2023 13:59:28 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1702299571; bh=nrEAdhHZwA2L0AvxJ6FGfgqEfXwThQSUE+QCVNTuuhs=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=SxighCXQ1l/fbMew3D4DHzVOHOVrQheuTYk5MLyvbcd2T0B/Py5iVrOursO8VWZTi KIzyYBkzkKkq3Vy8srl0yz3FvAoa0SOAdvNoId6iqSfHP222DugtUir/2acfy5m+lZ 0pO4DSI9apyNgWDWuhfW0fnqyZ152HnpUmbr0GWU= From: Umang Jain To: devicetree@vger.kernel.org, linux-media@vger.kernel.org Cc: "Paul J . Murphy" , Daniele Alessandrelli , Sakari Ailus , Mauro Carvalho Chehab , Kieran Bingham , Umang Jain , linux-kernel@vger.kernel.org (open list) Subject: [PATCH v4 3/7] media: i2c: imx335: Improve configuration error reporting Date: Mon, 11 Dec 2023 18:29:45 +0530 Message-ID: <20231211125950.108092-4-umang.jain@ideasonboard.com> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20231211125950.108092-1-umang.jain@ideasonboard.com> References: <20231211125950.108092-1-umang.jain@ideasonboard.com> MIME-Version: 1.0 X-Spam-Status: No, score=-0.9 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on fry.vger.email 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 (fry.vger.email [0.0.0.0]); Mon, 11 Dec 2023 05:00:33 -0800 (PST) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1784990558416326970 X-GMAIL-MSGID: 1784990558416326970 From: Kieran Bingham 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 --- 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: