On Tue, Nov 16, 2004 at 02:34:48PM -0800, Randy.Dunlap wrote:
Fix (most of) kernel build for CONFIG_PCI=n. Fixes these 3 errors:
1. drivers/parport/parport_pc.c:3162: error: `parport_init_mode'
undeclared (first use in this function)
Life is easier if you do not use attachments.
(Then I can more easily comment the code.)
You write
-static int __init parport_init_mode_setup(const char *str) {
-
+#ifdef CONFIG_PCI
+static int __init parport_init_mode_setup(const char *str)
In my tree I have
static int __init parport_init_mode_setup(char *str) {
in order to avoid the warning for
__setup("parport_init_mode=",parport_init_mode_setup);
since the parameter is a int (*setup_func)(char *); - see
struct obs_kernel_param {
const char *str;
int (*setup_func)(char *);
int early;
};
Apart from this prototype change I only moved the single line
static int __initdata parport_init_mode = 0;
outside the #ifdef's. Is that not good enough, and better
than introducing more #ifdef's? Keeps the source smaller.