[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

input layer



Hi group,
 
I am trying to analyse a part of the input layer of the kernel 2.6.7 (input.c) (see below). The problem is that I don't fully understand what this piece of code does. Can anybody help me? 
 
static int __init input_init(void)
{
 int retval = -ENOMEM;
 
 input_class = class_simple_create(THIS_MODULE, "input");
 if (IS_ERR(input_class))
  return PTR_ERR(input_class);
 input_proc_init();
 retval = register_chrdev(INPUT_MAJOR, "input", &input_fops);
 if (retval) {
  printk(KERN_ERR "input: unable to register char major %d", INPUT_MAJOR);
  remove_proc_entry("devices", proc_bus_input_dir);
  remove_proc_entry("handlers", proc_bus_input_dir);
  remove_proc_entry("input", proc_bus);
  class_simple_destroy(input_class);
  return retval;
 }
 
 retval = devfs_mk_dir("input");
 if (retval) {
  remove_proc_entry("devices", proc_bus_input_dir);
  remove_proc_entry("handlers", proc_bus_input_dir);
  remove_proc_entry("input", proc_bus);
  unregister_chrdev(INPUT_MAJOR, "input");
  class_simple_destroy(input_class);
 }
 return retval;
}
 
 
 
thanks in advance,
 
Paul Akkermans

Reply to: