From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 44E73C83F17 for ; Mon, 28 Aug 2023 11:00:38 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232200AbjH1LAL (ORCPT ); Mon, 28 Aug 2023 07:00:11 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57740 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232419AbjH1K7s (ORCPT ); Mon, 28 Aug 2023 06:59:48 -0400 Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [213.167.242.64]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 72CAEFF; Mon, 28 Aug 2023 03:59:46 -0700 (PDT) Received: from pendragon.ideasonboard.com (117.145-247-81.adsl-dyn.isp.belgacom.be [81.247.145.117]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id EA3046B5; Mon, 28 Aug 2023 12:58:23 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1693220304; bh=wMJK57kbx7lOYBO0YvZkYHNeXslbI+8ZdYW1nRpQ8l0=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=EnpASNMOK9DEnOJS+/n3gqrAZIbKWSYqHtES+Vq0ypNrwsN7ddmKqnZZJySYIOOz0 C5mQTzTjVZKNNLJH1G8pnDGSikD1+yefUnKm7hsmWRZtWiVIWUmeGmaPSABnVHePda LKBPDFue1yGUSGsl0vu2McPlpqAzdJidq1jgDMRQ= Date: Mon, 28 Aug 2023 13:59:54 +0300 From: Laurent Pinchart To: Christophe JAILLET Cc: Jacopo Mondi , Kieran Bingham , Niklas =?utf-8?Q?S=C3=B6derlund?= , Mauro Carvalho Chehab , Sakari Ailus , linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org, Mauro Carvalho Chehab , linux-media@vger.kernel.org Subject: Re: [PATCH] media: i2c: max9286: Fix some redundant of_node_put() calls Message-ID: <20230828105954.GG14596@pendragon.ideasonboard.com> References: <084fdd562690c08f1ee72bc08e63e8ee576dc86a.1693001599.git.christophe.jaillet@wanadoo.fr> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <084fdd562690c08f1ee72bc08e63e8ee576dc86a.1693001599.git.christophe.jaillet@wanadoo.fr> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Christophe, Thank you for the patch. On Sat, Aug 26, 2023 at 12:13:40AM +0200, Christophe JAILLET wrote: > This is odd to have a of_node_put() just after a for_each_child_of_node() > or a for_each_endpoint_of_node() loop. It should already be called > during the last iteration. > > Remove these calls. > > Fixes: 66d8c9d2422d ("media: i2c: Add MAX9286 driver") > Signed-off-by: Christophe JAILLET Reviewed-by: Laurent Pinchart > --- > /!\ This patch is speculative, review with case /!\ > --- > drivers/media/i2c/max9286.c | 2 -- > 1 file changed, 2 deletions(-) > > diff --git a/drivers/media/i2c/max9286.c b/drivers/media/i2c/max9286.c > index 20e7c7cf5eeb..f27a69b1b727 100644 > --- a/drivers/media/i2c/max9286.c > +++ b/drivers/media/i2c/max9286.c > @@ -1450,7 +1450,6 @@ static int max9286_parse_dt(struct max9286_priv *priv) > > i2c_mux_mask |= BIT(id); > } > - of_node_put(node); > of_node_put(i2c_mux); > > /* Parse the endpoints */ > @@ -1514,7 +1513,6 @@ static int max9286_parse_dt(struct max9286_priv *priv) > priv->source_mask |= BIT(ep.port); > priv->nsources++; > } > - of_node_put(node); > > of_property_read_u32(dev->of_node, "maxim,bus-width", &priv->bus_width); > switch (priv->bus_width) { -- Regards, Laurent Pinchart