From nobody Tue Apr 7 16:30:10 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 73D8F3A4538; Thu, 12 Mar 2026 11:22:52 +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=1773314572; cv=none; b=SU85NbCogstl2VbFS4vcxn6FNckcaSBU06Nvew63dZvD5Rwb2hjC/okFmX0RG0eH2P9HwzEHl/dcMPFSoXonDfkG15Rx5iGjOhRbBdLnCUCfBguC01KnahxEytjfa2wx62TZGtLbd1PXPJR43WyGShGxp4tjSbpqxwAE2bYpwsM= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1773314572; c=relaxed/simple; bh=z1rSlolLYfZeTsgj5kSRFZv+4n7rmLPxLyxVyQctzMk=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=fRJWY/t77JVCpIvVCcl0t9zCSSBaiD1rDGZcI1NTFToQlPDBteVArEq798ZFzICgdzXAjMrMtAio/oCNMKSgkGrEdxhvi7comNm0ySLu0jLS1jUE/dnwmblcQlVglRMwBdFolCuRzKnoRkfZ8Ey7sTYa3qNoRPWvDlcET0pV3SU= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=tiuErgJb; 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="tiuErgJb" Received: by smtp.kernel.org (Postfix) with ESMTPSA id AC8B1C4CEF7; Thu, 12 Mar 2026 11:22:50 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1773314572; bh=z1rSlolLYfZeTsgj5kSRFZv+4n7rmLPxLyxVyQctzMk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=tiuErgJbcaf2f09+Ij3pExqRCSB0+ZNVd1BfkIJityTkoiTBx0xtupEIgZ3aKLt0V A7dfV34VnNrx28q1MHbr/Rf70XaruMrJTJEnQApMOmGaxTokSUkbzzhk3FeXGFY83D rEG958n2UtQIXhaWy4fVj8YZJZd4h3y6Y4kbDjAGmWhnQApz3uJO3+iDwuNcMH6knE czTn2KcZMpmFKA3Ef/mCTYjE1tHIxa0Q+I4WdQNCmQwO3RK+HCoh6CfpCC/zqLodfR iCUfqjAoakGGDxonJqFvr50mA0PckVK3xkGLG/zOT2fLsHZo/Kul0KR0gx+LwHtXAB EQRCnm8kmbRWQ== From: "Rafael J. Wysocki" To: Ilpo =?ISO-8859-1?Q?J=E4rvinen?= Cc: LKML , Linux ACPI , Hans de Goede , platform-driver-x86@vger.kernel.org, Kenneth Chan Subject: [PATCH v1 2/3] platform/x86: panasonic-laptop: Register ACPI notify handler directly Date: Thu, 12 Mar 2026 12:21:15 +0100 Message-ID: <4508640.ejJDZkT8p0@rafael.j.wysocki> Organization: Linux Kernel Development In-Reply-To: <3616223.QJadu78ljV@rafael.j.wysocki> References: <3616223.QJadu78ljV@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/platform/x86/panasonic-laptop.c | 20 +++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) diff --git a/drivers/platform/x86/panasonic-laptop.c b/drivers/platform/x86= /panasonic-laptop.c index 64195ff0f40e..4bd83b987761 100644 --- a/drivers/platform/x86/panasonic-laptop.c +++ b/drivers/platform/x86/panasonic-laptop.c @@ -185,7 +185,7 @@ enum SINF_BITS { SINF_NUM_BATTERIES =3D 0, =20 static int acpi_pcc_hotkey_add(struct acpi_device *device); static void acpi_pcc_hotkey_remove(struct acpi_device *device); -static void acpi_pcc_hotkey_notify(struct acpi_device *device, u32 event); +static void acpi_pcc_hotkey_notify(acpi_handle handle, u32 event, void *da= ta); =20 static const struct acpi_device_id pcc_device_ids[] =3D { { "MAT0012", 0}, @@ -208,7 +208,6 @@ static struct acpi_driver acpi_pcc_driver =3D { .ops =3D { .add =3D acpi_pcc_hotkey_add, .remove =3D acpi_pcc_hotkey_remove, - .notify =3D acpi_pcc_hotkey_notify, }, .drv.pm =3D &acpi_pcc_hotkey_pm, }; @@ -869,9 +868,9 @@ static void acpi_pcc_generate_keyinput(struct pcc_acpi = *pcc) pr_err("Unknown hotkey event: 0x%04llx\n", result); } =20 -static void acpi_pcc_hotkey_notify(struct acpi_device *device, u32 event) +static void acpi_pcc_hotkey_notify(acpi_handle handle, u32 event, void *da= ta) { - struct pcc_acpi *pcc =3D acpi_driver_data(device); + struct pcc_acpi *pcc =3D data; =20 switch (event) { case HKEY_NOTIFY: @@ -1073,13 +1072,18 @@ static int acpi_pcc_hotkey_add(struct acpi_device *= device) if (result) goto out_backlight; =20 + result =3D acpi_dev_install_notify_handler(device, ACPI_DEVICE_NOTIFY, + acpi_pcc_hotkey_notify, pcc); + if (result) + goto out_sysfs; + /* optical drive initialization */ if (ACPI_SUCCESS(check_optd_present())) { pcc->platform =3D platform_device_register_simple("panasonic", PLATFORM_DEVID_NONE, NULL, 0); if (IS_ERR(pcc->platform)) { result =3D PTR_ERR(pcc->platform); - goto out_sysfs; + goto out_notify_handler; } result =3D device_create_file(&pcc->platform->dev, &dev_attr_cdpower); @@ -1095,6 +1099,9 @@ static int acpi_pcc_hotkey_add(struct acpi_device *de= vice) =20 out_platform: platform_device_unregister(pcc->platform); +out_notify_handler: + acpi_dev_remove_notify_handler(device, ACPI_DEVICE_NOTIFY, + acpi_pcc_hotkey_notify); out_sysfs: sysfs_remove_group(&device->dev.kobj, &pcc_attr_group); out_backlight: @@ -1123,6 +1130,9 @@ static void acpi_pcc_hotkey_remove(struct acpi_device= *device) =20 sysfs_remove_group(&device->dev.kobj, &pcc_attr_group); =20 + acpi_dev_remove_notify_handler(device, ACPI_DEVICE_NOTIFY, + acpi_pcc_hotkey_notify); + backlight_device_unregister(pcc->backlight); =20 input_unregister_device(pcc->input_dev); --=20 2.51.0