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

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