From nobody Thu Apr 16 08:38:18 2026 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 28ED032A3C8; Sun, 1 Mar 2026 13:19:23 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1772371164; cv=none; b=mcgXSKGgOeIQr3CFpwiiS7Nc3QNjTqKSWdUkm42TdmoTYu9zIT14dmSnBVqpBwa+SbOJ65ppcf7GKSt6KJz/hYfWr6xFAeLs5REXSZwe85WT7Rwuvf0ckbTJIvMStLE4PrM8yagU4/sPC4ioP2sCI05qZ9P+pgbMjE0fVF7HAxI= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1772371164; c=relaxed/simple; bh=dKbSZWGkV+9YvBcXlPsY6rM8RsIlY+f96SCmMpS3KH8=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=sXGMFF+iZ+c4gI882+aA+wfDSgWvZ4TDnO7CAUqKQg6O7gy/A96pHOk2EGkrX0b6nyz9q8qkPPMdSHjaPJNeraAF7ruRGW5XRqXYeVefqFseAJwtLtkYyiFeu7CFOOIDFAr57vzusGacX1ON2BFwCMAI6a0Fa3EWvCYAB1LRS44= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=T/xQCccd; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="T/xQCccd" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 66504C116C6; Sun, 1 Mar 2026 13:19:22 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1772371163; bh=dKbSZWGkV+9YvBcXlPsY6rM8RsIlY+f96SCmMpS3KH8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=T/xQCccdhf18cDC93RJdXFQKBHgBzSNsurLCp5NRTiEOC7BjQqYoAQaDZRPkXRRwE 2VP+cx9qOqaF/Vqo0CnkV6xI1vJOYNqTSeGG1tQbxHhg8Nx+PN6J8dG+97045pmNOc 7u54tQZFz6pU22L9ARdCY6J8AQ1dQkhlPkEi3fCNptX1LXTTLTR2AZh6DNnYs2YrXR Kn8x+GAZx3lhssj2qgHutQD6ABbqTskhRBYesZ5MXLfs84yP5PUya5c1McjDOdUP1g ECpBNH2Y+yZrSAZZ5QY/0J1G1RGku1bcmobK3H1horVVNwGH0NCdzf/VSEXPE/00xT 58wvq9hF2+hhg== From: "Rafael J. Wysocki" To: Guenter Roeck Cc: Jaroslav Pulchart , LKML , Linux ACPI , linux-hwmon@vger.kernel.org Subject: [PATCH v1 2/3] hwmon: (acpi_power_meter) Register ACPI notify handler directly Date: Sun, 01 Mar 2026 14:18:05 +0100 Message-ID: <2405555.ElGaqSPkdT@rafael.j.wysocki> Organization: Linux Kernel Development In-Reply-To: <5974797.DvuYhMxLoT@rafael.j.wysocki> References: <5974797.DvuYhMxLoT@rafael.j.wysocki> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" From: "Rafael J. Wysocki" To facilitate subsequent conversion of the driver to a platform one, make it install an ACPI notify handler directly instead of using a .notify() callback in struct acpi_driver. No intentional functional impact. Signed-off-by: Rafael J. Wysocki --- drivers/hwmon/acpi_power_meter.c | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/drivers/hwmon/acpi_power_meter.c b/drivers/hwmon/acpi_power_me= ter.c index 49e57c20ef70..c010f55f7c7b 100644 --- a/drivers/hwmon/acpi_power_meter.c +++ b/drivers/hwmon/acpi_power_meter.c @@ -814,8 +814,9 @@ static int read_capabilities(struct acpi_power_meter_re= source *resource) } =20 /* Handle ACPI event notifications */ -static void acpi_power_meter_notify(struct acpi_device *device, u32 event) +static void acpi_power_meter_notify(acpi_handle handle, u32 event, void *d= ata) { + struct acpi_device *device =3D data; struct acpi_power_meter_resource *resource =3D acpi_driver_data(device); int res; =20 @@ -936,9 +937,16 @@ static int acpi_power_meter_add(struct acpi_device *de= vice) goto exit_remove; } =20 + res =3D acpi_dev_install_notify_handler(device, ACPI_DEVICE_NOTIFY, + acpi_power_meter_notify, device); + if (res) + goto exit_hwmon; + res =3D 0; goto exit; =20 +exit_hwmon: + hwmon_device_unregister(resource->hwmon_dev); exit_remove: remove_domain_devices(resource); exit_free_capability: @@ -953,6 +961,9 @@ static void acpi_power_meter_remove(struct acpi_device = *device) { struct acpi_power_meter_resource *resource =3D acpi_driver_data(device); =20 + acpi_dev_remove_notify_handler(device, ACPI_DEVICE_NOTIFY, + acpi_power_meter_notify); + if (!IS_ERR(resource->hwmon_dev)) hwmon_device_unregister(resource->hwmon_dev); =20 @@ -984,7 +995,6 @@ static struct acpi_driver acpi_power_meter_driver =3D { .ops =3D { .add =3D acpi_power_meter_add, .remove =3D acpi_power_meter_remove, - .notify =3D acpi_power_meter_notify, }, .drv.pm =3D pm_sleep_ptr(&acpi_power_meter_pm), }; --=20 2.51.0