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

@ -460,12 +460,6 @@ static struct st7789v_data st7789v_data = {
.y_offset = DT_INST_PROP(0, y_offset),
};
#ifndef CONFIG_DEVICE_POWER_MANAGEMENT
DEVICE_AND_API_INIT(st7789v, DT_INST_LABEL(0), &st7789v_init,
&st7789v_data, NULL, APPLICATION,
CONFIG_APPLICATION_INIT_PRIORITY, &st7789v_api);
#else
DEVICE_DEFINE(st7789v, DT_INST_LABEL(0), &st7789v_init,
st7789v_pm_control, &st7789v_data, NULL, APPLICATION,
CONFIG_APPLICATION_INIT_PRIORITY, &st7789v_api);
#endif /* CONFIG_DEVICE_POWER_MANAGEMENT */