diff options
author | Alexandre Bounine <alexandre.bounine@idt.com> | 2013-07-03 18:08:56 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2013-07-03 19:08:05 -0400 |
commit | fdf90abc00979fb2d61dbdba9e855200e236142b (patch) | |
tree | 7df15a7dc12fd6d85183b8ff147572e762eff272 /drivers/rapidio/rio.c | |
parent | 94d9bd4576fcd340c344bffbbe0526227535a95f (diff) |
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>
Diffstat (limited to 'drivers/rapidio/rio.c')
-rw-r--r-- | drivers/rapidio/rio.c | 27 |
1 files changed, 14 insertions, 13 deletions
diff --git a/drivers/rapidio/rio.c b/drivers/rapidio/rio.c index 2054b6208823..f4f30af2df68 100644 --- a/drivers/rapidio/rio.c +++ b/drivers/rapidio/rio.c | |||
@@ -5,7 +5,7 @@ | |||
5 | * Copyright 2005 MontaVista Software, Inc. | 5 | * Copyright 2005 MontaVista Software, Inc. |
6 | * Matt Porter <mporter@kernel.crashing.org> | 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 | * Alex Bounine <alexandre.bounine@idt.com> | 9 | * Alex Bounine <alexandre.bounine@idt.com> |
10 | * | 10 | * |
11 | * This program is free software; you can redistribute it and/or modify it | 11 | * This program is free software; you can redistribute it and/or modify it |
@@ -30,6 +30,17 @@ | |||
30 | 30 | ||
31 | #include "rio.h" | 31 | #include "rio.h" |
32 | 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"); | ||
43 | |||
33 | static LIST_HEAD(rio_devices); | 44 | static LIST_HEAD(rio_devices); |
34 | static DEFINE_SPINLOCK(rio_global_list_lock); | 45 | static DEFINE_SPINLOCK(rio_global_list_lock); |
35 | 46 | ||
@@ -1860,24 +1871,14 @@ no_disc: | |||
1860 | return 0; | 1871 | return 0; |
1861 | } | 1872 | } |
1862 | 1873 | ||
1863 | static int hdids[RIO_MAX_MPORTS + 1]; | ||
1864 | |||
1865 | static int rio_get_hdid(int index) | 1874 | static int rio_get_hdid(int index) |
1866 | { | 1875 | { |
1867 | if (!hdids[0] || hdids[0] <= index || index >= RIO_MAX_MPORTS) | 1876 | if (ids_num == 0 || ids_num <= index || index >= RIO_MAX_MPORTS) |
1868 | return -1; | 1877 | return -1; |
1869 | 1878 | ||
1870 | return hdids[index + 1]; | 1879 | return hdid[index]; |
1871 | } | 1880 | } |
1872 | 1881 | ||
1873 | static int rio_hdid_setup(char *str) | ||
1874 | { | ||
1875 | (void)get_options(str, ARRAY_SIZE(hdids), hdids); | ||
1876 | return 1; | ||
1877 | } | ||
1878 | |||
1879 | __setup("riohdid=", rio_hdid_setup); | ||
1880 | |||
1881 | int rio_register_mport(struct rio_mport *port) | 1882 | int rio_register_mport(struct rio_mport *port) |
1882 | { | 1883 | { |
1883 | struct rio_scan_node *scan = NULL; | 1884 | struct rio_scan_node *scan = NULL; |