drivers: interrupt_controller: i/loapic: use DEVICE_DEFINE

Define the device using DEVICE_DEFINE macro, so that a single option can
be used regardless of PM being enabled or not.

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
This commit is contained in:
Gerard Marull-Paretas 2021-11-16 16:36:01 +01:00 committed by Carles Cufí
commit c78c312c82
2 changed files with 5 additions and 13 deletions

View file

@ -426,13 +426,10 @@ static int loapic_pm_action(const struct device *dev,
return ret;
}
#endif /* CONFIG_PM_DEVICE */
SYS_DEVICE_DEFINE("loapic", loapic_init, loapic_pm_action, PRE_KERNEL_1,
CONFIG_KERNEL_INIT_PRIORITY_DEFAULT);
#else
SYS_INIT(loapic_init, PRE_KERNEL_1, CONFIG_KERNEL_INIT_PRIORITY_DEFAULT);
#endif /* CONFIG_PM_DEVICE */
DEVICE_DEFINE(loapic, "loapic", loapic_init, loapic_pm_action, NULL, NULL,
PRE_KERNEL_1, CONFIG_KERNEL_INIT_PRIORITY_DEFAULT, NULL);
#if CONFIG_LOAPIC_SPURIOUS_VECTOR
extern void z_loapic_spurious_handler(void);