Commit 76db1db5 authored by Vojtech Pavlik's avatar Vojtech Pavlik Committed by Linus Torvalds

[PATCH] Fix a warning in input.c when CONFIG_PROC_FS is not set

parent c33725ec
...@@ -676,20 +676,10 @@ static int input_handlers_read(char *buf, char **start, off_t pos, int count, in ...@@ -676,20 +676,10 @@ static int input_handlers_read(char *buf, char **start, off_t pos, int count, in
return (count > cnt) ? cnt : count; return (count > cnt) ? cnt : count;
} }
#endif static int __init input_proc_init(void)
struct class input_class = {
.name = "input",
};
static int __init input_init(void)
{ {
struct proc_dir_entry *entry; struct proc_dir_entry *entry;
int retval = -ENOMEM;
class_register(&input_class);
#ifdef CONFIG_PROC_FS
proc_bus_input_dir = proc_mkdir("input", proc_bus); proc_bus_input_dir = proc_mkdir("input", proc_bus);
if (proc_bus_input_dir == NULL) if (proc_bus_input_dir == NULL)
return -ENOMEM; return -ENOMEM;
...@@ -708,7 +698,22 @@ static int __init input_init(void) ...@@ -708,7 +698,22 @@ static int __init input_init(void)
return -ENOMEM; return -ENOMEM;
} }
entry->owner = THIS_MODULE; entry->owner = THIS_MODULE;
return 0;
}
#else /* !CONFIG_PROC_FS */
static inline int input_proc_init(void) { return 0; }
#endif #endif
struct class input_class = {
.name = "input",
};
static int __init input_init(void)
{
int retval = -ENOMEM;
class_register(&input_class);
input_proc_init();
retval = register_chrdev(INPUT_MAJOR, "input", &input_fops); retval = register_chrdev(INPUT_MAJOR, "input", &input_fops);
if (retval) { if (retval) {
printk(KERN_ERR "input: unable to register char major %d", INPUT_MAJOR); printk(KERN_ERR "input: unable to register char major %d", INPUT_MAJOR);
......
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