From nobody Sat Apr 18 11:13:03 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 A29CE47886F; Sat, 28 Feb 2026 15:23:16 +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=1772292196; cv=none; b=S1T2m/Kq9Ag4td3+mCPvFrIl6NfBFpU+oOmojRe+AXqDdQEmVUscixdSBPWTsARxmYQ9wqeLwZK41uJ7A3E+XMJxDd8Pao6mJWg5p9rdzZbCmveox+ZCVGUVR9q2zcQHjp9oZNkz/+f4nK+Gc5/C6Y7DfGxBa6JszIBc4AJf5Bo= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1772292196; c=relaxed/simple; bh=27G9CaD5VzPScTm1yyVmEAsqi6Ii4PfqkqV3NlV/OCM=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=Y/aIkdt3tk//JtX9JfWD671YeECpGQG4F1mfnpwPH30EC1rV01O1aq0YYjswd6ePAs0jl0gb4aFj6kRKxgoAQTYyl/9LeK5VpcNds0kfYMhERswcRJsGbzJyvPpPuSX8+cTFlTi+DVG9TmtJ3q2RxjoyguZfpixon0/qa9S/X4Q= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=tqmlCoQ5; 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="tqmlCoQ5" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 72A2BC116D0; Sat, 28 Feb 2026 15:23:14 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1772292196; bh=27G9CaD5VzPScTm1yyVmEAsqi6Ii4PfqkqV3NlV/OCM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=tqmlCoQ5abpyj5/aTeYcag5HRexRcZEpX1nWMddMyGBIWkJeOSShfMhu4qI5sPtuw fHCjAt2zszFs/H9KUAzYhPoB1QBA8+SrPayRW17NNDEM5QF+mkwODUvkf3/HCJ7od4 va7xO5FcWreqMyj+iQlAzd0RLa/jB6Ql9G+7pyTq1qa4qP9lTyhaUcBRK/38j7tCKl bkqsYbdVrJI1sJrH/5vS5JaaNscj8Oq1K1zM/OlXsJ7EBTApandS+Jucc0/R32yqWh 52ryC1xtyuC3EnHUnfQ9aZtwJ4lXMLkZ0m6l5BE4vevm0TzGCFvrk4SmuFZxUiXIcI IKNYdDG6d0K9Q== From: "Rafael J. Wysocki" To: Ilpo =?ISO-8859-1?Q?J=E4rvinen?= Cc: Hans de Goede , LKML , Linux ACPI , platform-driver-x86@vger.kernel.org, Corentin Chary , "Luke D. Jones" , Denis Benato Subject: [PATCH v1 2/2] platform/x86: eeepc-laptop: Convert ACPI driver to a platform one Date: Sat, 28 Feb 2026 16:22:54 +0100 Message-ID: <3329436.5fSG56mABF@rafael.j.wysocki> Organization: Linux Kernel Development In-Reply-To: <7916328.EvYhyI6sBW@rafael.j.wysocki> References: <7916328.EvYhyI6sBW@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 EEEPC laptop ACPI driver to a platform one. 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 Reviewed-by: Denis Benato --- drivers/platform/x86/eeepc-laptop.c | 32 +++++++++++++++-------------- 1 file changed, 17 insertions(+), 15 deletions(-) diff --git a/drivers/platform/x86/eeepc-laptop.c b/drivers/platform/x86/eee= pc-laptop.c index 626a99a71fce..02a71095920e 100644 --- a/drivers/platform/x86/eeepc-laptop.c +++ b/drivers/platform/x86/eeepc-laptop.c @@ -1361,8 +1361,9 @@ static void eeepc_enable_camera(struct eeepc_laptop *= eeepc) =20 static bool eeepc_device_present; =20 -static int eeepc_acpi_add(struct acpi_device *device) +static int eeepc_acpi_probe(struct platform_device *pdev) { + struct acpi_device *device =3D ACPI_COMPANION(&pdev->dev); struct eeepc_laptop *eeepc; int result; =20 @@ -1373,9 +1374,10 @@ static int eeepc_acpi_add(struct acpi_device *device) eeepc->handle =3D device->handle; strscpy(acpi_device_name(device), EEEPC_ACPI_DEVICE_NAME); strscpy(acpi_device_class(device), EEEPC_ACPI_CLASS); - device->driver_data =3D eeepc; eeepc->device =3D device; =20 + platform_set_drvdata(pdev, eeepc); + eeepc->hotplug_disabled =3D hotplug_disabled; =20 eeepc_dmi_check(eeepc); @@ -1448,11 +1450,12 @@ static int eeepc_acpi_add(struct acpi_device *devic= e) return result; } =20 -static void eeepc_acpi_remove(struct acpi_device *device) +static void eeepc_acpi_remove(struct platform_device *pdev) { - struct eeepc_laptop *eeepc =3D acpi_driver_data(device); + struct eeepc_laptop *eeepc =3D platform_get_drvdata(pdev); =20 - acpi_dev_remove_notify_handler(device, ACPI_ALL_NOTIFY, eeepc_acpi_notify= ); + acpi_dev_remove_notify_handler(ACPI_COMPANION(&pdev->dev), + ACPI_ALL_NOTIFY, eeepc_acpi_notify); eeepc_backlight_exit(eeepc); eeepc_rfkill_exit(eeepc); eeepc_input_exit(eeepc); @@ -1469,13 +1472,12 @@ static const struct acpi_device_id eeepc_device_ids= [] =3D { }; MODULE_DEVICE_TABLE(acpi, eeepc_device_ids); =20 -static struct acpi_driver eeepc_acpi_driver =3D { - .name =3D EEEPC_LAPTOP_NAME, - .class =3D EEEPC_ACPI_CLASS, - .ids =3D eeepc_device_ids, - .ops =3D { - .add =3D eeepc_acpi_add, - .remove =3D eeepc_acpi_remove, +static struct platform_driver eeepc_acpi_driver =3D { + .probe =3D eeepc_acpi_probe, + .remove =3D eeepc_acpi_remove, + .driver =3D { + .name =3D EEEPC_LAPTOP_NAME, + .acpi_match_table =3D eeepc_device_ids, }, }; =20 @@ -1488,7 +1490,7 @@ static int __init eeepc_laptop_init(void) if (result < 0) return result; =20 - result =3D acpi_bus_register_driver(&eeepc_acpi_driver); + result =3D platform_driver_register(&eeepc_acpi_driver); if (result < 0) goto fail_acpi_driver; =20 @@ -1500,7 +1502,7 @@ static int __init eeepc_laptop_init(void) return 0; =20 fail_no_device: - acpi_bus_unregister_driver(&eeepc_acpi_driver); + platform_driver_unregister(&eeepc_acpi_driver); fail_acpi_driver: platform_driver_unregister(&platform_driver); return result; @@ -1508,7 +1510,7 @@ static int __init eeepc_laptop_init(void) =20 static void __exit eeepc_laptop_exit(void) { - acpi_bus_unregister_driver(&eeepc_acpi_driver); + platform_driver_unregister(&eeepc_acpi_driver); platform_driver_unregister(&platform_driver); } =20 --=20 2.51.0