Commit bcf21e3a authored by Michael Ellerman's avatar Michael Ellerman

powerpc/vio: Use device_type to detect family

Currently in the vio.c code we use a comparision against the parent
device node's full path to decide if the device is a PFO or VIO family
device.

Both the ibm,platform-facilities and vdevice nodes are defined by PAPR,
and must have a matching device_type. So instead of using the path we
can instead compare the device_type.

I've checked Qemu and kvmtool both do this correctly, and all the
PowerVM systems I have access to do also. So it seems to be safe.

This removes the dependency on full_name, which is being removed
upstream.
Signed-off-by: default avatarMichael Ellerman <mpe@ellerman.id.au>
parent 15c659ff
...@@ -1357,9 +1357,9 @@ struct vio_dev *vio_register_device_node(struct device_node *of_node) ...@@ -1357,9 +1357,9 @@ struct vio_dev *vio_register_device_node(struct device_node *of_node)
*/ */
parent_node = of_get_parent(of_node); parent_node = of_get_parent(of_node);
if (parent_node) { if (parent_node) {
if (!strcmp(parent_node->full_name, "/ibm,platform-facilities")) if (!strcmp(parent_node->type, "ibm,platform-facilities"))
family = PFO; family = PFO;
else if (!strcmp(parent_node->full_name, "/vdevice")) else if (!strcmp(parent_node->type, "vdevice"))
family = VDEVICE; family = VDEVICE;
else { else {
pr_warn("%s: parent(%s) of %s not recognized.\n", pr_warn("%s: parent(%s) of %s not recognized.\n",
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment