linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] HID: i2c-hid: goodix: Use the devm variant of regulator_register_notifier()
@ 2021-07-20 16:07 Douglas Anderson
  2021-07-28  9:49 ` Jiri Kosina
  0 siblings, 1 reply; 2+ messages in thread
From: Douglas Anderson @ 2021-07-20 16:07 UTC (permalink / raw)
  To: Jiri Kosina, Benjamin Tissoires
  Cc: Douglas Anderson, linux-input, linux-kernel

In commit 18eeef46d359 ("HID: i2c-hid: goodix: Tie the reset line to
true state of the regulator") I added a call to
regulator_register_notifier() but no call to unregister. That's a
bug. Let's use the devm variant to handle the unregistering.

Fixes: 18eeef46d359 ("HID: i2c-hid: goodix: Tie the reset line to true state of the regulator")
Signed-off-by: Douglas Anderson <dianders@chromium.org>
---

 drivers/hid/i2c-hid/i2c-hid-of-goodix.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/hid/i2c-hid/i2c-hid-of-goodix.c b/drivers/hid/i2c-hid/i2c-hid-of-goodix.c
index 31a4c229fdb7..52674149a275 100644
--- a/drivers/hid/i2c-hid/i2c-hid-of-goodix.c
+++ b/drivers/hid/i2c-hid/i2c-hid-of-goodix.c
@@ -132,7 +132,7 @@ static int i2c_hid_of_goodix_probe(struct i2c_client *client,
 	 */
 	mutex_lock(&ihid_goodix->regulator_mutex);
 	ihid_goodix->nb.notifier_call = ihid_goodix_vdd_notify;
-	ret = regulator_register_notifier(ihid_goodix->vdd, &ihid_goodix->nb);
+	ret = devm_regulator_register_notifier(ihid_goodix->vdd, &ihid_goodix->nb);
 	if (ret) {
 		mutex_unlock(&ihid_goodix->regulator_mutex);
 		return dev_err_probe(&client->dev, ret,
-- 
2.32.0.402.g57bb445576-goog


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] HID: i2c-hid: goodix: Use the devm variant of regulator_register_notifier()
  2021-07-20 16:07 [PATCH] HID: i2c-hid: goodix: Use the devm variant of regulator_register_notifier() Douglas Anderson
@ 2021-07-28  9:49 ` Jiri Kosina
  0 siblings, 0 replies; 2+ messages in thread
From: Jiri Kosina @ 2021-07-28  9:49 UTC (permalink / raw)
  To: Douglas Anderson; +Cc: Benjamin Tissoires, linux-input, linux-kernel

On Tue, 20 Jul 2021, Douglas Anderson wrote:

> In commit 18eeef46d359 ("HID: i2c-hid: goodix: Tie the reset line to
> true state of the regulator") I added a call to
> regulator_register_notifier() but no call to unregister. That's a
> bug. Let's use the devm variant to handle the unregistering.
> 
> Fixes: 18eeef46d359 ("HID: i2c-hid: goodix: Tie the reset line to true state of the regulator")
> Signed-off-by: Douglas Anderson <dianders@chromium.org>
> ---
> 
>  drivers/hid/i2c-hid/i2c-hid-of-goodix.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/hid/i2c-hid/i2c-hid-of-goodix.c b/drivers/hid/i2c-hid/i2c-hid-of-goodix.c
> index 31a4c229fdb7..52674149a275 100644
> --- a/drivers/hid/i2c-hid/i2c-hid-of-goodix.c
> +++ b/drivers/hid/i2c-hid/i2c-hid-of-goodix.c
> @@ -132,7 +132,7 @@ static int i2c_hid_of_goodix_probe(struct i2c_client *client,
>  	 */
>  	mutex_lock(&ihid_goodix->regulator_mutex);
>  	ihid_goodix->nb.notifier_call = ihid_goodix_vdd_notify;
> -	ret = regulator_register_notifier(ihid_goodix->vdd, &ihid_goodix->nb);
> +	ret = devm_regulator_register_notifier(ihid_goodix->vdd, &ihid_goodix->nb);
>  	if (ret) {
>  		mutex_unlock(&ihid_goodix->regulator_mutex);
>  		return dev_err_probe(&client->dev, ret,

Applied, thanks Doug.

-- 
Jiri Kosina
SUSE Labs


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2021-07-28  9:49 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-07-20 16:07 [PATCH] HID: i2c-hid: goodix: Use the devm variant of regulator_register_notifier() Douglas Anderson
2021-07-28  9:49 ` Jiri Kosina

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).