Skip to content

Commit

Permalink
docs: drivers: remove suggestion to assign driver_api in init function
Browse files Browse the repository at this point in the history
The driver API should be assigned at the time the device is defined.
Assigning in the init function is redundant and prevents moving the
pointer to a immutable driver structure.

Signed-off-by: Peter Bigot <[email protected]>
  • Loading branch information
pabigot authored and MaureenHelm committed Jun 16, 2020
1 parent 78f14aa commit ccc53f9
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions doc/reference/drivers/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -173,8 +173,7 @@ of these APIs, and populate an instance of subsystem_api structure:
};
The driver would then pass ``my_driver_api_funcs`` as the ``api`` argument to
``DEVICE_AND_API_INIT()``, or manually assign it to ``device->driver_api``
in the driver init function.
``DEVICE_AND_API_INIT()``.

.. note::

Expand Down

0 comments on commit ccc53f9

Please sign in to comment.