Author: hailfinger
Date: 2008-02-08 12:57:07 +0100 (Fri, 08 Feb 2008)
New Revision: 579

Modified:
   coreboot-v3/device/device.c
Log:
Remove the requirement that all ops have a constructor, since many of
them just use the default. 

Signed-off-by: Ronald G. Minnich <[EMAIL PROTECTED]>
Acked-by: Carl-Daniel Hailfinger <[EMAIL PROTECTED]>


Modified: coreboot-v3/device/device.c
===================================================================
--- coreboot-v3/device/device.c 2008-02-07 16:50:44 UTC (rev 578)
+++ coreboot-v3/device/device.c 2008-02-08 11:57:07 UTC (rev 579)
@@ -126,7 +126,7 @@
                for (c = all_constructors[i]; c->ops; c++) {
                        printk(BIOS_SPEW, "%s: cons %p, cons id %s\n",
                               __func__, c, dev_id_string(&c->id));
-                       if ((!c->ops) || (!c->ops->constructor)) {
+                       if (!c->ops) {
                                continue;
                        }
                        if (id_eq(&c->id, id)) {
@@ -182,8 +182,12 @@
        c = find_constructor(id);
        printk(BIOS_SPEW, "%s: constructor is %p\n", __func__, c);
  
-       if(c && c->ops && c->ops->constructor)
-               c->ops->constructor(dev, c);
+       if(c && c->ops) {
+               if(c->ops->constructor)
+                       c->ops->constructor(dev, c);
+               else
+                       default_device_constructor(dev, c);
+       }
        else
                printk(BIOS_INFO, "No constructor called for %s.\n", 
                        dev_id_string(&c->id));


-- 
coreboot mailing list
[email protected]
http://www.coreboot.org/mailman/listinfo/coreboot

Reply via email to