* [PATCH] Input: iqs62x-keys - drop unused device node references
@ 2022-09-17 19:09 Jeff LaBundy
2022-09-21 8:14 ` Mattijs Korpershoek
2022-09-25 5:18 ` Dmitry Torokhov
0 siblings, 2 replies; 3+ messages in thread
From: Jeff LaBundy @ 2022-09-17 19:09 UTC (permalink / raw)
To: dmitry.torokhov; +Cc: linux-input, jeff
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")
Signed-off-by: Jeff LaBundy <jeff@labundy.com>
---
drivers/input/keyboard/iqs62x-keys.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/drivers/input/keyboard/iqs62x-keys.c b/drivers/input/keyboard/iqs62x-keys.c
index 93446b21f98f..db793a550c25 100644
--- a/drivers/input/keyboard/iqs62x-keys.c
+++ b/drivers/input/keyboard/iqs62x-keys.c
@@ -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;
--
2.34.1
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] Input: iqs62x-keys - drop unused device node references
2022-09-17 19:09 [PATCH] Input: iqs62x-keys - drop unused device node references Jeff LaBundy
@ 2022-09-21 8:14 ` Mattijs Korpershoek
2022-09-25 5:18 ` Dmitry Torokhov
1 sibling, 0 replies; 3+ messages in thread
From: Mattijs Korpershoek @ 2022-09-21 8:14 UTC (permalink / raw)
To: Jeff LaBundy, dmitry.torokhov; +Cc: linux-input, jeff
On sam., sept. 17, 2022 at 14:09, Jeff LaBundy <jeff@labundy.com> wrote:
> 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")
> Signed-off-by: Jeff LaBundy <jeff@labundy.com>
Reviewed-by: Mattijs Korpershoek <mkorpershoek@baylibre.com>
> ---
> drivers/input/keyboard/iqs62x-keys.c | 3 +++
> 1 file changed, 3 insertions(+)
>
> diff --git a/drivers/input/keyboard/iqs62x-keys.c b/drivers/input/keyboard/iqs62x-keys.c
> index 93446b21f98f..db793a550c25 100644
> --- a/drivers/input/keyboard/iqs62x-keys.c
> +++ b/drivers/input/keyboard/iqs62x-keys.c
> @@ -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;
> --
> 2.34.1
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] Input: iqs62x-keys - drop unused device node references
2022-09-17 19:09 [PATCH] Input: iqs62x-keys - drop unused device node references Jeff LaBundy
2022-09-21 8:14 ` Mattijs Korpershoek
@ 2022-09-25 5:18 ` Dmitry Torokhov
1 sibling, 0 replies; 3+ messages in thread
From: Dmitry Torokhov @ 2022-09-25 5:18 UTC (permalink / raw)
To: Jeff LaBundy; +Cc: linux-input
On Sat, Sep 17, 2022 at 02:09:22PM -0500, Jeff LaBundy wrote:
> 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")
> Signed-off-by: Jeff LaBundy <jeff@labundy.com>
Applied, thank you.
--
Dmitry
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2022-09-25 5:18 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-09-17 19:09 [PATCH] Input: iqs62x-keys - drop unused device node references Jeff LaBundy
2022-09-21 8:14 ` Mattijs Korpershoek
2022-09-25 5:18 ` Dmitry Torokhov
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.