Skip to content

Commit 2d6f8c0

Browse files
committed
drivers: smbus: use correct device initialization priority
The smbus driver initialization priority was previously set to `KERNEL_INIT_PRIORITY_DEFAULT` (which is 40). However, the default init priority of devices is typically `KERNEL_INIT_PRIORITY_DEVICE` (which is 50). Since the stm32 smbus driver uses a reference to the underlying i2c device, and since this driver was not being built in CI, this led to the discovery that the smbus driver was initialized too early. ```shell ERROR: Device initialization priority validation failed, the sequence of \ initialization calls does not match the devicetree dependencies. ERROR: /smbus1 <smbus_stm32_init> is initialized before its dependency \ /soc/i2c@40005400 <i2c_stm32_init> (POST_KERNEL+1 < POST_KERNEL+4) ``` By setting the initialization priority to `KERNEL_INIT_PRIORITY_DEVICE`, both smbus1 and i2c1 have their priorities evaluated in the same group, and it becomes possible to determine relative priorities via phandle dependency. Signed-off-by: Chris Friedt <cfriedt@tenstorrent.com>
1 parent 91b1b84 commit 2d6f8c0

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/smbus/Kconfig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ config SMBUS_STATS
2424

2525
config SMBUS_INIT_PRIORITY
2626
int "Init priority"
27-
default KERNEL_INIT_PRIORITY_DEFAULT
27+
default KERNEL_INIT_PRIORITY_DEVICE
2828
help
2929
SMBus device driver initialization priority.
3030

0 commit comments

Comments
 (0)