doc: kernel: drivers: Remove assert using DEVICE_API

The initial proposal had the assert included, however this could break
downstream users and it was opted to not add assert in the driver API
calls.

Update the documented example to reflect that.

Signed-off-by: Pieter De Gendt <pieter.degendt@basalte.be>
This commit is contained in:
Pieter De Gendt 2024-12-03 15:31:38 +01:00 committed by Benjamin Cabé
commit 959f67b146

View file

@ -144,15 +144,11 @@ A subsystem API definition typically looks like this:
static inline int subsystem_do_this(const struct device *dev, int foo, int bar)
{
__ASSERT_NO_MSG(DEVICE_API_IS(subsystem, dev));
return DEVICE_API_GET(subsystem, dev)->do_this(dev, foo, bar);
}
static inline void subsystem_do_that(const struct device *dev, void *baz)
{
__ASSERT_NO_MSG(DEVICE_API_IS(subsystem, dev));
DEVICE_API_GET(subsystem, dev)->do_that(dev, baz);
}