From nobody Tue Apr 7 14:04:54 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 BE9642836A6; Wed, 25 Feb 2026 20:57:51 +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=1772053071; cv=none; b=g0AGkIFY38JoHIpjZdwqvVNFkOI4O26GTn0H2GWhdQbnFFQhabbIA3Z7DlzNhXeTKXlxU5FYo9kKoweiGl7f7VLNB7T+XCchS/TBqe6IJUe8D9yblgkqrio6A76sFFHGfolXjJUE1LF1rseunMwTeQZrWcvhDcPdhTKcVrwZ6Ns= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1772053071; c=relaxed/simple; bh=BgA1pSKN8OdCIWHIW4rKxdP9QWCuRmHVtYjERxrXfFo=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=XtD+csqkKDNxlCpgld0ECAXwx5U++PIO8SSQJOHanyJgImzGvcLlXzjFn15Otx6b1jTC5VbbG2eIymzM6OlzHigR9vzJ9+bdO2jgQwGWhMiDguu/phDGbfD6v+6Ow/t7GiMkfStKigqOgs2EC/UkK+3RnzMPbyRP3fIdyS7MJXs= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=DFWHV81p; 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="DFWHV81p" Received: by smtp.kernel.org (Postfix) with ESMTPSA id CDB18C19422; Wed, 25 Feb 2026 20:57:49 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1772053071; bh=BgA1pSKN8OdCIWHIW4rKxdP9QWCuRmHVtYjERxrXfFo=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=DFWHV81pUbuYs1wzkMpjZrur7sN6XKv+2NTD68eot5Wxnc9Dd2hvv8ET82Zdfjg+G V6DzvuvNiTNAv0dcTp5MZYjwRgCHn3MPN48sONT2lLI5RFwKLaWXAPxnYgzVRCf19k b96uN9fMMWAG5L983klO4nO9blMBAzJ8GOa1RC6TE9asJYiuHDcXy8u3t4o3w6Y+IT adZ0Qh1Li23ZpXRUBYhY/Njh2dEfokXMncJCiO6Act8/oCu3P4rpPmjQu6bxgu91c3 7a9ZsewZ130DHkhgwKUV+sbNqBuhNufSLzs6DZ32UxxQVZS9iKdVN+sEX2ZvIJ2tHX CIghJgMgJ3b8w== 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 1/5] platform/x86: fujitsu-tablet: Convert ACPI driver to a platform one Date: Wed, 25 Feb 2026 21:42:18 +0100 Message-ID: <13976436.uLZWGnKmhe@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" 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 --- 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