mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Alexandre Bounine <alexandre.bounine@idt.com>
To: Andrew Morton <akpm@linux-foundation.org>,
	linux-kernel@vger.kernel.org, linuxppc-dev@lists.ozlabs.org
Cc: Alexandre Bounine <alexandre.bounine@idt.com>,
	Matt Porter <mporter@kernel.crashing.org>,
	Li Yang <leoli@freescale.com>,
	Kumar Gala <galak@kernel.crashing.org>,
	Andre van Herk <andre.van.herk@Prodrive.nl>,
	Micha Nelissen <micha.nelissen@Prodrive.nl>,
	Stef van Os <stef.van.os@Prodrive.nl>,
	Jean Delvare <jdelvare@suse.de>
Subject: [PATCH 5/7] rapidio: add modular build option for the subsystem core
Date: Fri, 28 Jun 2013 15:18:54 -0400	[thread overview]
Message-ID: <1372447136-5751-6-git-send-email-alexandre.bounine@idt.com> (raw)
In-Reply-To: <1372447136-5751-1-git-send-email-alexandre.bounine@idt.com>

Add a configuration option to build RapidIO subsystem core code as a loadable
kernel module. Currently this option is available only for x86-based platforms,
with the additional patch for PowerPC planned to be provided later.

This patch replaces kernel command line parameter "riohdid=" with its
module-specific analog "rapidio.hdid=".  

Signed-off-by: Alexandre Bounine <alexandre.bounine@idt.com>
Cc: Matt Porter <mporter@kernel.crashing.org>
Cc: Li Yang <leoli@freescale.com>
Cc: Kumar Gala <galak@kernel.crashing.org>
Cc: Andre van Herk <andre.van.herk@Prodrive.nl>
Cc: Micha Nelissen <micha.nelissen@Prodrive.nl>
Cc: Stef van Os <stef.van.os@Prodrive.nl>
Cc: Jean Delvare <jdelvare@suse.de>
---
 arch/x86/Kconfig         |    4 ++--
 drivers/rapidio/Makefile |    4 +++-
 drivers/rapidio/rio.c    |   27 ++++++++++++++-------------
 3 files changed, 19 insertions(+), 16 deletions(-)

diff --git a/arch/x86/Kconfig b/arch/x86/Kconfig
index fe120da..583ac42 100644
--- a/arch/x86/Kconfig
+++ b/arch/x86/Kconfig
@@ -2246,11 +2246,11 @@ source "drivers/pcmcia/Kconfig"
 source "drivers/pci/hotplug/Kconfig"
 
 config RAPIDIO
-	bool "RapidIO support"
+	tristate "RapidIO support"
 	depends on PCI
 	default n
 	help
-	  If you say Y here, the kernel will include drivers and
+	  If enabled this option will include drivers and the core
 	  infrastructure code to support RapidIO interconnect devices.
 
 source "drivers/rapidio/Kconfig"
diff --git a/drivers/rapidio/Makefile b/drivers/rapidio/Makefile
index 3036702..6271ada 100644
--- a/drivers/rapidio/Makefile
+++ b/drivers/rapidio/Makefile
@@ -1,7 +1,9 @@
 #
 # Makefile for RapidIO interconnect services
 #
-obj-y += rio.o rio-access.o rio-driver.o rio-sysfs.o
+obj-$(CONFIG_RAPIDIO) += rapidio.o
+rapidio-y := rio.o rio-access.o rio-driver.o rio-sysfs.o
+
 obj-$(CONFIG_RAPIDIO_ENUM_BASIC) += rio-scan.o
 
 obj-$(CONFIG_RAPIDIO)		+= switches/
diff --git a/drivers/rapidio/rio.c b/drivers/rapidio/rio.c
index 2054b62..f4f30af 100644
--- a/drivers/rapidio/rio.c
+++ b/drivers/rapidio/rio.c
@@ -5,7 +5,7 @@
  * Copyright 2005 MontaVista Software, Inc.
  * Matt Porter <mporter@kernel.crashing.org>
  *
- * Copyright 2009 Integrated Device Technology, Inc.
+ * Copyright 2009 - 2013 Integrated Device Technology, Inc.
  * Alex Bounine <alexandre.bounine@idt.com>
  *
  * This program is free software; you can redistribute  it and/or modify it
@@ -30,6 +30,17 @@
 
 #include "rio.h"
 
+MODULE_DESCRIPTION("RapidIO Subsystem Core");
+MODULE_AUTHOR("Matt Porter <mporter@kernel.crashing.org>");
+MODULE_AUTHOR("Alexandre Bounine <alexandre.bounine@idt.com>");
+MODULE_LICENSE("GPL");
+
+static int hdid[RIO_MAX_MPORTS];
+static int ids_num;
+module_param_array(hdid, int, &ids_num, 0);
+MODULE_PARM_DESC(hdid,
+	"Destination ID assignment to local RapidIO controllers");
+
 static LIST_HEAD(rio_devices);
 static DEFINE_SPINLOCK(rio_global_list_lock);
 
@@ -1860,24 +1871,14 @@ no_disc:
 	return 0;
 }
 
-static int hdids[RIO_MAX_MPORTS + 1];
-
 static int rio_get_hdid(int index)
 {
-	if (!hdids[0] || hdids[0] <= index || index >= RIO_MAX_MPORTS)
+	if (ids_num == 0 || ids_num <= index || index >= RIO_MAX_MPORTS)
 		return -1;
 
-	return hdids[index + 1];
+	return hdid[index];
 }
 
-static int rio_hdid_setup(char *str)
-{
-	(void)get_options(str, ARRAY_SIZE(hdids), hdids);
-	return 1;
-}
-
-__setup("riohdid=", rio_hdid_setup);
-
 int rio_register_mport(struct rio_mport *port)
 {
 	struct rio_scan_node *scan = NULL;
-- 
1.7.8.4


  parent reply	other threads:[~2013-06-28 19:31 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-06-28 19:18 [PATCH 0/7] rapidio: modularize rapidio subsystem Alexandre Bounine
2013-06-28 19:18 ` [PATCH 1/7] rapidio: convert switch drivers to modules Alexandre Bounine
2013-06-28 19:18 ` [PATCH 2/7] rapidio/rionet: rework driver initialization and removal Alexandre Bounine
2013-06-28 19:18 ` [PATCH 3/7] rapidio: update enumerator registration mechanism Alexandre Bounine
2013-06-28 19:18 ` [PATCH 4/7] rapidio/tsi721: convert to modular mport driver Alexandre Bounine
2013-06-28 19:18 ` Alexandre Bounine [this message]
2013-07-26 11:00   ` [PATCH 5/7] rapidio: add modular build option for the subsystem core Jean Delvare
2013-07-26 12:17     ` Bounine, Alexandre
2013-06-28 19:18 ` [PATCH 6/7] rapidio: add udev notification Alexandre Bounine
2013-06-28 19:18 ` [PATCH 7/7] rapidio: documentation update Alexandre Bounine
2013-07-25 16:03 ` [PATCH 0/7] rapidio: modularize rapidio subsystem Jean Delvare

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1372447136-5751-6-git-send-email-alexandre.bounine@idt.com \
    --to=alexandre.bounine@idt.com \
    --cc=akpm@linux-foundation.org \
    --cc=andre.van.herk@Prodrive.nl \
    --cc=galak@kernel.crashing.org \
    --cc=jdelvare@suse.de \
    --cc=leoli@freescale.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linuxppc-dev@lists.ozlabs.org \
    --cc=micha.nelissen@Prodrive.nl \
    --cc=mporter@kernel.crashing.org \
    --cc=stef.van.os@Prodrive.nl \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®