<p>Felix Held has uploaded this change for <strong>review</strong>.</p><p><a href="https://review.coreboot.org/27384">View Change</a></p><pre style="font-family: monospace,monospace; white-space: pre-wrap;">pnp_device: improve readability<br><br>Add comments on the ops handling in pnp_enable_devices function and the<br>pnp_info struct.<br>Also remove the negation in the check if an LDN-specific override is used.<br>This patch doesn't change the logic though.<br><br>Change-Id: I3e80dbce1f29ee3e95e3b1d71c9b8479561d5c1a<br>---<br>M src/device/pnp_device.c<br>M src/include/device/pnp.h<br>2 files changed, 7 insertions(+), 4 deletions(-)<br><br></pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;">git pull ssh://review.coreboot.org:29418/coreboot refs/changes/84/27384/1</pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;"><span>diff --git a/src/device/pnp_device.c b/src/device/pnp_device.c</span><br><span>index ba05c82..821b054 100644</span><br><span>--- a/src/device/pnp_device.c</span><br><span>+++ b/src/device/pnp_device.c</span><br><span>@@ -386,10 +386,13 @@</span><br><span>          if (dev->ops)</span><br><span>                     continue;</span><br><span> </span><br><span style="color: hsl(0, 100%, 40%);">-           if (info[i].ops == 0)</span><br><span style="color: hsl(0, 100%, 40%);">-                   dev->ops = ops;</span><br><span style="color: hsl(0, 100%, 40%);">-              else</span><br><span style="color: hsl(120, 100%, 40%);">+          /* use LDN-specific ops override from corresponding pnp_info</span><br><span style="color: hsl(120, 100%, 40%);">+           * entry if not NULL */</span><br><span style="color: hsl(120, 100%, 40%);">+               if (info[i].ops)</span><br><span>                     dev->ops = info[i].ops;</span><br><span style="color: hsl(120, 100%, 40%);">+            /* else use device ops  */</span><br><span style="color: hsl(120, 100%, 40%);">+            else</span><br><span style="color: hsl(120, 100%, 40%);">+                  dev->ops = ops;</span><br><span> </span><br><span>               get_resources(dev, &info[i]);</span><br><span>    }</span><br><span>diff --git a/src/include/device/pnp.h b/src/include/device/pnp.h</span><br><span>index e3839c6..d753013 100644</span><br><span>--- a/src/include/device/pnp.h</span><br><span>+++ b/src/include/device/pnp.h</span><br><span>@@ -31,7 +31,7 @@</span><br><span> /* PNP helper operations */</span><br><span> </span><br><span> struct pnp_info {</span><br><span style="color: hsl(0, 100%, 40%);">-      struct device_operations *ops;</span><br><span style="color: hsl(120, 100%, 40%);">+        struct device_operations *ops; /* LDN-specific ops override */</span><br><span>       unsigned int function; /* Must be at least 16 bits (virtual LDNs)! */</span><br><span>        unsigned int flags;</span><br><span> #define PNP_IO0  0x000001</span><br><span></span><br></pre><p>To view, visit <a href="https://review.coreboot.org/27384">change 27384</a>. To unsubscribe, or for help writing mail filters, visit <a href="https://review.coreboot.org/settings">settings</a>.</p><div itemscope itemtype="http://schema.org/EmailMessage"><div itemscope itemprop="action" itemtype="http://schema.org/ViewAction"><link itemprop="url" href="https://review.coreboot.org/27384"/><meta itemprop="name" content="View Change"/></div></div>

<div style="display:none"> Gerrit-Project: coreboot </div>
<div style="display:none"> Gerrit-Branch: master </div>
<div style="display:none"> Gerrit-MessageType: newchange </div>
<div style="display:none"> Gerrit-Change-Id: I3e80dbce1f29ee3e95e3b1d71c9b8479561d5c1a </div>
<div style="display:none"> Gerrit-Change-Number: 27384 </div>
<div style="display:none"> Gerrit-PatchSet: 1 </div>
<div style="display:none"> Gerrit-Owner: Felix Held <felix-coreboot@felixheld.de> </div>