diff options
author | Harshit Mogalapalli <harshit.m.mogalapalli@oracle.com> | 2023-11-13 23:07:37 +0300 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2023-12-03 09:33:07 +0300 |
commit | a9dc6f2e27baf909a61c428b7d03fd1312703230 (patch) | |
tree | 487678fe69071931b2737347a36fbc68c0db269a /drivers/platform | |
parent | 9372aab5d0ff621ea203c8c603e7e5f75e888240 (diff) | |
download | linux-a9dc6f2e27baf909a61c428b7d03fd1312703230.tar.xz |
platform/x86: hp-bioscfg: Simplify return check in hp_add_other_attributes()
commit c5dbf04160005e07e8ca7232a7faa77ab1547ae0 upstream.
All cases in switch-case have a same goto on error, move the return
check out of the switch. This is a cleanup.
Signed-off-by: Harshit Mogalapalli <harshit.m.mogalapalli@oracle.com>
Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
Link: https://lore.kernel.org/r/20231113200742.3593548-1-harshit.m.mogalapalli@oracle.com
Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/platform')
-rw-r--r-- | drivers/platform/x86/hp/hp-bioscfg/bioscfg.c | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/drivers/platform/x86/hp/hp-bioscfg/bioscfg.c b/drivers/platform/x86/hp/hp-bioscfg/bioscfg.c index 5798b49ddaba..10676e1abc28 100644 --- a/drivers/platform/x86/hp/hp-bioscfg/bioscfg.c +++ b/drivers/platform/x86/hp/hp-bioscfg/bioscfg.c @@ -630,21 +630,19 @@ static int hp_add_other_attributes(int attr_type) switch (attr_type) { case HPWMI_SECURE_PLATFORM_TYPE: ret = hp_populate_secure_platform_data(attr_name_kobj); - if (ret) - goto err_other_attr_init; break; case HPWMI_SURE_START_TYPE: ret = hp_populate_sure_start_data(attr_name_kobj); - if (ret) - goto err_other_attr_init; break; default: ret = -EINVAL; - goto err_other_attr_init; } + if (ret) + goto err_other_attr_init; + mutex_unlock(&bioscfg_drv.mutex); return 0; |