Message ID | 20230130141603.323221-8-luca.ceresoli@bootlin.com |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:eb09:0:0:0:0:0 with SMTP id s9csp2203356wrn; Mon, 30 Jan 2023 06:18:35 -0800 (PST) X-Google-Smtp-Source: AK7set+divDlQ2hV5gHCxnXBT6HbodVURFrTcOrcSB7PuXbmX6uu3PitNhEjt13waOd4A+GmW823 X-Received: by 2002:a17:906:4f04:b0:878:785e:e57a with SMTP id t4-20020a1709064f0400b00878785ee57amr15225525eju.77.1675088315012; Mon, 30 Jan 2023 06:18:35 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1675088314; cv=none; d=google.com; s=arc-20160816; b=mB0Z+toJNld2Cov2tJMwTAXv9M/JEhiGVpo553zfLnmQ4Z7n7TlNXCTWZUczKb4hFA A+Cep8BMqg+RVlnqlezSHrL+KMANJzxrR0WsGoc1Gh61N97gp8P3mGoXzvG94tYMJbp2 rGbxRRuFTV50XU+QFFNh/mXB4mWOqUQ/Oe89cVZp3SNGF8MfPz7sKmp/eR/Jy7iFfHFI U5YnMcLTxJiuN7r6d5lxcvlOCFOsz2QrFQuB/jFo02GvoxpRS9up/6mWtVSh5XxjlPvc UXoBROJMdW6sWZr3n4/EeYBfkF08d86PsG+8uJc9kCs2fs3q/4fqMSfrUZrREoxmcfE3 oEig== 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=zAXv49RalvSHRsuSRJiUnA0e2m7reBYxuqjPTE1WSMui0Cy0tKFCPL5PRN73Y87zER KIOmkABFQdanfw9PutIHea7Ee0dQ4OfsiNYydLYymmkoHSG1azRwX1q4Zgr8MNrMQPfM Jx9y6cAyVctsMaPooBPr945e8kK16w0pMN6sQEl7JPRS7n/ZCNU+DfpDoLnaCyNnZ2QB 4g4L8wvgVhG7cGln4FyiMKJNMeZGx3bsQ8URqyfYAosObFdgNoVDnQwdgHv8Gw6IUMGz dNW6ByHzUpHWiILzfLdNaZgnEGXXzQmnSshCesfQlucDh1JovfR6yRSUYv1hxXMQMZQN r6DA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@bootlin.com header.s=gm1 header.b=aDaXVuVN; 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 kb2-20020a170907924200b007c0e240faf4si11852240ejb.344.2023.01.30.06.18.11; Mon, 30 Jan 2023 06:18:34 -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=aDaXVuVN; 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 S237483AbjA3ORo (ORCPT <rfc822;n2h9z4@gmail.com> + 99 others); Mon, 30 Jan 2023 09:17:44 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33278 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237526AbjA3ORX (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Mon, 30 Jan 2023 09:17:23 -0500 Received: from relay11.mail.gandi.net (relay11.mail.gandi.net [IPv6:2001:4b98:dc4:8::231]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E5FBE3E08A; Mon, 30 Jan 2023 06:16:58 -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 B87C7100013; Mon, 30 Jan 2023 14:16:53 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=gm1; t=1675088217; 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=aDaXVuVN0XqqAwCdPXtn4wgik6Of8vJhSHq201iTMXceavwaGaEYjFZZ5ov1Ee++WSdP01 c1nrczQhZU25rbgrWUCbQEyXEZD019aE7z+kpaSwkDvwr0C97FMEhbIq7xcvV9ePFTBD4N 2+Ie/UdGWvqZbMjqugYAcNcYlmDvqyqzfIRakrat0HPgqHefcfBA9RKiAdfNajHh7rFPgA g4kYEztYgwdL1QgA+duJKDPRcORw/ZIHQwtTuq0VW8/WqKRFV2oKUajViKuciPajgnNXoG E6eroGZxssm4W9Jo/asGasjqhnR9TPNKJZmN0nrQqYV6DIf/YmXmjNJHoivHkw== 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: [PATCH v4 07/21] staging: media: tegra-video: improve error messages Date: Mon, 30 Jan 2023 15:15:49 +0100 Message-Id: <20230130141603.323221-8-luca.ceresoli@bootlin.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230130141603.323221-1-luca.ceresoli@bootlin.com> References: <20230130141603.323221-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,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?1756457405100334169?= X-GMAIL-MSGID: =?utf-8?q?1756457405100334169?= |
Series |
Add Tegra20 parallel video input capture
|
|
Commit Message
Luca Ceresoli
Jan. 30, 2023, 2:15 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)