*/
#include <linux/config.h>
#include <linux/module.h>
+#include <linux/moduleparam.h>
#include <linux/tty.h>
#include <linux/ioport.h>
#include <linux/init.h>
#define UART_NR (ARRAY_SIZE(old_serial_port) + CONFIG_SERIAL_8250_NR_UARTS)
-#if defined(CONFIG_SERIAL_8250_RSA) && defined(MODULE)
+#ifdef CONFIG_SERIAL_8250_RSA
#define PORT_RSA_MAX 4
-static int probe_rsa[PORT_RSA_MAX];
-static int force_rsa[PORT_RSA_MAX];
+static unsigned long probe_rsa[PORT_RSA_MAX];
+static unsigned int probe_rsa_count;
#endif /* CONFIG_SERIAL_8250_RSA */
struct uart_8250_port {
break;
}
-#if defined(CONFIG_SERIAL_8250_RSA) && defined(MODULE)
+#ifdef CONFIG_SERIAL_8250_RSA
/*
* Only probe for RSA ports if we got the region.
*/
if (up->port.type == PORT_16550A && probeflags & PROBE_RSA) {
int i;
- for (i = 0 ; i < PORT_RSA_MAX ; ++i) {
- if (!probe_rsa[i] && !force_rsa[i])
- break;
- if ((probe_rsa[i] == up->port.iobase ||
- force_rsa[i] == up->port.iobase) &&
- __enable_rsa(up)) {
+ for (i = 0 ; i < probe_rsa_count; ++i) {
+ if (probe_rsa[i] == up->port.iobase &&
+ __enable_rsa(up)) {
up->port.type = PORT_RSA;
break;
}
MODULE_LICENSE("GPL");
MODULE_DESCRIPTION("Generic 8250/16x50 serial driver $Revision: 1.90 $");
-MODULE_PARM(share_irqs, "i");
+module_param(share_irqs, uint, 0644);
MODULE_PARM_DESC(share_irqs, "Share IRQs with other non-8250/16x50 devices"
" (unsafe)");
-#if defined(CONFIG_SERIAL_8250_RSA) && defined(MODULE)
-MODULE_PARM(probe_rsa, "1-" __MODULE_STRING(PORT_RSA_MAX) "i");
+#ifdef CONFIG_SERIAL_8250_RSA
+module_param_array(probe_rsa, ulong, probe_rsa_count, 0444);
MODULE_PARM_DESC(probe_rsa, "Probe I/O ports for RSA");
-MODULE_PARM(force_rsa, "1-" __MODULE_STRING(PORT_RSA_MAX) "i");
-MODULE_PARM_DESC(force_rsa, "Force I/O ports for RSA");
#endif
MODULE_ALIAS_CHARDEV_MAJOR(TTY_MAJOR);
======================================================================*/
#include <linux/module.h>
+#include <linux/moduleparam.h>
#include <linux/kernel.h>
#include <linux/init.h>
#include <linux/sched.h>
/* Bit map of interrupts to choose from */
static u_int irq_mask = 0xdeb8;
-static int irq_list[4] = { -1 };
+static int irq_list[4];
+static unsigned int irq_list_count;
/* Enable the speaker? */
static int do_sound = 1;
/* Skip strict UART tests? */
static int buggy_uart;
-MODULE_PARM(irq_mask, "i");
-MODULE_PARM(irq_list, "1-4i");
-MODULE_PARM(do_sound, "i");
-MODULE_PARM(buggy_uart, "i");
+module_param(irq_mask, uint, 0444);
+module_param_array(irq_list, int, irq_list_count, 0444);
+module_param(do_sound, int, 0444);
+module_param(buggy_uart, int, 0444);
/*====================================================================*/
link->io.NumPorts1 = 8;
link->irq.Attributes = IRQ_TYPE_EXCLUSIVE;
link->irq.IRQInfo1 = IRQ_INFO2_VALID | IRQ_LEVEL_ID;
- if (irq_list[0] == -1)
+ if (irq_list_count == 0)
link->irq.IRQInfo2 = irq_mask;
else
- for (i = 0; i < 4; i++)
+ for (i = 0; i < irq_list_count; i++)
link->irq.IRQInfo2 |= 1 << irq_list[i];
link->conf.Attributes = CONF_ENABLE_IRQ;
if (do_sound) {