From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from vps0.lunn.ch ([185.16.172.187]:34614 "EHLO vps0.lunn.ch" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751432AbeBVVrf (ORCPT ); Thu, 22 Feb 2018 16:47:35 -0500 Date: Thu, 22 Feb 2018 22:47:32 +0100 From: Andrew Lunn To: Bryan.Whitehead@microchip.com Cc: davem@davemloft.net, UNGLinuxDriver@microchip.com, netdev@vger.kernel.org Subject: Re: [PATCH v2 net-next 1/2] lan743x: Add main source files for new lan743x driver Message-ID: <20180222214732.GJ28112@lunn.ch> References: <1519240015-10263-1-git-send-email-Bryan.Whitehead@microchip.com> <1519240015-10263-2-git-send-email-Bryan.Whitehead@microchip.com> <20180222025555.GA15024@lunn.ch> <90A7E81AE28BAE4CBDDB3B35F187D2644071DC62@CHN-SV-EXMX02.mchp-main.com> <20180222214534.GI28112@lunn.ch> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180222214534.GI28112@lunn.ch> Sender: netdev-owner@vger.kernel.org List-ID: On Thu, Feb 22, 2018 at 10:45:34PM +0100, Andrew Lunn wrote: > > Also I'm allocating interrupt resources on interface up, and freeing resources > > on interface down. So if there is an up, down, up sequence then the driver > > will allocate resources twice. In order for devm to work properly, should I > > move all resource allocation into the probe function? > > Hi Bryan > > It is better to fail early if the resource is not available, so yes, i > would register the interrupt handler in probe. And we maintainers don't always agree with each other :-) Doing irq handling in open/close without devm_ is also O.K. Andrew