General cleanup and comments for things that should be fixed in future.
Most substantive change is getting rid of 'initialized', which was only ever needed in v2 due to an implementation mistake. With Uwe's comments taken into account, Signed-off-by: Ronald G. Minnich <rminnich@gmail.com> Acked-by: Myles Watson <mylesgw@gmail.com> git-svn-id: svn://coreboot.org/repository/coreboot-v3@961 f3766cd6-281f-0410-b1cd-43a5c92072e9
This commit is contained in:
parent
32139165ec
commit
3eec9e7790
6 changed files with 16 additions and 10 deletions
|
|
@ -805,6 +805,7 @@ unsigned int dev_phase3_scan(struct device *busdevice, unsigned int max)
|
|||
#warning do we call phase3_enable here.
|
||||
new_max = busdevice->ops->phase3_scan(busdevice, max);
|
||||
do_phase3 = 0;
|
||||
/* do we *ever* use this path */
|
||||
for (link = 0; link < busdevice->links; link++) {
|
||||
if (busdevice->link[link].reset_needed) {
|
||||
if (reset_bus(&busdevice->link[link])) {
|
||||
|
|
@ -973,15 +974,13 @@ void dev_phase6(void)
|
|||
|
||||
printk(BIOS_INFO, "Phase 6: Initializing devices...\n");
|
||||
for (dev = all_devices; dev; dev = dev->next) {
|
||||
if (dev->enabled && !dev->initialized &&
|
||||
dev->ops && dev->ops->phase6_init) {
|
||||
if (dev->enabled && dev->ops && dev->ops->phase6_init) {
|
||||
if (dev->path.type == DEVICE_PATH_I2C) {
|
||||
printk(BIOS_DEBUG, "Phase 6: smbus: %s[%d]->",
|
||||
dev_path(dev->bus->dev), dev->bus->link);
|
||||
}
|
||||
printk(BIOS_DEBUG, "Phase 6: %s init.\n",
|
||||
dev_path(dev));
|
||||
dev->initialized = 1;
|
||||
dev->ops->phase6_init(dev);
|
||||
}
|
||||
}
|
||||
|
|
@ -995,8 +994,8 @@ void show_all_devs(void)
|
|||
printk(BIOS_INFO, "Show all devs...\n");
|
||||
for (dev = all_devices; dev; dev = dev->next) {
|
||||
printk(BIOS_SPEW,
|
||||
"%s(%s): enabled %d have_resources %d initialized %d\n",
|
||||
"%s(%s): enabled %d have_resources %d\n",
|
||||
dev->dtsname, dev_path(dev), dev->enabled,
|
||||
dev->have_resources, dev->initialized);
|
||||
dev->have_resources);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -430,10 +430,7 @@ void compact_resources(struct device *dev)
|
|||
for (i = 0; i < dev->resources;) {
|
||||
resource = &dev->resource[i];
|
||||
if (!resource->flags) {
|
||||
/* Note: memmove() was used here. But this can never
|
||||
* overlap, right?
|
||||
*/
|
||||
memcpy(resource, resource + 1, (dev->resources-i)* sizeof(*resource));
|
||||
memmove(resource, resource + 1, (dev->resources-i)* sizeof(*resource));
|
||||
dev->resources -= 1;
|
||||
memset(&dev->resource[dev->resources], 0,
|
||||
sizeof(*resource));
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue