提交 a27e51b4 编写于 作者: N Nelson Penn 提交者: Jonathan Corbet

documentation: Format button_dev as a pointer.

The docs on creating an input device driver have an example in which
button_dev is a pointer to an input_dev struct. However, in two code
snippets below, button_dev is used as if it is not a pointer. Make these
occurrences of button_dev reflect that it is a pointer.
Signed-off-by: NNelson Penn <nelsonapenn@protonmail.com>
Link: https://lore.kernel.org/r/20220522194953.12097-1-nelsonapenn@protonmail.comSigned-off-by: NJonathan Corbet <corbet@lwn.net>
上级 6199e138
...@@ -85,15 +85,15 @@ accepted by this input device. Our example device can only generate EV_KEY ...@@ -85,15 +85,15 @@ accepted by this input device. Our example device can only generate EV_KEY
type events, and from those only BTN_0 event code. Thus we only set these type events, and from those only BTN_0 event code. Thus we only set these
two bits. We could have used:: two bits. We could have used::
set_bit(EV_KEY, button_dev.evbit); set_bit(EV_KEY, button_dev->evbit);
set_bit(BTN_0, button_dev.keybit); set_bit(BTN_0, button_dev->keybit);
as well, but with more than single bits the first approach tends to be as well, but with more than single bits the first approach tends to be
shorter. shorter.
Then the example driver registers the input device structure by calling:: Then the example driver registers the input device structure by calling::
input_register_device(&button_dev); input_register_device(button_dev);
This adds the button_dev structure to linked lists of the input driver and This adds the button_dev structure to linked lists of the input driver and
calls device handler modules _connect functions to tell them a new input calls device handler modules _connect functions to tell them a new input
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册