This was easier than I thought :-)

ron
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]>

Index: device/device.c
===================================================================
--- device/device.c	(revision 578)
+++ device/device.c	(working copy)
@@ -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