From nobody Tue Apr 7 08:10:17 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 B1E24205E25; Sat, 14 Mar 2026 11:43:45 +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=1773488625; cv=none; b=lROClJAEmCHrq1/IY/tor/sJQ37JK9ujCdwB6Ycfrdg6N2zsLxoKJpsdh207p8DbjIIfdoBxOIdkpuQ7/5CQQzO/wOAngwxnp+n0ynid4dggU5j13epe8sh21kuzjCzx7C5kyDJzZA1Jlqy44bPODRwa1DCfXVbXFQSFP9cypNA= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1773488625; c=relaxed/simple; bh=S3XN8pEzrzuZhx8bUg4Xm6iP8lFBGXhEWx2FunlA+qs=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version:Content-Type; b=aTTw7nYn6My+iAYsFFgJSgAL7cYgC+borgF6UhSxj3va3Fmhn7mm+GotlLI8YkIadSYAQLbv3MyRgvV7RgmyVuNU3ECsFq4/uuW8zboKPujZkInwTni3X9PdRTi2HENUnyzTe1Rfjqxr4ZKzilqyncIwdU3IGMrvOFtDDopzzjI= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=Pb+LelyH; 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="Pb+LelyH" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 01D60C116C6; Sat, 14 Mar 2026 11:43:37 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1773488625; bh=S3XN8pEzrzuZhx8bUg4Xm6iP8lFBGXhEWx2FunlA+qs=; h=From:To:Cc:Subject:Date:From; b=Pb+LelyHxvo4U+XAyR6SGjxzzk64s4DSCG3gf9TMK8IqEGyGikU60/bSRzPRR5iS7 9LbCw5csQOTE9Ama4vDh3MMt775glLAt8wwZngImtDku8d5iXiQ7E3e5XeODOEfRXe PiTi+7GSYpX2WNXxkVOz8kLnIWRkMxDDhi6r5z4vzSngJNP/52FI23lVCN1zRzWglQ SoX/VM1cyennKmwz1+4nFjULYTiuJCNscstPZ9N6bt9KD2KVWqH1/PEEnSGnDOFET2 0chN2xieijy7mUMNL8hbPaAhp3N/Zh99qOOP/nvAWmQZgaY7fCZZmV8FeU7SkSxWke OxYnFTE4R92hw== From: "Rafael J. Wysocki" To: netdev@vger.kernel.org Cc: LKML , Linux ACPI , Richard Cochran , Andrew Lunn , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni Subject: [PATCH v1] ptp: vmw: Convert to a platform driver Date: Sat, 14 Mar 2026 12:43:33 +0100 Message-ID: <12883468.O9o76ZdvQC@rafael.j.wysocki> Organization: Linux Kernel Development 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 PTP VMware 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: Simon Horman --- drivers/ptp/ptp_vmw.c | 23 ++++++++++++----------- 1 file changed, 12 insertions(+), 11 deletions(-) diff --git a/drivers/ptp/ptp_vmw.c b/drivers/ptp/ptp_vmw.c index 20ab05c4daa8..8510121d79d1 100644 --- a/drivers/ptp/ptp_vmw.c +++ b/drivers/ptp/ptp_vmw.c @@ -10,6 +10,7 @@ #include #include #include +#include #include #include #include @@ -83,7 +84,7 @@ static struct ptp_clock_info ptp_vmw_clock_info =3D { * ACPI driver ops for VMware "precision clock" virtual device. */ =20 -static int ptp_vmw_acpi_add(struct acpi_device *device) +static int ptp_vmw_acpi_probe(struct platform_device *pdev) { ptp_vmw_clock =3D ptp_clock_register(&ptp_vmw_clock_info, NULL); if (IS_ERR(ptp_vmw_clock)) { @@ -91,11 +92,11 @@ static int ptp_vmw_acpi_add(struct acpi_device *device) return PTR_ERR(ptp_vmw_clock); } =20 - ptp_vmw_acpi_device =3D device; + ptp_vmw_acpi_device =3D ACPI_COMPANION(&pdev->dev); return 0; } =20 -static void ptp_vmw_acpi_remove(struct acpi_device *device) +static void ptp_vmw_acpi_remove(struct platform_device *pdev) { ptp_clock_unregister(ptp_vmw_clock); } @@ -107,12 +108,12 @@ static const struct acpi_device_id ptp_vmw_acpi_devic= e_ids[] =3D { =20 MODULE_DEVICE_TABLE(acpi, ptp_vmw_acpi_device_ids); =20 -static struct acpi_driver ptp_vmw_acpi_driver =3D { - .name =3D "ptp_vmw", - .ids =3D ptp_vmw_acpi_device_ids, - .ops =3D { - .add =3D ptp_vmw_acpi_add, - .remove =3D ptp_vmw_acpi_remove +static struct platform_driver ptp_vmw_acpi_driver =3D { + .probe =3D ptp_vmw_acpi_probe, + .remove =3D ptp_vmw_acpi_remove, + .driver =3D { + .name =3D "ptp_vmw_acpi", + .acpi_match_table =3D ptp_vmw_acpi_device_ids, }, }; =20 @@ -120,12 +121,12 @@ static int __init ptp_vmw_init(void) { if (x86_hyper_type !=3D X86_HYPER_VMWARE) return -1; - return acpi_bus_register_driver(&ptp_vmw_acpi_driver); + return platform_driver_register(&ptp_vmw_acpi_driver); } =20 static void __exit ptp_vmw_exit(void) { - acpi_bus_unregister_driver(&ptp_vmw_acpi_driver); + platform_driver_unregister(&ptp_vmw_acpi_driver); } =20 module_init(ptp_vmw_init); --=20 2.51.0