Skip to contentSkip to conversation

Input: docs - Update according to the latest API changes

PATCH Applied Heikki Krogerus 2 participants 2 messages Mar 4, 2021 – Mar 21, 2021

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Input: docs - Update according to the latest API changes

The old device property API is about to be removed, so explaing how to use complete software nodes instead.

---
 Documentation/input/devices/rotary-encoder.rst | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)
Documentation/input/devices/rotary-encoder.rst +6 -2
index 810ae02bdaa0d..5865748c13b96 100644
@@ -107,13 +107,17 @@ example below:
 		},
 	};
 
-	static const struct property_entry rotary_encoder_properties[] __initconst = {
+	static const struct property_entry rotary_encoder_properties[] = {
 		PROPERTY_ENTRY_U32("rotary-encoder,steps-per-period", 24),
 		PROPERTY_ENTRY_U32("linux,axis",		      ABS_X),
 		PROPERTY_ENTRY_U32("rotary-encoder,relative_axis",    0),
 		{ },
 	};
 
+	static const struct software_node rotary_encoder_node = {
+		.properties = rotary_encoder_properties,
+	};
+
 	static struct platform_device rotary_encoder_device = {
 		.name		= "rotary-encoder",
 		.id		= 0,
@@ -122,7 +126,7 @@ example below:
 	...
 
 	gpiod_add_lookup_table(&rotary_encoder_gpios);
-	device_add_properties(&rotary_encoder_device, rotary_encoder_properties);
+	device_add_software_node(&rotary_encoder_device.dev, &rotary_encoder_node);
 	platform_device_register(&rotary_encoder_device);
 
 	...
Signature · 1 line
2.30.1
maintainer Applied
#1 lore raw
Quoted 4 lines · Heikki Krogerus

The old device property API is about to be removed, so explaing how to use complete software nodes instead.

Applied, thank you.

Signature · 1 line
Dmitry