linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] powerpc/vio: Use device_type to detect family
@ 2017-08-23  5:47 Michael Ellerman
  2017-08-24 12:37 ` Michael Ellerman
  0 siblings, 1 reply; 2+ messages in thread
From: Michael Ellerman @ 2017-08-23  5:47 UTC (permalink / raw)
  To: linuxppc-dev

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: Michael Ellerman <mpe@ellerman.id.au>
---
 arch/powerpc/platforms/pseries/vio.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/arch/powerpc/platforms/pseries/vio.c b/arch/powerpc/platforms/pseries/vio.c
index 8a47f168476b..f26f906e6021 100644
--- a/arch/powerpc/platforms/pseries/vio.c
+++ b/arch/powerpc/platforms/pseries/vio.c
@@ -1357,9 +1357,9 @@ struct vio_dev *vio_register_device_node(struct device_node *of_node)
 	 */
 	parent_node = of_get_parent(of_node);
 	if (parent_node) {
-		if (!strcmp(parent_node->full_name, "/ibm,platform-facilities"))
+		if (!strcmp(parent_node->type, "ibm,platform-facilities"))
 			family = PFO;
-		else if (!strcmp(parent_node->full_name, "/vdevice"))
+		else if (!strcmp(parent_node->type, "vdevice"))
 			family = VDEVICE;
 		else {
 			pr_warn("%s: parent(%s) of %s not recognized.\n",
-- 
2.7.4

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: powerpc/vio: Use device_type to detect family
  2017-08-23  5:47 [PATCH] powerpc/vio: Use device_type to detect family Michael Ellerman
@ 2017-08-24 12:37 ` Michael Ellerman
  0 siblings, 0 replies; 2+ messages in thread
From: Michael Ellerman @ 2017-08-24 12:37 UTC (permalink / raw)
  To: Michael Ellerman, linuxppc-dev

On Wed, 2017-08-23 at 05:47:13 UTC, Michael Ellerman wrote:
> 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: Michael Ellerman <mpe@ellerman.id.au>

Applied to powerpc next.

https://git.kernel.org/powerpc/c/bcf21e3a97a1247178338793df9ae3

cheers

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2017-08-24 12:37 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-08-23  5:47 [PATCH] powerpc/vio: Use device_type to detect family Michael Ellerman
2017-08-24 12:37 ` Michael Ellerman

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).