Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752972AbdFQMLU (ORCPT ); Sat, 17 Jun 2017 08:11:20 -0400 Received: from vps0.lunn.ch ([178.209.37.122]:52470 "EHLO vps0.lunn.ch" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752946AbdFQMLS (ORCPT ); Sat, 17 Jun 2017 08:11:18 -0400 Date: Sat, 17 Jun 2017 14:11:11 +0200 From: Andrew Lunn To: Salil Mehta Cc: "davem@davemloft.net" , "Zhuangyuzeng (Yisen)" , huangdaode , "lipeng (Y)" , "mehta.salil.lnk@gmail.com" , "netdev@vger.kernel.org" , "linux-kernel@vger.kernel.org" , Linuxarm Subject: Re: [PATCH V2 net-next 2/8] net: hns3: Add support of the HNAE3 framework Message-ID: <20170617121111.GA1974@lunn.ch> References: <20170613231035.494020-1-salil.mehta@huawei.com> <20170613231035.494020-3-salil.mehta@huawei.com> <20170614013750.GG23384@lunn.ch> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 811 Lines: 21 > > > +subsys_initcall(hnae3_init); > > > > And the point of this is? > > > > Andrew > This looks weird but not sure how we could have made sure HNAE is available before other > 2 drivers could have loaded. Changing into module_init() means two other modules (dependent > upon hnae) if loaded first will experience load time linking problems. Do you think this > is okay? Often the best way to decide if something is sensible is to see if lots of other drivers do the same. Can you point to other drivers doing this? depmod/modprobe will actually sort this out for you. depmod looks at the symbols exported and required for each module and builds a dependency tree. When you modprobe a driver, it looks at the dependency tree, and loads any drivers needed in order to fulfil the dependencies. Andrew