Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

rapidio: add modular build option for the subsystem core

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>

authored by

Alexandre Bounine and committed by
Linus Torvalds
fdf90abc 94d9bd45

+19 -16
+2 -2
arch/x86/Kconfig
··· 2259 2259 source "drivers/pci/hotplug/Kconfig" 2260 2260 2261 2261 config RAPIDIO 2262 - bool "RapidIO support" 2262 + tristate "RapidIO support" 2263 2263 depends on PCI 2264 2264 default n 2265 2265 help 2266 - If you say Y here, the kernel will include drivers and 2266 + If enabled this option will include drivers and the core 2267 2267 infrastructure code to support RapidIO interconnect devices. 2268 2268 2269 2269 source "drivers/rapidio/Kconfig"
+3 -1
drivers/rapidio/Makefile
··· 1 1 # 2 2 # Makefile for RapidIO interconnect services 3 3 # 4 - obj-y += rio.o rio-access.o rio-driver.o rio-sysfs.o 4 + obj-$(CONFIG_RAPIDIO) += rapidio.o 5 + rapidio-y := rio.o rio-access.o rio-driver.o rio-sysfs.o 6 + 5 7 obj-$(CONFIG_RAPIDIO_ENUM_BASIC) += rio-scan.o 6 8 7 9 obj-$(CONFIG_RAPIDIO) += switches/
+14 -13
drivers/rapidio/rio.c
··· 5 5 * Copyright 2005 MontaVista Software, Inc. 6 6 * Matt Porter <mporter@kernel.crashing.org> 7 7 * 8 - * Copyright 2009 Integrated Device Technology, Inc. 8 + * Copyright 2009 - 2013 Integrated Device Technology, Inc. 9 9 * Alex Bounine <alexandre.bounine@idt.com> 10 10 * 11 11 * This program is free software; you can redistribute it and/or modify it ··· 29 29 #include <linux/interrupt.h> 30 30 31 31 #include "rio.h" 32 + 33 + MODULE_DESCRIPTION("RapidIO Subsystem Core"); 34 + MODULE_AUTHOR("Matt Porter <mporter@kernel.crashing.org>"); 35 + MODULE_AUTHOR("Alexandre Bounine <alexandre.bounine@idt.com>"); 36 + MODULE_LICENSE("GPL"); 37 + 38 + static int hdid[RIO_MAX_MPORTS]; 39 + static int ids_num; 40 + module_param_array(hdid, int, &ids_num, 0); 41 + MODULE_PARM_DESC(hdid, 42 + "Destination ID assignment to local RapidIO controllers"); 32 43 33 44 static LIST_HEAD(rio_devices); 34 45 static DEFINE_SPINLOCK(rio_global_list_lock); ··· 1871 1860 return 0; 1872 1861 } 1873 1862 1874 - static int hdids[RIO_MAX_MPORTS + 1]; 1875 - 1876 1863 static int rio_get_hdid(int index) 1877 1864 { 1878 - if (!hdids[0] || hdids[0] <= index || index >= RIO_MAX_MPORTS) 1865 + if (ids_num == 0 || ids_num <= index || index >= RIO_MAX_MPORTS) 1879 1866 return -1; 1880 1867 1881 - return hdids[index + 1]; 1868 + return hdid[index]; 1882 1869 } 1883 - 1884 - static int rio_hdid_setup(char *str) 1885 - { 1886 - (void)get_options(str, ARRAY_SIZE(hdids), hdids); 1887 - return 1; 1888 - } 1889 - 1890 - __setup("riohdid=", rio_hdid_setup); 1891 1870 1892 1871 int rio_register_mport(struct rio_mport *port) 1893 1872 {