Skip to content

Commit

Permalink
doc: reference: drivers: update system drivers section
Browse files Browse the repository at this point in the history
Update the system drivers section: remove references to
SYS_DEVICE_DEFINE, add references to the SYS_INIT() macro.

Signed-off-by: Gerard Marull-Paretas <[email protected]>
  • Loading branch information
gmarull authored and cfriedt committed Dec 25, 2021
1 parent e8bcaff commit 770732f
Showing 1 changed file with 4 additions and 15 deletions.
19 changes: 4 additions & 15 deletions doc/reference/drivers/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -382,21 +382,10 @@ function.
System Drivers
**************

In some cases you may just need to run a function at boot. Special ``SYS_*``
macros exist that map to ``DEVICE_DEFINE()`` calls.
For ``SYS_INIT()`` there are no config or runtime data structures and there
isn't a way
to later get a device pointer by name. The same policies for initialization
level and priority apply.

For ``SYS_DEVICE_DEFINE()`` you can obtain pointers by name.

:c:func:`SYS_INIT()`
Run an initialization function at boot at specified priority.

:c:func:`SYS_DEVICE_DEFINE()`
Like :c:func:`DEVICE_DEFINE` without an API table and constructing
the device name from the init function name.
In some cases you may just need to run a function at boot. For such cases, the
:c:macro:`SYS_INIT` can be used. This macro does not take any config or runtime
data structures and there isn't a way to later get a device pointer by name. The
same device policies for initialization level and priority apply.

Error handling
**************
Expand Down

0 comments on commit 770732f

Please sign in to comment.