<p>Furquan Shaikh has uploaded this change for <strong>review</strong>.</p><p><a href="https://review.coreboot.org/27209">View Change</a></p><pre style="font-family: monospace,monospace; white-space: pre-wrap;">util/sconfig: Get rid of ops from struct device<br><br>"ops" field was used in device structure only to add<br>default_dev_ops_root for root device. It was always set to NULL for<br>all other devices. This change gets rid of ops field from struct<br>device and instead hardcodes default_dev_ops_root in pass1 for root<br>device.<br><br>BUG=b:80081934<br>TEST=Verified that static.c generated with and without this change is<br>exactly the same.<br><br>Change-Id: I0848788610c2ed27274daf4920de3068a9784d4c<br>Signed-off-by: Furquan Shaikh <furquan@google.com><br>---<br>M util/sconfig/main.c<br>M util/sconfig/sconfig.h<br>2 files changed, 9 insertions(+), 6 deletions(-)<br><br></pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;">git pull ssh://review.coreboot.org:29418/coreboot refs/changes/09/27209/1</pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;"><span>diff --git a/util/sconfig/main.c b/util/sconfig/main.c</span><br><span>index 6b4809c..cf09937 100644</span><br><span>--- a/util/sconfig/main.c</span><br><span>+++ b/util/sconfig/main.c</span><br><span>@@ -98,7 +98,6 @@</span><br><span>     .id = 0,</span><br><span>     .chip_instance = &mainboard_instance,</span><br><span>    .path = " .type = DEVICE_PATH_ROOT ",</span><br><span style="color: hsl(0, 100%, 40%);">- .ops = "&default_dev_ops_root",</span><br><span>        .parent = &base_root_bus,</span><br><span>        .enabled = 1,</span><br><span>        .bus = &base_root_bus,</span><br><span>@@ -120,7 +119,6 @@</span><br><span>      */</span><br><span>  .chip_instance = &mainboard_instance,</span><br><span>    .path = " .type = DEVICE_PATH_ROOT ",</span><br><span style="color: hsl(0, 100%, 40%);">- .ops = "&default_dev_ops_root",</span><br><span>        .parent = &override_root_bus,</span><br><span>    .enabled = 1,</span><br><span>        .bus = &override_root_bus,</span><br><span>@@ -761,7 +759,15 @@</span><br><span>                fprintf(fil, "static ");</span><br><span>   fprintf(fil, "DEVTREE_CONST struct device %s = {\n", ptr->name);</span><br><span>        fprintf(fil, "#if !DEVTREE_EARLY\n");</span><br><span style="color: hsl(0, 100%, 40%);">- fprintf(fil, "\t.ops = %s,\n", (ptr->ops) ? (ptr->ops) : "0");</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+    /*</span><br><span style="color: hsl(120, 100%, 40%);">+     * ops field is set to default_dev_ops_root only for the root</span><br><span style="color: hsl(120, 100%, 40%);">+  * device. For all other devices, it is set by the driver at runtime.</span><br><span style="color: hsl(120, 100%, 40%);">+  */</span><br><span style="color: hsl(120, 100%, 40%);">+   if (ptr == &base_root_dev)</span><br><span style="color: hsl(120, 100%, 40%);">+                fprintf(fil, "\t.ops = &default_dev_ops_root,\n");</span><br><span style="color: hsl(120, 100%, 40%);">+      else</span><br><span style="color: hsl(120, 100%, 40%);">+          fprintf(fil, "\t.ops = 0,\n");</span><br><span>     fprintf(fil, "#endif\n");</span><br><span>  fprintf(fil, "\t.bus = &%s_links[%d],\n", ptr->parent->dev->name,</span><br><span>             ptr->parent->id);</span><br><span>diff --git a/util/sconfig/sconfig.h b/util/sconfig/sconfig.h</span><br><span>index 63b65fd..8a9437c 100644</span><br><span>--- a/util/sconfig/sconfig.h</span><br><span>+++ b/util/sconfig/sconfig.h</span><br><span>@@ -104,9 +104,6 @@</span><br><span>   int subsystem_device;</span><br><span>        int inherit_subsystem;</span><br><span> </span><br><span style="color: hsl(0, 100%, 40%);">-      /* Name of ops structure for the device. */</span><br><span style="color: hsl(0, 100%, 40%);">-     char *ops;</span><br><span style="color: hsl(0, 100%, 40%);">-</span><br><span>   /* Name of this device. */</span><br><span>   char *name;</span><br><span> </span><br><span></span><br></pre><p>To view, visit <a href="https://review.coreboot.org/27209">change 27209</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/27209"/><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: I0848788610c2ed27274daf4920de3068a9784d4c </div>
<div style="display:none"> Gerrit-Change-Number: 27209 </div>
<div style="display:none"> Gerrit-PatchSet: 1 </div>
<div style="display:none"> Gerrit-Owner: Furquan Shaikh <furquan@google.com> </div>