From nobody Tue Apr 7 14:04:29 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 B81052DC789; Wed, 25 Feb 2026 20:57:43 +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=1772053063; cv=none; b=eCaFftqgI1OAmAGLGQGXcudQOnlLhC6FJGSigr+90OzPiwOQwrdnYUU+BoVrRWmRN8Kajp9IgKDvrcmM4Fwox3V6g8gU1fQeoTLaEj7Zbo/nH7aWDA+TlzNRg99OUURmB1ufLaI43nqK3jzvcQNIwMER19TEzHgLNrolz0XGrIE= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1772053063; c=relaxed/simple; bh=PAs1bGrn2mdKOWRmzEaVX6nloInZtadGhLhSZt/+Vd0=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=DiOBzy0owsk9YnJdjm2qSG8MVqNE0Dn+XnL5paG8dMKfm/T1dIXitR4EHvo0vzHByN6RhHKcXp9jCkDUWdwnV5ZFFjlxvfdSsJJI5jpdSAMdBFNUUhcpc0kW4lTIhrGLnlFZIji8hbv750NlzL5nIMy9jAddgL07XQsUtVtrhiA= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=BmGjk/EK; 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="BmGjk/EK" Received: by smtp.kernel.org (Postfix) with ESMTPSA id B8578C116D0; Wed, 25 Feb 2026 20:57:41 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1772053063; bh=PAs1bGrn2mdKOWRmzEaVX6nloInZtadGhLhSZt/+Vd0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=BmGjk/EKyTJP0jPdPWx7zQCAjw6cvZWezt5plX4oNKADWK3j5ezvu/7T9isyxNh23 Rjkc/96CC6wt7TgghE4mQglFWBOVQY5SwJPy74FhA0GRC3/oAk1wSQ9xffTRaNUJhN 40OTybxWgCM8ACU+tfoRbTPomu8YGXBL0m0n82TOOCSritq0rgoP5eipmneMHqfLz6 EDt0EZ+j0VL5wF8IcKheOcseHwlGhiKwrr8a/F11BPb9ZGhJI57hlbFu6SxKA81xE8 qrCL6oOkSGo3WPF0Gp4+o/Fkdl/WXfpiseTJAj+8xwuvwLOJQYuB6wRGZ3YGeQAGrv JFTII+AiFjFhg== From: "Rafael J. Wysocki" To: Ilpo =?ISO-8859-1?Q?J=E4rvinen?= Cc: Robert Gerlach , Hans de Goede , LKML , Linux ACPI , platform-driver-x86@vger.kernel.org, Jonathan Woithe Subject: [PATCH v1 3/5] platform/x86: fujitsu: Register ACPI notify handlers directly Date: Wed, 25 Feb 2026 21:47:07 +0100 Message-ID: <10828467.nUPlyArG6x@rafael.j.wysocki> Organization: Linux Kernel Development In-Reply-To: <1968442.tdWV9SEqCh@rafael.j.wysocki> References: <1968442.tdWV9SEqCh@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 using struct platform_driver instead of struct acpi_driver, make it install its ACPI notify handlers directly instead of using struct acpi_driver .notify() callbacks. No intentional functional impact. Signed-off-by: Rafael J. Wysocki --- drivers/platform/x86/fujitsu-laptop.c | 30 ++++++++++++++++++++++----- 1 file changed, 25 insertions(+), 5 deletions(-) diff --git a/drivers/platform/x86/fujitsu-laptop.c b/drivers/platform/x86/f= ujitsu-laptop.c index 1adce90ae3e6..cb13c06b8f35 100644 --- a/drivers/platform/x86/fujitsu-laptop.c +++ b/drivers/platform/x86/fujitsu-laptop.c @@ -502,8 +502,9 @@ static int fujitsu_backlight_register(struct acpi_devic= e *device) =20 /* Brightness notify */ =20 -static void acpi_fujitsu_bl_notify(struct acpi_device *device, u32 event) +static void acpi_fujitsu_bl_notify(acpi_handle handle, u32 event, void *da= ta) { + struct acpi_device *device =3D data; struct fujitsu_bl *priv =3D acpi_driver_data(device); int oldb, newb; =20 @@ -558,7 +559,18 @@ static int acpi_fujitsu_bl_add(struct acpi_device *dev= ice) if (ret) return ret; =20 - return fujitsu_backlight_register(device); + ret =3D fujitsu_backlight_register(device); + if (ret) + return ret; + + return acpi_dev_install_notify_handler(device, ACPI_DEVICE_NOTIFY, + acpi_fujitsu_bl_notify, device); +} + +static void acpi_fujitsu_bl_remove(struct acpi_device *device) +{ + acpi_dev_remove_notify_handler(device, ACPI_DEVICE_NOTIFY, + acpi_fujitsu_bl_notify); } =20 /* ACPI device for hotkey handling */ @@ -941,8 +953,9 @@ static void acpi_fujitsu_laptop_release(struct acpi_dev= ice *device) } } =20 -static void acpi_fujitsu_laptop_notify(struct acpi_device *device, u32 eve= nt) +static void acpi_fujitsu_laptop_notify(acpi_handle handle, u32 event, void= *data) { + struct acpi_device *device =3D data; struct fujitsu_laptop *priv =3D acpi_driver_data(device); unsigned long flags; int scancode, i =3D 0; @@ -1056,6 +1069,11 @@ static int acpi_fujitsu_laptop_add(struct acpi_devic= e *device) if (ret) goto err_free_fifo; =20 + ret =3D acpi_dev_install_notify_handler(device, ACPI_DEVICE_NOTIFY, + acpi_fujitsu_laptop_notify, device); + if (ret) + goto err_free_fifo; + ret =3D fujitsu_battery_charge_control_add(device); if (ret < 0) pr_warn("Unable to register battery charge control: %d\n", ret); @@ -1074,6 +1092,9 @@ static void acpi_fujitsu_laptop_remove(struct acpi_de= vice *device) =20 fujitsu_battery_charge_control_remove(device); =20 + acpi_dev_remove_notify_handler(device, ACPI_DEVICE_NOTIFY, + acpi_fujitsu_laptop_notify); + fujitsu_laptop_platform_remove(device); =20 kfifo_free(&priv->fifo); @@ -1092,7 +1113,7 @@ static struct acpi_driver acpi_fujitsu_bl_driver =3D { .ids =3D fujitsu_bl_device_ids, .ops =3D { .add =3D acpi_fujitsu_bl_add, - .notify =3D acpi_fujitsu_bl_notify, + .remove =3D acpi_fujitsu_bl_remove, }, }; =20 @@ -1108,7 +1129,6 @@ static struct acpi_driver acpi_fujitsu_laptop_driver = =3D { .ops =3D { .add =3D acpi_fujitsu_laptop_add, .remove =3D acpi_fujitsu_laptop_remove, - .notify =3D acpi_fujitsu_laptop_notify, }, }; =20 --=20 2.51.0