rapidio: add modular build option for the subsystem core
authorAlexandre Bounine <alexandre.bounine@idt.com>
Wed, 3 Jul 2013 22:08:56 +0000 (15:08 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Wed, 3 Jul 2013 23:08:05 +0000 (16:08 -0700)
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>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
arch/x86/Kconfig
drivers/rapidio/Makefile
drivers/rapidio/rio.c

index 10764a3d62cc25b08e36a249f91c7f0b11ad4759..2775023a074491e2ab3351a567a3735e3ca5066a 100644 (file)
@@ -2259,11 +2259,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"
index 3036702ffe8b5950e83c9979c6e596fb9aa57db3..6271ada6993fb21f4c7d493784eec94c58742044 100644 (file)
@@ -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/
index 2054b620882300df67e59cd0e74cc85cfdced56a..f4f30af2df68c682744cc125ede61da5f87eb4d1 100644 (file)
@@ -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
 
 #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;
This page took 0.028407 seconds and 5 git commands to generate.