From patchwork Fri Dec 8 15:07:49 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Umang Jain X-Patchwork-Id: 175851 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:bcd1:0:b0:403:3b70:6f57 with SMTP id r17csp5516437vqy; Fri, 8 Dec 2023 07:08:41 -0800 (PST) X-Google-Smtp-Source: AGHT+IEyEZiMKiT5XggeCFa5U37F0i3qoaseQzLliWwAAF3mvlhMykex7/vAALENcnwbAVRvWBCM X-Received: by 2002:a17:903:2450:b0:1d0:7407:3557 with SMTP id l16-20020a170903245000b001d074073557mr136204pls.15.1702048120677; Fri, 08 Dec 2023 07:08:40 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1702048120; cv=none; d=google.com; s=arc-20160816; b=Q8bFnC+T4lJODNp+bo5fzsmjke3UweYJjoiVAGs2cGyWA5Ie5/Dby+uCw4lXde3fiR XextXWWu0tmGxQK5EQ15o0bqwjCrwVwygMzcIVFM5CJfeH85XEfn85ARLDL9xN0NU3na mfKyPSkvemKE2xmGU3QA7yiVfo4tObMdJnWRJ9Lv5nDQ1Vnb826cEsua9hSsalCRDhRM q6C0hJEsD8BslOzsylu6zEoEvYyLYjWrDlhxKjHjhXhniwAbnm+GRMylsRnsUA84SiHq qOiivXS7MqBF5ELKd5lJUR0X8VY+MoavPHNwy1Ui7dwY8ikkVv7c4Itxht9ZRGvCp0Pb yJIA== 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=EAprePEgNJbNhSs5bZfgR0O4F1nlHY3lQP0lv1SUBSLbZYRXGL1M4tvLqdFdx/seL+ tXrz3urgi4vZ/+jVdIOXE5WwNyLlN/cpMoF/04wQIRXxVgaZJ9nXY1hUzq+BQGYTaw2K vWPOAADW+XMNlutbK6ai4mcDaBlp+H204ELhlc6KBWpBWzfC8h96HQU2lWKXN+VP4dQY K+5ifahgpX0lA8Ktfxo+CBV92wycUtrn2kzEOyT3OfPSrnmKqDLRkpUyIUBYSrSYhA3L 14onPM+JOWkTru++2AxbjALNB6YduOYgqY1pAjYDRjVd7exGGtOplQTtIoeqjO79BZM3 Yn4w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass (test mode) header.i=@ideasonboard.com header.s=mail header.b=gAuvzIPL; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.31 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from morse.vger.email (morse.vger.email. [23.128.96.31]) by mx.google.com with ESMTPS id s13-20020a170902a50d00b001bf1005924csi1662371plq.321.2023.12.08.07.08.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 08 Dec 2023 07:08:40 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.31 as permitted sender) client-ip=23.128.96.31; Authentication-Results: mx.google.com; dkim=pass (test mode) header.i=@ideasonboard.com header.s=mail header.b=gAuvzIPL; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.31 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 morse.vger.email (Postfix) with ESMTP id 61AC2837BE53; Fri, 8 Dec 2023 07:08:38 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at morse.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1574187AbjLHPIK (ORCPT + 99 others); Fri, 8 Dec 2023 10:08:10 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51016 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1574160AbjLHPIG (ORCPT ); Fri, 8 Dec 2023 10:08:06 -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 732FB122; Fri, 8 Dec 2023 07:08:12 -0800 (PST) Received: from umang.jain (unknown [103.251.226.108]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id B5801EBA; Fri, 8 Dec 2023 16:07:27 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1702048049; bh=nrEAdhHZwA2L0AvxJ6FGfgqEfXwThQSUE+QCVNTuuhs=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=gAuvzIPLzZbXJAQOVLdFaCDYd4M7E8B4M6iDC4DeTXNdPI1Mc+WFc8omlFcUDmeeJ tuvNgP8E5C3mjtX+vsWmKDvyeLDlRNgHMXfzonSj+Zgw/A+PqS3K7h9oV6LV01NEDb YZaGhlOkwcvLOpu60KBkOgFrLjqmZtzQw+y4W6zc= 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 v3 3/8] media: i2c: imx335: Improve configuration error reporting Date: Fri, 8 Dec 2023 20:37:49 +0530 Message-ID: <20231208150756.124720-4-umang.jain@ideasonboard.com> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20231208150756.124720-1-umang.jain@ideasonboard.com> References: <20231208150756.124720-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 morse.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 (morse.vger.email [0.0.0.0]); Fri, 08 Dec 2023 07:08:38 -0800 (PST) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1784726810059692144 X-GMAIL-MSGID: 1784726810059692144 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: