From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=lunn.ch header.i=@lunn.ch header.b="rDra1acE" Received: from vps0.lunn.ch (vps0.lunn.ch [156.67.10.101]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3F7AA10C0 for ; Wed, 29 Nov 2023 12:07:14 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lunn.ch; s=20171124; h=In-Reply-To:Content-Disposition:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:From:Sender:Reply-To:Subject: Date:Message-ID:To:Cc:MIME-Version:Content-Type:Content-Transfer-Encoding: Content-ID:Content-Description:Content-Disposition:In-Reply-To:References; bh=OF1yULBT96Wf5bwW/3L7ETE5R1ComjXs/+Aua4wz/qs=; b=rDra1acE3S3NsEar5zGCp9oeUF wxO0C09XY065fStCjnyhi17Yv367ZE/EMm1Xsr9LqJOhqCj+NNXZAsGoNHZQnMqSxAr99BddwPCwJ Nj56T+8XCeczDjJAerVavJIykpJS8h3EX5pA3ImN1krdWysmiLZuF01UhHSDnoytvp+w=; Received: from andrew by vps0.lunn.ch with local (Exim 4.94.2) (envelope-from ) id 1r8Qpx-001bqm-Fx; Wed, 29 Nov 2023 21:07:09 +0100 Date: Wed, 29 Nov 2023 21:07:09 +0100 From: Andrew Lunn To: Simon Horman Cc: netdev , Linus Walleij , Christian Marangi , Vladimir Oltean , Florian Fainelli Subject: Re: [PATCH RFC net-next 4/8] dsa: Create port LEDs based on DT binding Message-ID: <1328f773-76c6-4d46-9608-b366303817cb@lunn.ch> References: <20231128232135.358638-1-andrew@lunn.ch> <20231128232135.358638-5-andrew@lunn.ch> <20231129194028.GH43811@kernel.org> Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20231129194028.GH43811@kernel.org> On Wed, Nov 29, 2023 at 07:40:28PM +0000, Simon Horman wrote: > On Wed, Nov 29, 2023 at 12:21:31AM +0100, Andrew Lunn wrote: > > ... > > > +static int dsa_port_leds_setup(struct dsa_port *dp) > > +{ > > + struct device_node *leds, *led; > > + int err; > > + > > + if (!dp->dn) > > + return 0; > > + > > + leds = of_get_child_by_name(dp->dn, "leds"); > > + if (!leds) > > + return 0; > > + > > + for_each_available_child_of_node(leds, led) { > > + err = dsa_port_led_setup(dp, led); > > + if (err) > > + return err; > > Hi Andrew, > > I realise this is an RFC, but Coccinelle tells me that a call to > of_node_put() is needed here. Thanks. If you had not pointed it out, i would probably get it wrong in the next version as well. Andrew