Blame SOURCES/0002-move-PnP-devices-to-the-ISA-LPC-bridge.patch

e67e1d
From 126bc4387648fabf0478d0b869fe6bc52676b447 Mon Sep 17 00:00:00 2001
e67e1d
From: Lyonel Vincent <lyonel@ezix.org>
e67e1d
Date: Sun, 29 Mar 2020 19:25:39 +0200
e67e1d
Subject: [PATCH 02/17] move PnP devices to the ISA/LPC bridge
e67e1d
e67e1d
---
e67e1d
 src/core/pnp.cc | 14 ++++++++++----
e67e1d
 1 file changed, 10 insertions(+), 4 deletions(-)
e67e1d
e67e1d
diff --git a/src/core/pnp.cc b/src/core/pnp.cc
e67e1d
index 8c92adf647a0..6a391856ec52 100644
e67e1d
--- a/src/core/pnp.cc
e67e1d
+++ b/src/core/pnp.cc
e67e1d
@@ -165,6 +165,11 @@ hw::hwClass pnp_class(const string & pnpid)
e67e1d
   return hw::generic;
e67e1d
 }
e67e1d
 
e67e1d
+static bool ISAbridge(const hwNode & n)
e67e1d
+{
e67e1d
+  return n.getClass()==hw::bridge && n.isCapable("isa");
e67e1d
+}
e67e1d
+
e67e1d
 bool scan_pnp(hwNode & n)
e67e1d
 {
e67e1d
   vector < sysfs::entry > entries = sysfs::entries_by_bus("pnp");
e67e1d
@@ -172,11 +177,12 @@ bool scan_pnp(hwNode & n)
e67e1d
   if (entries.empty())
e67e1d
     return false;
e67e1d
 
e67e1d
-  hwNode *core = n.getChild("core");
e67e1d
-  if (!core)
e67e1d
+  hwNode *isapnpbridge = n.findChild(ISAbridge);
e67e1d
+  if (!isapnpbridge) isapnpbridge = n.getChild("core");
e67e1d
+  if (!isapnpbridge)
e67e1d
   {
e67e1d
     n.addChild(hwNode("core", hw::bus));
e67e1d
-    core = n.getChild("core");
e67e1d
+    isapnpbridge = n.getChild("core");
e67e1d
   }
e67e1d
 
e67e1d
   for (vector < sysfs::entry >::iterator it = entries.begin();
e67e1d
@@ -208,7 +214,7 @@ bool scan_pnp(hwNode & n)
e67e1d
       device.setProduct("PnP device " + pnpid);
e67e1d
     device.claim();
e67e1d
 
e67e1d
-    core->addChild(device);
e67e1d
+    isapnpbridge->addChild(device);
e67e1d
   }
e67e1d
   return true;
e67e1d
 }
e67e1d
-- 
e67e1d
2.17.1
e67e1d