fix(st-pmic): remove deadcode from STPMIC2 driver

"regul" corresponds to a specific part of a global table that can't be
undefined. Thus, checking if it is NULL is useless.

Issue found by Coverity (CID 445089).

Signed-off-by: Maxime Méré <maxime.mere@foss.st.com>
Change-Id: Ic812bc1fde12fe8389677c7c72fb85246c50f5c9
This commit is contained in:
Maxime Méré 2024-09-26 09:29:49 +02:00 committed by Yann Gautier
parent bac623d186
commit bdbbf48f4d

View file

@ -1,5 +1,5 @@
/*
* Copyright (C) 2024, STMicroelectronics - All Rights Reserved
* Copyright (C) 2024-2025, STMicroelectronics - All Rights Reserved
*
* SPDX-License-Identifier: BSD-3-Clause
*/
@ -247,10 +247,6 @@ int stpmic2_regulator_levels_mv(struct pmic_handle_s *pmic,
{
const struct regul_struct *regul = &regul_table[id];
if (regul == NULL) {
return RET_ERROR_BAD_PARAMETERS;
}
if (levels_count != NULL) {
*levels_count = regul->volt_table_size;
}