[coreboot] r579 - coreboot-v3/device

svn at coreboot.org svn at coreboot.org
Fri Feb 8 12:57:08 CET 2008


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 <rminnich at gmail.com>
Acked-by: Carl-Daniel Hailfinger <c-d.hailfinger.devel.2006 at gmx.net>


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));





More information about the coreboot mailing list