drivers: counter: Refactor drivers to use shared init priority

Refactors all of the counter drivers to use a shared driver class
initialization priority configuration, CONFIG_COUNTER_INIT_PRIORITY, to
allow configuring counter drivers separately from other devices. This is
similar to other driver classes like I2C and SPI.

The default is set to CONFIG_KERNEL_INIT_PRIORITY_DEVICE to preserve the
existing default initialization priority for most drivers. The
exceptions are the maxim_ds3231 and mcp7940n drivers which have a
dependency on a SPI driver and must therefore initialize later than the
default device priority.

Signed-off-by: Maureen Helm <maureen.helm@intel.com>
This commit is contained in:
Maureen Helm 2021-10-20 15:15:14 -05:00 committed by Anas Nashif
commit 165963c115
28 changed files with 33 additions and 38 deletions

View file

@ -209,4 +209,4 @@ static const struct counter_driver_api api = {
};
DEVICE_DEFINE(counter_cmos, "CMOS", init, NULL, NULL, &info,
POST_KERNEL, CONFIG_KERNEL_INIT_PRIORITY_DEVICE, &api);
POST_KERNEL, CONFIG_COUNTER_INIT_PRIORITY, &api);