Skip to content

Commit 42c189f

Browse files
committed
[api] fix stse_put_I2C_parametters warning
1 parent 0752556 commit 42c189f

1 file changed

Lines changed: 6 additions & 10 deletions

File tree

api/stse_device_management.c

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -357,29 +357,25 @@ stse_ReturnCode_t stse_put_i2c_parameters(
357357
stse_low_power_mode_t low_power_mode,
358358
PLAT_UI8 idle_bus_time_to_standby,
359359
PLAT_UI8 i2c_lock_parameters) {
360-
stsafea_i2c_parameters_t i2c_param = {0};
361360

362-
#ifdef STSE_CONF_STSAFE_L_SUPPORT
363-
if (pSTSE->device_type == STSAFE_L010) {
364-
return STSE_API_INCOMPATIBLE_DEVICE_TYPE;
365-
}
366-
#endif /* STSE_CONF_STSAFE_L_SUPPORT */
361+
#ifdef STSE_CONF_STSAFE_A_SUPPORT
367362

368-
if (pSTSE == NULL) {
363+
if (pSTSE == NULL) {
369364
return STSE_SERVICE_HANDLER_NOT_INITIALISED;
370365
}
371366

372-
if (i2c_address > I2C_ADDR_MAX || idle_bus_time_to_standby > IDLE_BUS_DELAY_MAX) {
367+
if (i2c_address > I2C_ADDR_MAX || idle_bus_time_to_standby > IDLE_BUS_DELAY_MAX) {
373368
return STSE_SERVICE_INVALID_PARAMETER;
374369
}
375370

371+
/*Create new I2C parameters structure */
372+
stsafea_i2c_parameters_t i2c_param = {0};
376373
i2c_param.i2c_address = i2c_address;
377374
i2c_param.idle_bus_time_to_standby = idle_bus_time_to_standby;
378375
i2c_param.low_power_mode = low_power_mode;
379376
i2c_param.i2c_paramers_lock = i2c_lock_parameters;
380377

381-
/*- Perform Transfer*/
382-
#ifdef STSE_CONF_STSAFE_A_SUPPORT
378+
/*- Update I2C parameters*/
383379
return stsafea_put_i2c_parameters(pSTSE, &i2c_param);
384380
#else
385381
return STSE_API_INCOMPATIBLE_DEVICE_TYPE;

0 commit comments

Comments
 (0)