Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751863AbdDBDLE (ORCPT ); Sat, 1 Apr 2017 23:11:04 -0400 Received: from shards.monkeyblade.net ([184.105.139.130]:60186 "EHLO shards.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750948AbdDBDLD (ORCPT ); Sat, 1 Apr 2017 23:11:03 -0400 Date: Sat, 01 Apr 2017 20:11:01 -0700 (PDT) Message-Id: <20170401.201101.1392581874133981603.davem@davemloft.net> To: tobias.regnery@gmail.com Cc: andrew@lunn.ch, f.fainelli@gmail.com, netdev@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH net-next] net: dsa: fix build error with devlink build as module From: David Miller In-Reply-To: <20170331094452.32578-1-tobias.regnery@gmail.com> References: <20170331094452.32578-1-tobias.regnery@gmail.com> X-Mailer: Mew version 6.7 on Emacs 25.1 / Mule 6.0 (HANACHIRUSATO) Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.5.12 (shards.monkeyblade.net [149.20.54.216]); Sat, 01 Apr 2017 19:29:46 -0700 (PDT) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1570 Lines: 30 From: Tobias Regnery Date: Fri, 31 Mar 2017 11:44:52 +0200 > 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 Applied.