From patchwork Thu May 24 20:58:18 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tim Gardner X-Patchwork-Id: 161211 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from chlorine.canonical.com (chlorine.canonical.com [91.189.94.204]) by ozlabs.org (Postfix) with ESMTP id DB506B6EF1 for ; Fri, 25 May 2012 06:58:55 +1000 (EST) Received: from localhost ([127.0.0.1] helo=chlorine.canonical.com) by chlorine.canonical.com with esmtp (Exim 4.71) (envelope-from ) id 1SXf78-0002Ia-L5; Thu, 24 May 2012 20:58:30 +0000 Received: from mail.tpi.com ([70.99.223.143]) by chlorine.canonical.com with esmtp (Exim 4.71) (envelope-from ) id 1SXf76-0002Hx-Lq for kernel-team@lists.ubuntu.com; Thu, 24 May 2012 20:58:29 +0000 Received: from salmon.rtg.net (mail.tpi.com [70.99.223.143]) by mail.tpi.com (Postfix) with ESMTP id 3D77D31EA79 for ; Thu, 24 May 2012 13:57:11 -0700 (PDT) Received: by salmon.rtg.net (Postfix, from userid 1000) id 2276A2045D; Thu, 24 May 2012 14:58:44 -0600 (MDT) From: Tim Gardner To: kernel-team@lists.ubuntu.com Subject: [PATCH 06/12] dsa: Allow core and drivers to be built as modules Date: Thu, 24 May 2012 14:58:18 -0600 Message-Id: <1337893104-130090-7-git-send-email-tim.gardner@canonical.com> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1337893104-130090-2-git-send-email-tim.gardner@canonical.com> References: <1337893104-130090-2-git-send-email-tim.gardner@canonical.com> X-BeenThere: kernel-team@lists.ubuntu.com X-Mailman-Version: 2.1.13 Precedence: list List-Id: Kernel team discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: kernel-team-bounces@lists.ubuntu.com Errors-To: kernel-team-bounces@lists.ubuntu.com From: Ben Hutchings BugLink: http://bugs.launchpad.net/bugs/1004148 Change the kconfig types to tristate and adjust the condition for declaring net_device::dsa_ptr to allow for this. Adjust the makefile so that if NET_DSA_MV88E6123_61_65=y and NET_DSA_MV88E6131=m or vice versa then both drivers are built-in. We could leave these options as bool and make NET_DSA_MV88E6XXX a user-selected option, but that would break existing configurations. Signed-off-by: Ben Hutchings Signed-off-by: David S. Miller (cherry picked from commit 34a430d7bd26b35ca3a7d3fc83663de8ea6e33f6) Signed-off-by: Tim Gardner --- include/linux/netdevice.h | 2 +- net/dsa/Kconfig | 10 +++++----- net/dsa/Makefile | 8 ++++++-- 3 files changed, 12 insertions(+), 8 deletions(-) diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h index 79df785..3a9a752 100644 --- a/include/linux/netdevice.h +++ b/include/linux/netdevice.h @@ -1147,7 +1147,7 @@ struct net_device { #if defined(CONFIG_VLAN_8021Q) || defined(CONFIG_VLAN_8021Q_MODULE) struct vlan_group __rcu *vlgrp; /* VLAN group */ #endif -#ifdef CONFIG_NET_DSA +#if IS_ENABLED(CONFIG_NET_DSA) struct dsa_switch_tree *dsa_ptr; /* dsa specific data */ #endif void *atalk_ptr; /* AppleTalk link */ diff --git a/net/dsa/Kconfig b/net/dsa/Kconfig index c53ded2..7e12303 100644 --- a/net/dsa/Kconfig +++ b/net/dsa/Kconfig @@ -1,5 +1,5 @@ menuconfig NET_DSA - bool "Distributed Switch Architecture support" + tristate "Distributed Switch Architecture support" default n depends on EXPERIMENTAL && NETDEVICES && !S390 select PHYLIB @@ -26,11 +26,11 @@ config NET_DSA_TAG_TRAILER # switch drivers config NET_DSA_MV88E6XXX - bool + tristate default n config NET_DSA_MV88E6060 - bool "Marvell 88E6060 ethernet switch chip support" + tristate "Marvell 88E6060 ethernet switch chip support" select NET_DSA_TAG_TRAILER ---help--- This enables support for the Marvell 88E6060 ethernet switch @@ -41,7 +41,7 @@ config NET_DSA_MV88E6XXX_NEED_PPU default n config NET_DSA_MV88E6131 - bool "Marvell 88E6085/6095/6095F/6131 ethernet switch chip support" + tristate "Marvell 88E6085/6095/6095F/6131 ethernet switch chip support" select NET_DSA_MV88E6XXX select NET_DSA_MV88E6XXX_NEED_PPU select NET_DSA_TAG_DSA @@ -50,7 +50,7 @@ config NET_DSA_MV88E6131 ethernet switch chips. config NET_DSA_MV88E6123_61_65 - bool "Marvell 88E6123/6161/6165 ethernet switch chip support" + tristate "Marvell 88E6123/6161/6165 ethernet switch chip support" select NET_DSA_MV88E6XXX select NET_DSA_TAG_EDSA ---help--- diff --git a/net/dsa/Makefile b/net/dsa/Makefile index 5c48ac5..191dd48 100644 --- a/net/dsa/Makefile +++ b/net/dsa/Makefile @@ -11,5 +11,9 @@ dsa_core-$(CONFIG_NET_DSA_TAG_TRAILER) += tag_trailer.o obj-$(CONFIG_NET_DSA_MV88E6060) += mv88e6060.o obj-$(CONFIG_NET_DSA_MV88E6XXX) += mv88e6xxx_drv.o mv88e6xxx_drv-y += mv88e6xxx.o -mv88e6xxx_drv-$(CONFIG_NET_DSA_MV88E6123_61_65) += mv88e6123_61_65.o -mv88e6xxx_drv-$(CONFIG_NET_DSA_MV88E6131) += mv88e6131.o +ifdef CONFIG_NET_DSA_MV88E6123_61_65 +mv88e6xxx_drv-y += mv88e6123_61_65.o +endif +ifdef CONFIG_NET_DSA_MV88E6131 +mv88e6xxx_drv-y += mv88e6131.o +endif