diff options
| author | Josh Boyer <jwboyer@redhat.com> | 2013-03-10 10:33:40 -0400 |
|---|---|---|
| committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2013-03-12 11:53:23 -0400 |
| commit | f2b8dfd9e480c3db3bad0c25c590a5d11b31f4ef (patch) | |
| tree | 564230f7fec965d093fbe56b6b902e3caf0ac273 | |
| parent | 827aa0d36d486f359808c8fb931cf7a71011a09d (diff) | |
serial: 8250: Keep 8250.<xxxx> module options functional after driver rename
With commit 835d844d1 (8250_pnp: do pnp probe before legacy probe), the
8250 driver was renamed to 8250_core. This means any existing usage of
the 8259.<xxxx> module parameters or as a kernel command line switch is
now broken, as the 8250_core driver doesn't parse options belonging to
something called "8250".
To solve this, we redefine the module options in a dummy function using
a redefined MODULE_PARAM_PREFX when built into the kernel. In the case
where we're building as a module, we provide an alias to the old 8250
name. The dummy function prevents compiler errors due to global variable
redefinitions that happen as part of the module_param_ macro expansions.
Signed-off-by: Josh Boyer <jwboyer@redhat.com>
Acked-by: Jiri Slaby <jslaby@suse.cz>
Cc: stable <stable@vger.kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
| -rw-r--r-- | drivers/tty/serial/8250/8250.c | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/drivers/tty/serial/8250/8250.c b/drivers/tty/serial/8250/8250.c index 661096d25620..cf6a5383748a 100644 --- a/drivers/tty/serial/8250/8250.c +++ b/drivers/tty/serial/8250/8250.c | |||
| @@ -3417,3 +3417,32 @@ module_param_array(probe_rsa, ulong, &probe_rsa_count, 0444); | |||
| 3417 | MODULE_PARM_DESC(probe_rsa, "Probe I/O ports for RSA"); | 3417 | MODULE_PARM_DESC(probe_rsa, "Probe I/O ports for RSA"); |
| 3418 | #endif | 3418 | #endif |
| 3419 | MODULE_ALIAS_CHARDEV_MAJOR(TTY_MAJOR); | 3419 | MODULE_ALIAS_CHARDEV_MAJOR(TTY_MAJOR); |
| 3420 | |||
| 3421 | #ifndef MODULE | ||
| 3422 | /* This module was renamed to 8250_core in 3.7. Keep the old "8250" name | ||
| 3423 | * working as well for the module options so we don't break people. We | ||
| 3424 | * need to keep the names identical and the convenient macros will happily | ||
| 3425 | * refuse to let us do that by failing the build with redefinition errors | ||
| 3426 | * of global variables. So we stick them inside a dummy function to avoid | ||
| 3427 | * those conflicts. The options still get parsed, and the redefined | ||
| 3428 | * MODULE_PARAM_PREFIX lets us keep the "8250." syntax alive. | ||
| 3429 | * | ||
| 3430 | * This is hacky. I'm sorry. | ||
| 3431 | */ | ||
| 3432 | static void __used s8250_options(void) | ||
| 3433 | { | ||
| 3434 | #undef MODULE_PARAM_PREFIX | ||
| 3435 | #define MODULE_PARAM_PREFIX "8250." | ||
| 3436 | |||
| 3437 | module_param_cb(share_irqs, ¶m_ops_uint, &share_irqs, 0644); | ||
| 3438 | module_param_cb(nr_uarts, ¶m_ops_uint, &nr_uarts, 0644); | ||
| 3439 | module_param_cb(skip_txen_test, ¶m_ops_uint, &skip_txen_test, 0644); | ||
| 3440 | #ifdef CONFIG_SERIAL_8250_RSA | ||
| 3441 | __module_param_call(MODULE_PARAM_PREFIX, probe_rsa, | ||
| 3442 | ¶m_array_ops, .arr = &__param_arr_probe_rsa, | ||
| 3443 | 0444, -1); | ||
| 3444 | #endif | ||
| 3445 | } | ||
| 3446 | #else | ||
| 3447 | MODULE_ALIAS("8250"); | ||
| 3448 | #endif | ||
