mirror of
https://github.com/fail0verflow/switch-coreboot.git
synced 2025-05-04 01:39:18 -04:00
Remove the requirement that all ops have a constructor, since many of
them just use the default. Signed-off-by: Ronald G. Minnich <rminnich@gmail.com> Acked-by: Carl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net> git-svn-id: svn://coreboot.org/repository/coreboot-v3@579 f3766cd6-281f-0410-b1cd-43a5c92072e9
This commit is contained in:
parent
2b66702db7
commit
eefeaa1008
1 changed files with 7 additions and 3 deletions
|
@ -126,7 +126,7 @@ struct constructor *find_constructor(struct device_id *id)
|
|||
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 @@ void constructor(struct device *dev, struct device_id *id)
|
|||
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));
|
||||
|
|
Loading…
Add table
Reference in a new issue