From nobody Thu Apr 9 10:32:02 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 572C73E715E; Mon, 9 Mar 2026 17:11:42 +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=1773076302; cv=none; b=U7hx/92fGZW6zYuJR4n5CA3I3kEug4xLwg9JZZd1vo2azLt3ewoi4QrTavx5fK4TN6NyiHTKdMDdkGf13jKg8nTi1Pq0KK14KrrfT0Z9LftmCbZmJUDqzQazISRjK7efvyd3+e435VOD/+Za/sjYyFPIJMzf1tFg+EZGTqSMqJM= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1773076302; c=relaxed/simple; bh=jsiZ72dH4C7CJpXRgfCL0JKV94O6etWwx7WY1HmnX90=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=EJoI9xtmD/hX+5gmzkGK0/lp649wuCfimQzguOTsKxg5urMzQgOObp/yHhMEJnH1ZKhM5Z4iFMOfvCGzAZasLnC4Khj1MKjhA3Qi624XspRZWxl8Z/3Yo10L4WiZxFO+g/220WpGsIcMDuPGF6FHHWN0Ys3FA2g+xdHbh+KcUrI= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=cDoME29N; 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="cDoME29N" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 487C3C4CEF7; Mon, 9 Mar 2026 17:11:40 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1773076302; bh=jsiZ72dH4C7CJpXRgfCL0JKV94O6etWwx7WY1HmnX90=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=cDoME29NKgsYmu22hndzrcXkxRMq6Sjc5OJuiO+uR+lgpui8foY9gMiAqJeqfk1aj 3tr1+3YwM+8Ua9+NotAF25zqzESig/B/LNbdGn0ZClVd+Hz+GlgFii3HRmmVzVfn+m uMfOKmbutbi3YVNuMSVL6y4QCvG9NXKyHivuefxaUS5IBng/yeINAG3a7N2oj2Qmzf ifn6jLYVzdeCXgjrKThCz7AgsNR07WZWpaFjjbcVL+Vl8ErG6M2C2sz2VNY/O9yple GDD+OoIBBuYPVdvw4nU8Bg+bYIZhW5LLgTQhtGBFZdPIn3knziblsngFwU2Gq9Chdt ZoyArvZy1cljQ== 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 v2 1/5] platform/x86: fujitsu-tablet: Convert ACPI driver to a platform one Date: Mon, 09 Mar 2026 18:04:15 +0100 Message-ID: <6257931.lOV4Wx5bFT@rafael.j.wysocki> Organization: Linux Kernel Development In-Reply-To: <12863082.O9o76ZdvQC@rafael.j.wysocki> References: <12863082.O9o76ZdvQC@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" In all cases in which a struct acpi_driver is used for binding a driver to an ACPI device object, a corresponding platform device is created by the ACPI core and that device is regarded as a proper representation of underlying hardware. Accordingly, a struct platform_driver should be used by driver code to bind to that device. There are multiple reasons why drivers should not bind directly to ACPI device objects [1]. Overall, it is better to bind drivers to platform devices than to their ACPI companions, so convert the fujitsu-tablet ACPI driver to a platform one. After this change, the subordinate input device will be registered under the platform device used for driver binding instead of its ACPI companion. While this is not expected to alter functionality, it changes sysfs layout and so it will be visible to user space. Link: https://lore.kernel.org/all/2396510.ElGaqSPkdT@rafael.j.wysocki/ [1] Signed-off-by: Rafael J. Wysocki --- v1 -> v2: No changes --- drivers/platform/x86/fujitsu-tablet.c | 30 +++++++++++++-------------- 1 file changed, 14 insertions(+), 16 deletions(-) diff --git a/drivers/platform/x86/fujitsu-tablet.c b/drivers/platform/x86/f= ujitsu-tablet.c index 17f08ce7552d..8319df28e9b8 100644 --- a/drivers/platform/x86/fujitsu-tablet.c +++ b/drivers/platform/x86/fujitsu-tablet.c @@ -18,6 +18,7 @@ #include #include #include +#include =20 #define MODULENAME "fujitsu-tablet" =20 @@ -442,14 +443,12 @@ static acpi_status fujitsu_walk_resources(struct acpi= _resource *res, void *data) } } =20 -static int acpi_fujitsu_add(struct acpi_device *adev) +static int acpi_fujitsu_probe(struct platform_device *pdev) { + struct acpi_device *adev =3D ACPI_COMPANION(&pdev->dev); acpi_status status; int error; =20 - if (!adev) - return -EINVAL; - status =3D acpi_walk_resources(adev->handle, METHOD_NAME__CRS, fujitsu_walk_resources, NULL); if (ACPI_FAILURE(status) || !fujitsu.irq || !fujitsu.io_base) @@ -461,7 +460,7 @@ static int acpi_fujitsu_add(struct acpi_device *adev) snprintf(fujitsu.phys, sizeof(fujitsu.phys), "%s/input0", acpi_device_hid(adev)); =20 - error =3D input_fujitsu_setup(&adev->dev, + error =3D input_fujitsu_setup(&pdev->dev, acpi_device_name(adev), fujitsu.phys); if (error) return error; @@ -484,7 +483,7 @@ static int acpi_fujitsu_add(struct acpi_device *adev) return 0; } =20 -static void acpi_fujitsu_remove(struct acpi_device *adev) +static void acpi_fujitsu_remove(struct platform_device *pdev) { free_irq(fujitsu.irq, fujitsu_interrupt); release_region(fujitsu.io_base, fujitsu.io_length); @@ -501,15 +500,14 @@ static int acpi_fujitsu_resume(struct device *dev) =20 static SIMPLE_DEV_PM_OPS(acpi_fujitsu_pm, NULL, acpi_fujitsu_resume); =20 -static struct acpi_driver acpi_fujitsu_driver =3D { - .name =3D MODULENAME, - .class =3D "hotkey", - .ids =3D fujitsu_ids, - .ops =3D { - .add =3D acpi_fujitsu_add, - .remove =3D acpi_fujitsu_remove, +static struct platform_driver acpi_fujitsu_driver =3D { + .probe =3D acpi_fujitsu_probe, + .remove =3D acpi_fujitsu_remove, + .driver =3D { + .name =3D MODULENAME, + .acpi_match_table =3D fujitsu_ids, + .pm =3D &acpi_fujitsu_pm, }, - .drv.pm =3D &acpi_fujitsu_pm, }; =20 static int __init fujitsu_module_init(void) @@ -518,7 +516,7 @@ static int __init fujitsu_module_init(void) =20 dmi_check_system(dmi_ids); =20 - error =3D acpi_bus_register_driver(&acpi_fujitsu_driver); + error =3D platform_driver_register(&acpi_fujitsu_driver); if (error) return error; =20 @@ -527,7 +525,7 @@ static int __init fujitsu_module_init(void) =20 static void __exit fujitsu_module_exit(void) { - acpi_bus_unregister_driver(&acpi_fujitsu_driver); + platform_driver_unregister(&acpi_fujitsu_driver); } =20 module_init(fujitsu_module_init); --=20 2.51.0