Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933244AbdCaNfE (ORCPT ); Fri, 31 Mar 2017 09:35:04 -0400 Received: from vps0.lunn.ch ([178.209.37.122]:41754 "EHLO vps0.lunn.ch" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933030AbdCaNfD (ORCPT ); Fri, 31 Mar 2017 09:35:03 -0400 Date: Fri, 31 Mar 2017 15:34:58 +0200 From: Andrew Lunn To: Tobias Regnery Cc: f.fainelli@gmail.com, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, davem@davemloft.net Subject: Re: [PATCH net-next] net: dsa: fix build error with devlink build as module Message-ID: <20170331133458.GF22609@lunn.ch> References: <20170331094452.32578-1-tobias.regnery@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20170331094452.32578-1-tobias.regnery@gmail.com> 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: 1652 Lines: 35 On Fri, Mar 31, 2017 at 11:44:52AM +0200, Tobias Regnery wrote: > After commit 96567d5dacf4 ("net: dsa: dsa2: Add basic support of devlink") > I see the following link error with CONFIG_NET_DSA=y and CONFIG_NET_DEVLINK=m: > > net/built-in.o: In function 'dsa_register_switch': > (.text+0xe226b): undefined reference to `devlink_alloc' > net/built-in.o: In function 'dsa_register_switch': > (.text+0xe2284): undefined reference to `devlink_register' > net/built-in.o: In function 'dsa_register_switch': > (.text+0xe243e): undefined reference to `devlink_port_register' > net/built-in.o: In function 'dsa_register_switch': > (.text+0xe24e1): undefined reference to `devlink_port_register' > net/built-in.o: In function 'dsa_register_switch': > (.text+0xe24fa): undefined reference to `devlink_port_type_eth_set' > net/built-in.o: In function 'dsa_dst_unapply.part.8': > dsa2.c:(.text.unlikely+0x345): undefined reference to 'devlink_port_unregister' > dsa2.c:(.text.unlikely+0x36c): undefined reference to 'devlink_port_unregister' > dsa2.c:(.text.unlikely+0x38e): undefined reference to 'devlink_port_unregister' > dsa2.c:(.text.unlikely+0x3f2): undefined reference to 'devlink_unregister' > dsa2.c:(.text.unlikely+0x3fb): undefined reference to 'devlink_free' > > Fix this by adding a dependency on MAY_USE_DEVLINK so that CONFIG_NET_DSA > get switched to be build as module when CONFIG_NET_DEVLINK=m. > > Fixes: 96567d5dacf4 ("net: dsa: dsa2: Add basic support of devlink") > Signed-off-by: Tobias Regnery Hi Tobias 0-day just found the same issue as well. Reviewed-by: Andrew Lunn Thanks Andrew