Michal Suchanek d69acd
From bcf21e3a97a1247178338793df9ae332a036e22b Mon Sep 17 00:00:00 2001
Michal Suchanek d69acd
From: Michael Ellerman <mpe@ellerman.id.au>
Michal Suchanek d69acd
Date: Tue, 22 Aug 2017 15:14:50 +1000
Michal Suchanek d69acd
Subject: [PATCH] powerpc/vio: Use device_type to detect family
Michal Suchanek d69acd
Michal Suchanek d69acd
References: bsc#1181674 ltc#189159
Michal Suchanek d69acd
Patch-mainline: v4.14-rc1
Michal Suchanek d69acd
Git-commit: bcf21e3a97a1247178338793df9ae332a036e22b
Michal Suchanek d69acd
Michal Suchanek d69acd
Currently in the vio.c code we use a comparision against the parent
Michal Suchanek d69acd
device node's full path to decide if the device is a PFO or VIO family
Michal Suchanek d69acd
device.
Michal Suchanek d69acd
Michal Suchanek d69acd
Both the ibm,platform-facilities and vdevice nodes are defined by PAPR,
Michal Suchanek d69acd
and must have a matching device_type. So instead of using the path we
Michal Suchanek d69acd
can instead compare the device_type.
Michal Suchanek d69acd
Michal Suchanek d69acd
I've checked Qemu and kvmtool both do this correctly, and all the
Michal Suchanek d69acd
PowerVM systems I have access to do also. So it seems to be safe.
Michal Suchanek d69acd
Michal Suchanek d69acd
This removes the dependency on full_name, which is being removed
Michal Suchanek d69acd
upstream.
Michal Suchanek d69acd
Michal Suchanek d69acd
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Michal Suchanek d69acd
Acked-by: Michal Suchanek <msuchanek@suse.de>
Michal Suchanek d69acd
---
Michal Suchanek d69acd
 arch/powerpc/platforms/pseries/vio.c | 4 ++--
Michal Suchanek d69acd
 1 file changed, 2 insertions(+), 2 deletions(-)
Michal Suchanek d69acd
Michal Suchanek d69acd
diff --git a/arch/powerpc/platforms/pseries/vio.c b/arch/powerpc/platforms/pseries/vio.c
Michal Suchanek d69acd
index 8a47f168476b..f26f906e6021 100644
Michal Suchanek d69acd
--- a/arch/powerpc/platforms/pseries/vio.c
Michal Suchanek d69acd
+++ b/arch/powerpc/platforms/pseries/vio.c
Michal Suchanek d69acd
@@ -1357,9 +1357,9 @@ struct vio_dev *vio_register_device_node(struct device_node *of_node)
Michal Suchanek d69acd
 	 */
Michal Suchanek d69acd
 	parent_node = of_get_parent(of_node);
Michal Suchanek d69acd
 	if (parent_node) {
Michal Suchanek d69acd
-		if (!strcmp(parent_node->full_name, "/ibm,platform-facilities"))
Michal Suchanek d69acd
+		if (!strcmp(parent_node->type, "ibm,platform-facilities"))
Michal Suchanek d69acd
 			family = PFO;
Michal Suchanek d69acd
-		else if (!strcmp(parent_node->full_name, "/vdevice"))
Michal Suchanek d69acd
+		else if (!strcmp(parent_node->type, "vdevice"))
Michal Suchanek d69acd
 			family = VDEVICE;
Michal Suchanek d69acd
 		else {
Michal Suchanek d69acd
 			pr_warn("%s: parent(%s) of %s not recognized.\n",
Michal Suchanek d69acd
-- 
Michal Suchanek d69acd
2.26.2
Michal Suchanek d69acd