diff mbox series

tools/testing/cxl: Use dev_is_platform()

Message ID 20240827095123.168696-1-kunwu.chan@linux.dev
State Accepted
Commit 1c1d348b08ab7c106dd96bafb120f0888827174b
Headers show
Series tools/testing/cxl: Use dev_is_platform() | expand

Commit Message

Kunwu Chan Aug. 27, 2024, 9:51 a.m. UTC
From: Kunwu Chan <chentao@kylinos.cn>

Use dev_is_platform() instead of checking bus type directly.

Signed-off-by: Kunwu Chan <chentao@kylinos.cn>
---
 tools/testing/cxl/mock_acpi.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Jonathan Cameron Aug. 27, 2024, 11:15 a.m. UTC | #1
On Tue, 27 Aug 2024 17:51:23 +0800
Kunwu Chan <kunwu.chan@linux.dev> wrote:

> From: Kunwu Chan <chentao@kylinos.cn>
> 
> Use dev_is_platform() instead of checking bus type directly.
> 
> Signed-off-by: Kunwu Chan <chentao@kylinos.cn>
Reviewed-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
diff mbox series

Patch

diff --git a/tools/testing/cxl/mock_acpi.c b/tools/testing/cxl/mock_acpi.c
index 55813de26d46..8da94378ccec 100644
--- a/tools/testing/cxl/mock_acpi.c
+++ b/tools/testing/cxl/mock_acpi.c
@@ -18,7 +18,7 @@  struct acpi_device *to_cxl_host_bridge(struct device *host, struct device *dev)
 		goto out;
 	}
 
-	if (dev->bus == &platform_bus_type)
+	if (dev_is_platform(dev))
 		goto out;
 
 	adev = to_acpi_device(dev);