Commit 2dff0579 authored by Russell King's avatar Russell King

[SERIAL] Use module_param/module_param_array

Update serial to use new module parameters rather than
MODULE_PARM.
parent ae1b4721
......@@ -21,6 +21,7 @@
*/
#include <linux/config.h>
#include <linux/module.h>
#include <linux/moduleparam.h>
#include <linux/tty.h>
#include <linux/ioport.h>
#include <linux/init.h>
......@@ -117,11 +118,11 @@ static struct old_serial_port old_serial_port[] = {
#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 {
......@@ -678,19 +679,16 @@ static void autoconfig(struct uart_8250_port *up, unsigned int probeflags)
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;
}
......@@ -2213,14 +2211,12 @@ EXPORT_SYMBOL(serial8250_resume_port);
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);
......@@ -32,6 +32,7 @@
======================================================================*/
#include <linux/module.h>
#include <linux/moduleparam.h>
#include <linux/kernel.h>
#include <linux/init.h>
#include <linux/sched.h>
......@@ -71,17 +72,18 @@ static char *version = "serial_cs.c 1.134 2002/05/04 05:48:53 (David Hinds)";
/* 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);
/*====================================================================*/
......@@ -221,10 +223,10 @@ static dev_link_t *serial_attach(void)
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) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment