platform/x86: hp-bioscfg: Simplify return check in hp_add_other_attributes()
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>
This commit is contained in:
parent
7a3c36eef9
commit
c5dbf04160
1 changed files with 3 additions and 5 deletions
|
@ -630,21 +630,19 @@ static int hp_add_other_attributes(int attr_type)
|
||||||
switch (attr_type) {
|
switch (attr_type) {
|
||||||
case HPWMI_SECURE_PLATFORM_TYPE:
|
case HPWMI_SECURE_PLATFORM_TYPE:
|
||||||
ret = hp_populate_secure_platform_data(attr_name_kobj);
|
ret = hp_populate_secure_platform_data(attr_name_kobj);
|
||||||
if (ret)
|
|
||||||
goto err_other_attr_init;
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case HPWMI_SURE_START_TYPE:
|
case HPWMI_SURE_START_TYPE:
|
||||||
ret = hp_populate_sure_start_data(attr_name_kobj);
|
ret = hp_populate_sure_start_data(attr_name_kobj);
|
||||||
if (ret)
|
|
||||||
goto err_other_attr_init;
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
ret = -EINVAL;
|
ret = -EINVAL;
|
||||||
goto err_other_attr_init;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (ret)
|
||||||
|
goto err_other_attr_init;
|
||||||
|
|
||||||
mutex_unlock(&bioscfg_drv.mutex);
|
mutex_unlock(&bioscfg_drv.mutex);
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue