Message ID | 20230309144320.2937553-9-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 v21csp340584wrd; Thu, 9 Mar 2023 07:06:42 -0800 (PST) X-Google-Smtp-Source: AK7set/xKM5ksDSiVxKHLMsTWRFxN6v0EGtP/JLbvpGsVZjK4DszRrXXTeN17L3vcJfCLDj7soNs X-Received: by 2002:a92:8e0d:0:b0:318:d56e:9efa with SMTP id c13-20020a928e0d000000b00318d56e9efamr1974004ild.24.1678374402472; Thu, 09 Mar 2023 07:06:42 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1678374402; cv=none; d=google.com; s=arc-20160816; b=ufpjasM+V8dR7rjVnNsUSZqaJR16XRmjg0jMPJYO4o0X96yQAFikXAT7BGb8szzeln 09SmQVw9ggVRdtLJ+JJfI1g5kSpSw+5DdBnYnF77H7gpsTDQKHrPcXYUrTh02LJROBaD ODNfns4rwf4p0+FFcLIqjOeUdzH0L7nNRPqqPUJQQH58Cp+wsly7viynnxyv0ffLw925 LWx9ldtkXG8+XpfSFhB7VqdS5PjZdamwNFUJsy2vT1wPGi2VIvYvQ+yMNj8gqkDn8frV cGguew2WTDg5K128xoa88Wrgv0IhVxtiuCAojLYDmI1fSXveh4foiZ6/MQHRaBYTnOm4 fvVw== 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=wDKaDW07jRg6JKv4FccRmW/KLxnvUIW9HGrFo7N25X0=; b=I2eRjBB0fM4DzCKPBP0gdwBrOcDxkImxgPKyXy00yEFbH/wilrK3vF9FiFaymykMA+ Hg/TKvwUFAP8azlSdxE+AfGhq4p4NRQ6SU30njeNkYEUsMxxVkoL6NmfGPi4OsUAloR0 K7zPwooOm0saNob91SNSebkHtIz8ya/lGAMgfA7r7Ur1HG0LdJUnSaiIERyr/e0BlhDd IDPiz6OpGBWIoejio8fCrt+BeSFfin2nu1qn1Sq1GGSIvkHEPncKeecyC11IVxDl9tEM t7WuPWe1BtEd7o4koGu3q2sSczbWUAwk9LcHamPvQbyn5GKwK2BAGFIM1oR3/6kwR2iB C+Cg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@bootlin.com header.s=gm1 header.b=IYV03bgQ; 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 p14-20020a056e0206ce00b0031402bfcb5esi12115734ils.3.2023.03.09.07.06.28; Thu, 09 Mar 2023 07:06:42 -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=IYV03bgQ; 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 S231935AbjCIOoR (ORCPT <rfc822;carlos.wei.hk@gmail.com> + 99 others); Thu, 9 Mar 2023 09:44:17 -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 S231857AbjCIOn4 (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Thu, 9 Mar 2023 09:43:56 -0500 Received: from relay9-d.mail.gandi.net (relay9-d.mail.gandi.net [IPv6:2001:4b98:dc4:8::229]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3E479DBB7F; Thu, 9 Mar 2023 06:43:51 -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 86648FF810; Thu, 9 Mar 2023 14:43:47 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=gm1; t=1678373030; 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=wDKaDW07jRg6JKv4FccRmW/KLxnvUIW9HGrFo7N25X0=; b=IYV03bgQEurBUO/OPg+HK+WEGb/emCGeExOkkFBB27AQWtCJYUk00e0VfecSb1gqvBtzBM Z2dpgp6GXB4827yzcn6D10cZWAastWGmZD7aZR+x+JOHOIHljU81fxVG6QfSvnb+XwC97b EKrH0eXdhSMZFr541wcDo2hR6Z1JgXd0YuC9GyqotRZrlw1jd9fkIryvgRd/nc+wHObZPD 1o4U48bmto72p4fJ88Z4I6XtsT0Mi/w2EA35C6b574mwVm/hQx+bM6vFCuJbHKiC+z3ts/ Mjobgbyj+Ly6FkCvCdrFDjZ6kSLczoiEjS/f89c99Vo32+H97o3G79WuMhryng== 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 08/21] staging: media: tegra-video: slightly simplify cleanup on errors Date: Thu, 9 Mar 2023 15:43:07 +0100 Message-Id: <20230309144320.2937553-9-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,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?1759903117247524380?= X-GMAIL-MSGID: =?utf-8?q?1759903117247524380?= |
Series |
Add Tegra20 parallel video input capture
|
|
Commit Message
Luca Ceresoli
March 9, 2023, 2:43 p.m. UTC
of_node_put(node) does nothing if node == NULL, so it can be moved to the cleanup section at the bottom. 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 | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-)
diff --git a/drivers/staging/media/tegra-video/vi.c b/drivers/staging/media/tegra-video/vi.c index 0e5067a7986a..c2724e1ecafb 100644 --- a/drivers/staging/media/tegra-video/vi.c +++ b/drivers/staging/media/tegra-video/vi.c @@ -1263,7 +1263,7 @@ static int tegra_vi_channels_alloc(struct tegra_vi *vi) struct device_node *node = vi->dev->of_node; struct device_node *ep = NULL; struct device_node *ports; - struct device_node *port; + struct device_node *port = NULL; unsigned int port_num; struct device_node *parent; struct v4l2_fwnode_endpoint v4l2_ep = { .bus_type = 0 }; @@ -1286,7 +1286,6 @@ static int tegra_vi_channels_alloc(struct tegra_vi *vi) dev_err(vi->dev, "invalid port num %d for %pOF\n", port_num, port); ret = -EINVAL; - of_node_put(port); goto cleanup; } @@ -1309,13 +1308,12 @@ static int tegra_vi_channels_alloc(struct tegra_vi *vi) lanes = v4l2_ep.bus.mipi_csi2.num_data_lanes; ret = tegra_vi_channel_alloc(vi, port_num, port, lanes); - if (ret < 0) { - of_node_put(port); + if (ret < 0) goto cleanup; - } } cleanup: + of_node_put(port); of_node_put(ports); return ret; }