summaryrefslogtreecommitdiffstats
path: root/drivers/platform
diff options
context:
space:
mode:
authorHans de Goede <hdegoede@redhat.com>2021-11-21 20:11:28 +0100
committerHans de Goede <hdegoede@redhat.com>2021-11-25 16:19:02 +0100
commitcb97f5f01d383ff166d50e356d07ac38d6033ac8 (patch)
tree8daa40407e41d3cc8966012768ea720a2ef5f349 /drivers/platform
parent798682e236893a20e5674de02ede474373dd342d (diff)
downloadlinux-cb97f5f01d383ff166d50e356d07ac38d6033ac8.tar.bz2
platform/x86: thinkpad_acpi: Remove "goto err_exit" from hotkey_init()
The err_exit label just does a: return (res < 0) ? res : -ENODEV; And res is always < 0 when we go there (hotkey_mask_get() returns either 0 or -EIO), so the goto-s can simply be replaced with "return res". Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com> Tested-by: Mark Pearson <mpearson@lenovo.com> Signed-off-by: Hans de Goede <hdegoede@redhat.com> Link: https://lore.kernel.org/r/20211121191129.256713-7-hdegoede@redhat.com
Diffstat (limited to 'drivers/platform')
-rw-r--r--drivers/platform/x86/thinkpad_acpi.c8
1 files changed, 2 insertions, 6 deletions
diff --git a/drivers/platform/x86/thinkpad_acpi.c b/drivers/platform/x86/thinkpad_acpi.c
index ca86e6c2b546..45b68042e1fb 100644
--- a/drivers/platform/x86/thinkpad_acpi.c
+++ b/drivers/platform/x86/thinkpad_acpi.c
@@ -3464,7 +3464,7 @@ static int __init hotkey_init(struct ibm_init_struct *iibm)
* the first hotkey_mask_get to return hotkey_orig_mask */
res = hotkey_mask_get();
if (res)
- goto err_exit;
+ return res;
hotkey_orig_mask = hotkey_acpi_mask;
} else {
@@ -3500,8 +3500,7 @@ static int __init hotkey_init(struct ibm_init_struct *iibm)
TPACPI_HOTKEY_MAP_SIZE, GFP_KERNEL);
if (!hotkey_keycode_map) {
pr_err("failed to allocate memory for key map\n");
- res = -ENOMEM;
- goto err_exit;
+ return -ENOMEM;
}
input_set_capability(tpacpi_inputdev, EV_MSC, MSC_SCAN);
@@ -3582,9 +3581,6 @@ static int __init hotkey_init(struct ibm_init_struct *iibm)
hotkey_poll_setup_safe(true);
return 0;
-
-err_exit:
- return (res < 0) ? res : -ENODEV;
}
/* Thinkpad X1 Carbon support 5 modes including Home mode, Web browser