Merge "gunyah: gh_guest_pops: Modify input device error path"
This commit is contained in:
commit
5d6410d7dc
@ -91,21 +91,19 @@ static int __init gh_guest_pops_init_poff(void)
|
||||
input_set_capability(gh_vm_poff_input, EV_KEY, KEY_POWER);
|
||||
|
||||
ret = input_register_device(gh_vm_poff_input);
|
||||
if (ret)
|
||||
goto fail_register;
|
||||
if (ret) {
|
||||
input_free_device(gh_vm_poff_input);
|
||||
return ret;
|
||||
}
|
||||
|
||||
rm_nb.notifier_call = gh_guest_pops_rm_notifer_fn;
|
||||
ret = gh_rm_register_notifier(&rm_nb);
|
||||
if (ret)
|
||||
goto fail_init;
|
||||
if (ret) {
|
||||
input_unregister_device(gh_vm_poff_input);
|
||||
return ret;
|
||||
}
|
||||
|
||||
return 0;
|
||||
|
||||
fail_init:
|
||||
input_unregister_device(gh_vm_poff_input);
|
||||
fail_register:
|
||||
input_free_device(gh_vm_poff_input);
|
||||
return ret;
|
||||
}
|
||||
|
||||
static ssize_t gh_guest_set_app_status(struct kobject *kobj,
|
||||
@ -187,7 +185,6 @@ static void gh_guest_pops_exit_poff(void)
|
||||
gh_rm_unregister_notifier(&rm_nb);
|
||||
|
||||
input_unregister_device(gh_vm_poff_input);
|
||||
input_free_device(gh_vm_poff_input);
|
||||
}
|
||||
|
||||
static int __init gh_guest_pops_init(void)
|
||||
|
Loading…
Reference in New Issue
Block a user