Message ID | 20230309144320.2937553-8-luca.ceresoli@bootlin.com |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:5915:0:0:0:0:0 with SMTP id v21csp340761wrd; Thu, 9 Mar 2023 07:06:56 -0800 (PST) X-Google-Smtp-Source: AK7set++lr0vKy/ZO6ahHx/lfgVz3ghMVHYE7ok/SxTP62gvoJjzxTL4+jwHBbG4qYWx5MvVJyaX X-Received: by 2002:a05:6e02:1686:b0:318:8674:bf3 with SMTP id f6-20020a056e02168600b0031886740bf3mr18959659ila.19.1678374416734; Thu, 09 Mar 2023 07:06:56 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1678374416; cv=none; d=google.com; s=arc-20160816; b=Mt1UWcI8cidiwahd0E8JOgIJTHhgE0xDgKk0ZqpqfIpU7AmDpOHKV3L2WIhDQ6LyE5 hgbnzqiA9yDqTiWozSxUUd8PJv77H6VerDTE9LlSAQ0tcErX7zA4E6JGJY3US2wDg7Fo hFtRrkm0UpenzXsgijjryCdp5EFBVRLJTF5LcU7u1egc5wBMOuUjrkfCseAcrDDGSE2F RfMcNTtXZirhwE7WLX/cycFTIdjl/WT49tb+CADcV0v6+oUz0P9l3sXpcJTl+ndHctf5 NV4GJAcfFTNTxf+/I5gO2IisgVzTJkwK1EOYm3oCGrXjdaR5zJb/5tY3QrWd8ianHADH 5qRA== 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=451TUx22H90CFmnHFXlFDNWmX76XdwcrQAhLbpfaKUw=; b=twAoXo4lZCW7hfA3gckiUflRhwjhVmHIvnlUkkFcD3pgeePbnU3tNFjMCtBo6ovOYm b7ZbDM9aLyym9wpoSvj0oubUDZ5B0Jl1TuPjtGuD+40yoGXKS0l7YGvOkUJyAWOzOWk4 RJnsU1fkK/Y4m0qK6b2EVwPrV7idz3BwTOEqx3VhGSc1g+tcLCrD7iWWdpgevhw+NWoY q77FjlJBXnM9dvWqXwugmDAF6pW897UX+6dxl2AlPF3SWyzojEFsoB17GzS0kTlFwiMz MN7ZA81rB6XaPS/GdxfRExCFO4LL8NFiP/i4Iq0WvIT0PPzZ4XL7jCDoTgD5RLsU364B LMMw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@bootlin.com header.s=gm1 header.b=mq7+KrTV; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=bootlin.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id k11-20020a056e0205ab00b002ffbdf63f5asi17450072ils.165.2023.03.09.07.06.39; Thu, 09 Mar 2023 07:06:56 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@bootlin.com header.s=gm1 header.b=mq7+KrTV; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=bootlin.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231922AbjCIOoM (ORCPT <rfc822;carlos.wei.hk@gmail.com> + 99 others); Thu, 9 Mar 2023 09:44:12 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50320 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231799AbjCIOnu (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Thu, 9 Mar 2023 09:43:50 -0500 Received: from relay9-d.mail.gandi.net (relay9-d.mail.gandi.net [217.70.183.199]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7338B9CBCF; Thu, 9 Mar 2023 06:43:48 -0800 (PST) Received: from booty.fritz.box (unknown [77.244.183.192]) (Authenticated sender: luca.ceresoli@bootlin.com) by mail.gandi.net (Postfix) with ESMTPA id A2EADFF80E; Thu, 9 Mar 2023 14:43:44 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=gm1; t=1678373027; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=451TUx22H90CFmnHFXlFDNWmX76XdwcrQAhLbpfaKUw=; b=mq7+KrTVPw6s95NSvdNILqbdbuExDhvq2IrgGbVPAZe+Cn1ZUhHwsMX9UP/lO0wwOce5M3 G/6KyxfULvjL12il1akQ8amMHmb3BNsR2+fVLKJDd3hfjYx+S5N3C3pSZN4RcvoWEUulkQ qKejO8ictNddYclgwQylD42APTe9gx4lZ8iWhIJ+pvGjrJwXZAaBlU+tuz7e2PhDpPTYfL lQnftjmaL0CYD3tCOoFzfQtj5KvvsfsGrRihHK/BWLtIugjH6FWPTHiJGAjLE9nuzVNAkS CVqH5K+s9nLNLHUkWoI0xi6TvwX8PIhr+LWDJm+6D7OJIk/iTPbeClJC+WBhHg== From: Luca Ceresoli <luca.ceresoli@bootlin.com> To: Thierry Reding <thierry.reding@gmail.com>, Jonathan Hunter <jonathanh@nvidia.com>, Sowjanya Komatineni <skomatineni@nvidia.com>, David Airlie <airlied@gmail.com>, Daniel Vetter <daniel@ffwll.ch>, Rob Herring <robh+dt@kernel.org>, Krzysztof Kozlowski <krzysztof.kozlowski+dt@linaro.org>, Mauro Carvalho Chehab <mchehab@kernel.org>, Greg Kroah-Hartman <gregkh@linuxfoundation.org>, Dmitry Osipenko <digetx@gmail.com>, Hans Verkuil <hverkuil-cisco@xs4all.nl> Cc: Luca Ceresoli <luca.ceresoli@bootlin.com>, linux-media@vger.kernel.org, linux-tegra@vger.kernel.org, dri-devel@lists.freedesktop.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-staging@lists.linux.dev, Thomas Petazzoni <thomas.petazzoni@bootlin.com>, Paul Kocialkowski <paul.kocialkowski@bootlin.com>, Richard Leitner <richard.leitner@skidata.com> Subject: [RESEND PATCH v4 07/21] staging: media: tegra-video: improve error messages Date: Thu, 9 Mar 2023 15:43:06 +0100 Message-Id: <20230309144320.2937553-8-luca.ceresoli@bootlin.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230309144320.2937553-1-luca.ceresoli@bootlin.com> References: <20230309144320.2937553-1-luca.ceresoli@bootlin.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_PASS 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: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1759903132076994524?= X-GMAIL-MSGID: =?utf-8?q?1759903132076994524?= |
Series |
Add Tegra20 parallel video input capture
|
|
Commit Message
Luca Ceresoli
March 9, 2023, 2:43 p.m. UTC
tegra_vi_channels_alloc() can primarily fail for two reasons: 1. "ports" node not found 2. port_num > vi->soc->vi_max_channels Case 1 prints nothing, case 2 has a dev_err(). The caller [tegra_vi_init()] has a generic dev_err() on any failure. This mean that in case 2 we print two messages, and in case 1 we only print a generic message. Remove the generic message and add a specific message when case 1 happens, so that we always have one specific message without even increasing the number of dev_dbg*() calls. Signed-off-by: Luca Ceresoli <luca.ceresoli@bootlin.com> Reviewed-by: Dmitry Osipenko <digetx@gmail.com> --- Changed in v4: - Added review tags No changes in v3 No changes in v2 --- drivers/staging/media/tegra-video/vi.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-)
diff --git a/drivers/staging/media/tegra-video/vi.c b/drivers/staging/media/tegra-video/vi.c index ae7adf640e76..0e5067a7986a 100644 --- a/drivers/staging/media/tegra-video/vi.c +++ b/drivers/staging/media/tegra-video/vi.c @@ -1272,7 +1272,7 @@ static int tegra_vi_channels_alloc(struct tegra_vi *vi) ports = of_get_child_by_name(node, "ports"); if (!ports) - return -ENODEV; + return dev_err_probe(vi->dev, -ENODEV, "%pOF: missing 'ports' node\n", node); for_each_child_of_node(ports, port) { if (!of_node_name_eq(port, "port")) @@ -1824,11 +1824,8 @@ static int tegra_vi_init(struct host1x_client *client) ret = tegra_vi_tpg_channels_alloc(vi); else ret = tegra_vi_channels_alloc(vi); - if (ret < 0) { - dev_err(vi->dev, - "failed to allocate vi channels: %d\n", ret); + if (ret < 0) goto free_chans; - } ret = tegra_vi_channels_init(vi); if (ret < 0)