mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Eliav Farber <farbere@amazon.com>
To: "Rafael J. Wysocki" <rafael@kernel.org>,
	"Dmitry Torokhov" <dmitry.torokhov@gmail.com>,
	"Laurent Pinchart" <laurent.pinchart@ideasonboard.com>,
	"Hans de Goede" <hansg@kernel.org>,
	"Ilpo Järvinen" <ilpo.jarvinen@linux.intel.com>,
	"Armin Wolf" <W_Armin@gmx.de>,
	"Sebastian Reichel" <sre@kernel.org>,
	"Andrew Morton" <akpm@linux-foundation.org>
Cc: "Eliav Farber" <farbere@amazon.com>,
	platform-driver-x86@vger.kernel.org,
	linux-kernel@vger.kernel.org,
	"Uwe Kleine-König" <ukleinek@kernel.org>
Subject: [PATCH v6 5/7] platform/x86: uniwill-wmi: use devm_blocking_notifier_chain_register()
Date: Fri, 13 Nov 2026 10:44:53 +0000	[thread overview]
Message-ID: <20261113104459.35839-1-farbere@amazon.com> (raw)

Replace the blocking_notifier_chain_register() +
devm_add_action_or_reset() pattern with a single call to
devm_blocking_notifier_chain_register(), removing the
devm_uniwill_wmi_unregister_notifier() callback.

Signed-off-by: Eliav Farber <farbere@amazon.com>
Reviewed-by: Armin Wolf <W_Armin@gmx.de>
---
Changes in v6:
- Rebased onto v7.4-rc1. No functional change since v5.
- Armin Wolf's Reviewed-by retained; the code is unchanged since v4,
  when it was given.

devm_uniwill_wmi_register_notifier() is kept rather than having
uniwill-acpi.c call devm_blocking_notifier_chain_register() directly,
because uniwill_wmi_chain_head is static to uniwill-wmi.c and dropping
the wrapper would mean exposing it in uniwill-wmi.h. Discussed with Uwe
Kleine-Koenig on v4.

 drivers/platform/x86/uniwill/uniwill-wmi.c | 17 +++--------------
 1 file changed, 3 insertions(+), 14 deletions(-)

diff --git a/drivers/platform/x86/uniwill/uniwill-wmi.c b/drivers/platform/x86/uniwill/uniwill-wmi.c
index afcbfa4f7552..2ffa29a829ee 100644
--- a/drivers/platform/x86/uniwill/uniwill-wmi.c
+++ b/drivers/platform/x86/uniwill/uniwill-wmi.c
@@ -26,22 +26,11 @@
 
 static BLOCKING_NOTIFIER_HEAD(uniwill_wmi_chain_head);
 
-static void devm_uniwill_wmi_unregister_notifier(void *data)
-{
-	struct notifier_block *nb = data;
-
-	blocking_notifier_chain_unregister(&uniwill_wmi_chain_head, nb);
-}
-
 int devm_uniwill_wmi_register_notifier(struct device *dev, struct notifier_block *nb)
 {
-	int ret;
-
-	ret = blocking_notifier_chain_register(&uniwill_wmi_chain_head, nb);
-	if (ret < 0)
-		return ret;
-
-	return devm_add_action_or_reset(dev, devm_uniwill_wmi_unregister_notifier, nb);
+	return devm_blocking_notifier_chain_register(dev,
+						     &uniwill_wmi_chain_head,
+						     nb);
 }
 
 static void uniwill_wmi_notify(struct wmi_device *wdev, union acpi_object *obj)
-- 
2.47.3


             reply	other threads:[~2026-11-13 10:45 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-13 10:44 Eliav Farber [this message]
2026-11-13 10:44 ` [PATCH v6 6/7] reboot: " Eliav Farber
2026-11-13 11:10   ` Eliav Farber
2026-11-13 10:44 ` [PATCH v6 7/7] power: supply: cros_pchg: " Eliav Farber
2026-11-13 11:10   ` Eliav Farber
2026-11-13 11:10 ` [PATCH v6 5/7] platform/x86: uniwill-wmi: " Eliav Farber
2026-11-13 11:46 ` Ilpo Järvinen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20261113104459.35839-1-farbere@amazon.com \
    --to=farbere@amazon.com \
    --cc=W_Armin@gmx.de \
    --cc=akpm@linux-foundation.org \
    --cc=dmitry.torokhov@gmail.com \
    --cc=hansg@kernel.org \
    --cc=ilpo.jarvinen@linux.intel.com \
    --cc=laurent.pinchart@ideasonboard.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=platform-driver-x86@vger.kernel.org \
    --cc=rafael@kernel.org \
    --cc=sre@kernel.org \
    --cc=ukleinek@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®