最終更新:2015-11-18 (水) 17:30:37 (3081d)  

input_register_device
Top / input_register_device

register device with input core

実装

呼び出し元

呼び出し

  • device_add(&dev->dev);
  • path = kobject_get_path?(&dev->dev.kobj, GFP_KERNEL);
  • pr_info("%s as %s\n",dev->name ? dev->name : "Unspecified device", path ? path : "N/A");

コメント

  • This function registers device with input core. The device must be
    allocated with input_allocate_device() and all it's capabilities
    set up before registering.
    If function fails the device must be freed with input_free_device().
    Once device has been successfully registered it can be unregistered
    with input_unregister_device(); input_free_device() should not be
    called in this case.
    
    Note that this function is also used to register managed input devices
    (ones allocated with devm_input_allocate_device()). Such managed input
    devices need not be explicitly unregistered or freed, their tear down
    is controlled by the devres infrastructure. It is also worth noting
    that tear down of managed input devices is internally a 2-step process:
    registered managed input device is first unregistered, but stays in
    memory and can still handle input_event() calls (although events will
    not be delivered anywhere). The freeing of managed input device will
    happen later, when devres stack is unwound to the point where device
    allocation was made.

関連