drivers: remove unnecessary use of DEVICE_AND_API_INIT

For drivers that support CONFIG_DEVICE_POWER_MANAGEMENT there are some
cases that look like:

  #ifdef CONFIG_DEVICE_POWER_MANAGEMENT
    DEVICE_DEFINE()
  #else
    DEVICE_AND_API_INIT()
  #endif

There is no need to special case this as the pm_control_fn argument to
DEVICE_DEFINE will just be ignored in the
!CONFIG_DEVICE_POWER_MANAGEMENT case.  So we can cleanup the code a
little and remove the #else cases for the drivers that do this.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
This commit is contained in:
Kumar Gala 2020-11-05 06:43:42 -06:00 committed by Maureen Helm
commit b4a3880a75
8 changed files with 2 additions and 85 deletions

View file

@ -475,16 +475,9 @@ static struct i2c_cc13xx_cc26xx_data i2c_cc13xx_cc26xx_data = {
.error = I2C_MASTER_ERR_NONE
};
#ifdef CONFIG_DEVICE_POWER_MANAGEMENT
DEVICE_DEFINE(i2c_cc13xx_cc26xx, DT_INST_LABEL(0),
i2c_cc13xx_cc26xx_init,
i2c_cc13xx_cc26xx_pm_control,
&i2c_cc13xx_cc26xx_data, &i2c_cc13xx_cc26xx_config,
POST_KERNEL, CONFIG_I2C_INIT_PRIORITY,
&i2c_cc13xx_cc26xx_driver_api);
#else
DEVICE_AND_API_INIT(i2c_cc13xx_cc26xx, DT_INST_LABEL(0),
i2c_cc13xx_cc26xx_init, &i2c_cc13xx_cc26xx_data,
&i2c_cc13xx_cc26xx_config, POST_KERNEL,
CONFIG_I2C_INIT_PRIORITY, &i2c_cc13xx_cc26xx_driver_api);
#endif