Skip to contentSkip to conversation

Input: iqs62x-keys - drop unused device node references

PATCH Applied Jeff LaBundy 3 participants 3 messages Sep 17, 2022 – Sep 25, 2022

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

PATCH 1/1 Input: iqs62x-keys - drop unused device node references

Each call to device/fwnode_get_named_child_node() must be matched with a call to fwnode_handle_put() once the corresponding node is no longer in use. This ensures a reference count remains balanced in the case of dynamic device tree support.

Currently, the driver never calls fwnode_handle_put(). This patch adds the missing calls.

Fixes ce1cb0eec85b ("input: keyboard: Add support for Azoteq IQS620A/621/622/624/625")
---
 drivers/input/keyboard/iqs62x-keys.c | 3 +++
 1 file changed, 3 insertions(+)
drivers/input/keyboard/iqs62x-keys.c +3 -0
index 93446b21f98f..db793a550c25 100644
@@ -77,6 +77,7 @@ static int iqs62x_keys_parse_prop(struct platform_device *pdev,
 		if (ret) {
 			dev_err(&pdev->dev, "Failed to read switch code: %d\n",
 				ret);
+			fwnode_handle_put(child);
 			return ret;
 		}
 		iqs62x_keys->switches[i].code = val;
@@ -90,6 +91,8 @@ static int iqs62x_keys_parse_prop(struct platform_device *pdev,
 			iqs62x_keys->switches[i].flag = (i == IQS62X_SW_HALL_N ?
 							 IQS62X_EVENT_HALL_N_T :
 							 IQS62X_EVENT_HALL_S_T);
+
+		fwnode_handle_put(child);
 	}
 
 	return 0;
Signature · 1 line
2.34.1
Reviewed-by on v1 1/1
#1 lore raw
Quoted 10 lines · Jeff LaBundy

Each call to device/fwnode_get_named_child_node() must be matched with a call to fwnode_handle_put() once the corresponding node is no longer in use. This ensures a reference count remains balanced in the case of dynamic device tree support.

Currently, the driver never calls fwnode_handle_put(). This patch adds the missing calls.

Fixes ce1cb0eec85b ("input: keyboard: Add support for Azoteq IQS620A/621/622/624/625")
Quoted 27 lines
---
 drivers/input/keyboard/iqs62x-keys.c | 3 +++
 1 file changed, 3 insertions(+)
drivers/input/keyboard/iqs62x-keys.c +3 -0
index 93446b21f98f..db793a550c25 100644
@@ -77,6 +77,7 @@ static int iqs62x_keys_parse_prop(struct platform_device *pdev,
 		if (ret) {
 			dev_err(&pdev->dev, "Failed to read switch code: %d\n",
 				ret);
+			fwnode_handle_put(child);
 			return ret;
 		}
 		iqs62x_keys->switches[i].code = val;
@@ -90,6 +91,8 @@ static int iqs62x_keys_parse_prop(struct platform_device *pdev,
 			iqs62x_keys->switches[i].flag = (i == IQS62X_SW_HALL_N ?
 							 IQS62X_EVENT_HALL_N_T :
 							 IQS62X_EVENT_HALL_S_T);
+
+		fwnode_handle_put(child);
 	}
 
 	return 0;
Signature · 1 line
2.34.1
maintainer Applied
#2 lore raw
In reply to Jeff LaBundy
Quoted 10 lines · Jeff LaBundy

Each call to device/fwnode_get_named_child_node() must be matched with a call to fwnode_handle_put() once the corresponding node is no longer in use. This ensures a reference count remains balanced in the case of dynamic device tree support.

Currently, the driver never calls fwnode_handle_put(). This patch adds the missing calls.

Fixes ce1cb0eec85b ("input: keyboard: Add support for Azoteq IQS620A/621/622/624/625")

Applied, thank you.

Signature · 1 line
Dmitry