OSDN Git Service

docs: driver-model: device: Add DEVICE_ATTR_{RO,RW} examples
authorGeert Uytterhoeven <geert+renesas@glider.be>
Wed, 3 Mar 2021 13:38:44 +0000 (14:38 +0100)
committerJonathan Corbet <corbet@lwn.net>
Tue, 9 Mar 2021 00:06:56 +0000 (17:06 -0700)
commitd944f0b1156c87c2c1994befab72816457ec738d
tree8142afaab2ff2ee531edc4f94bc20a594b785ce5
parent0e2c578cba9d83663cce1abe584d65364408f0b5
docs: driver-model: device: Add DEVICE_ATTR_{RO,RW} examples

bus.rst, driver.rst, and hwmon-kernel-api.rst refer to the
DEVICE_ATTR_* macros for devices, but device.rst does not mention them.

Add a paragraph about these helper macros, and use them in the examples.
Retain the old description, as it is still useful for less common values
of mode.  Change the names of the example "show" and "store" methods, to
match the expectations of the DEVICE_ATTR_* macros.

Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
Reviewed-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Link: https://lore.kernel.org/r/20210303133845.3939403-2-geert+renesas@glider.be
Signed-off-by: Jonathan Corbet <corbet@lwn.net>
Documentation/driver-api/driver-model/device.rst