From patchwork Fri Mar 1 10:20:26 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Markus Elfring X-Patchwork-Id: 777283 Received: from mout.web.de (mout.web.de [212.227.15.14]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id E44CE6A8B2; Fri, 1 Mar 2024 10:20:47 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=212.227.15.14 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709288450; cv=none; b=E+ZF9hn+escPVv4flC2D1ey/OlxB5U4WxN8c4/jsOSjLCyG2CisOswIUfw/YtyLBPxrWjTCZ8So5dG2GHzxhhO0pbanddAZBwML8vFoWQbrrSvCKAf0J+kzDDtOeLFdpN63JR4W7MoUtOddDK+1wn1SMRO44YqqxSl8gmFIodls= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709288450; c=relaxed/simple; bh=XnJJ/DuVyMNtN8i32SvT66PU+gRXPYlBC+UZSbXhbd8=; h=Message-ID:Date:MIME-Version:To:Cc:From:Subject:Content-Type; b=g8QMmfTmeZGwv6/kBj7UZa5EBXvvvAkyaSz7vLMgzUUBBkkNmNdPxg70Kny/wl7lHy0gqCH4IuU/LhXa4geSb9aTHF/8b+RLHvUOn4eOgLB9e8xma9YwwGDXhl/EaduGhq5GgWXso5gqd1sMhQWo6CC7kvNyEGRKPTv3XSGHEiY= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=web.de; spf=pass smtp.mailfrom=web.de; dkim=pass (2048-bit key) header.d=web.de header.i=markus.elfring@web.de header.b=gQL08X9N; arc=none smtp.client-ip=212.227.15.14 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=web.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=web.de Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=web.de header.i=markus.elfring@web.de header.b="gQL08X9N" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=web.de; s=s29768273; t=1709288428; x=1709893228; i=markus.elfring@web.de; bh=XnJJ/DuVyMNtN8i32SvT66PU+gRXPYlBC+UZSbXhbd8=; h=X-UI-Sender-Class:Date:To:Cc:From:Subject; b=gQL08X9NVZrlig7gp98I8sAQQ+ORwftbgdpTa1m8Uptvcy8tht4oBE7lY/vsfF3l AyPwgJwKIQchKpfjLjokAaobUq6c5651QfcvPPLS+6IEDxW9F+Jnn1T6fVAGerb3o IMniBYazjqp5lBQynA/Upo+/jMgY8ahE8EwirFFoIzbKBNr0fPho6TPqfati8Zo2V BuRfmX/FVPCqzR3qwMyofANOPRZFb039RGSB4RrR28R4t8/EUC4kwERp+wS2yB1ya Wcxt88zWTJ13moiQrP9vnzCpXxkgTd8WC5cajxncjK1eyOOhIwrmsSuRRbWtNU7Pt y6ut0OkOGzBZrA0VmA== X-UI-Sender-Class: 814a7b36-bfc1-4dae-8640-3722d8ec6cd6 Received: from [192.168.178.21] ([94.31.86.95]) by smtp.web.de (mrweb005 [213.165.67.108]) with ESMTPSA (Nemesis) id 1MWzD3-1rLy0T11Qn-00XR2t; Fri, 01 Mar 2024 11:20:28 +0100 Message-ID: <0f98e7de-4351-481f-86be-e573805c82f6@web.de> Date: Fri, 1 Mar 2024 11:20:26 +0100 Precedence: bulk X-Mailing-List: linux-media@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird To: linux-media@vger.kernel.org, kernel-janitors@vger.kernel.org, Eugen Hristev , Mauro Carvalho Chehab Content-Language: en-GB Cc: LKML From: Markus Elfring Subject: [PATCH] media: microchip-csi2dc: Move a fwnode_handle_put() call into an if branch in csi2dc_of_parse() X-Provags-ID: V03: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BLNJxJEvYipT7EWqQrxCoINlBTkAE8Q+s5zicj VflXJolFyYv2rjf7xVTMs+TvO6KOTUTpzSDc655JLUHf8= From: Markus Elfring Date: Fri, 1 Mar 2024 11:11:44 +0100 Move a fwnode_handle_put() call into an if branch of this function so that the control flow looks a bit safer directly. Signed-off-by: Markus Elfring --- drivers/media/platform/microchip/microchip-csi2dc.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) -- 2.44.0 diff --git a/drivers/media/platform/microchip/microchip-csi2dc.c b/drivers/media/platform/microchip/microchip-csi2dc.c index fee73260bb1e..ed800a3bb268 100644 --- a/drivers/media/platform/microchip/microchip-csi2dc.c +++ b/drivers/media/platform/microchip/microchip-csi2dc.c @@ -595,12 +595,11 @@ static int csi2dc_of_parse(struct csi2dc_device *csi2dc, output_fwnode = fwnode_graph_get_next_endpoint (of_fwnode_handle(of_node), input_fwnode); - - if (output_fwnode) + if (output_fwnode) { ret = v4l2_fwnode_endpoint_parse(output_fwnode, &output_endpoint); - - fwnode_handle_put(output_fwnode); + fwnode_handle_put(output_fwnode); + } if (!output_fwnode || ret) { dev_info(csi2dc->dev,