Commit 5fd66b2b authored by Takayoshi Kouchi's avatar Takayoshi Kouchi Committed by Russell King

[PATCH] ACPI PCI hotplug updates

These are updates of the acpiphp driver for 2.5.
  - change debug flag from 'acpiphp_debug' to 'debug' for insmod
  - whitespace cleanup
  - message cleanup
parent 96cf7c73
...@@ -41,12 +41,12 @@ ...@@ -41,12 +41,12 @@
#define dbg(format, arg...) \ #define dbg(format, arg...) \
do { \ do { \
if (acpiphp_debug) \ if (acpiphp_debug) \
printk (KERN_DEBUG "%s: " format "\n", \ printk(KERN_DEBUG "%s: " format, \
MY_NAME , ## arg); \ MY_NAME , ## arg); \
} while (0) } while (0)
#define err(format, arg...) printk (KERN_ERR "%s: " format "\n", MY_NAME , ## arg) #define err(format, arg...) printk(KERN_ERR "%s: " format, MY_NAME , ## arg)
#define info(format, arg...) printk (KERN_INFO "%s: " format "\n", MY_NAME , ## arg) #define info(format, arg...) printk(KERN_INFO "%s: " format, MY_NAME , ## arg)
#define warn(format, arg...) printk (KERN_WARNING "%s: " format "\n", MY_NAME , ## arg) #define warn(format, arg...) printk(KERN_WARNING "%s: " format, MY_NAME , ## arg)
#define SLOT_MAGIC 0x67267322 #define SLOT_MAGIC 0x67267322
/* name size which is used for entries in pcihpfs */ /* name size which is used for entries in pcihpfs */
......
This diff is collapsed.
This diff is collapsed.
...@@ -77,7 +77,7 @@ static int init_config_space (struct acpiphp_func *func) ...@@ -77,7 +77,7 @@ static int init_config_space (struct acpiphp_func *func)
if (!bar) /* This BAR is not implemented */ if (!bar) /* This BAR is not implemented */
continue; continue;
dbg("Device %02x.%02x BAR %d wants %x", device, function, count, bar); dbg("Device %02x.%02x BAR %d wants %x\n", device, function, count, bar);
if (bar & PCI_BASE_ADDRESS_SPACE_IO) { if (bar & PCI_BASE_ADDRESS_SPACE_IO) {
/* This is IO */ /* This is IO */
...@@ -85,7 +85,7 @@ static int init_config_space (struct acpiphp_func *func) ...@@ -85,7 +85,7 @@ static int init_config_space (struct acpiphp_func *func)
len = bar & 0xFFFFFFFC; len = bar & 0xFFFFFFFC;
len = ~len + 1; len = ~len + 1;
dbg ("len in IO %x, BAR %d", len, count); dbg("len in IO %x, BAR %d\n", len, count);
spin_lock(&bridge->res_lock); spin_lock(&bridge->res_lock);
res = acpiphp_get_io_resource(&bridge->io_head, len); res = acpiphp_get_io_resource(&bridge->io_head, len);
...@@ -110,7 +110,7 @@ static int init_config_space (struct acpiphp_func *func) ...@@ -110,7 +110,7 @@ static int init_config_space (struct acpiphp_func *func)
len = bar & 0xFFFFFFF0; len = bar & 0xFFFFFFF0;
len = ~len + 1; len = ~len + 1;
dbg("len in PFMEM %x, BAR %d", len, count); dbg("len in PFMEM %x, BAR %d\n", len, count);
spin_lock(&bridge->res_lock); spin_lock(&bridge->res_lock);
res = acpiphp_get_resource(&bridge->p_mem_head, len); res = acpiphp_get_resource(&bridge->p_mem_head, len);
...@@ -127,7 +127,7 @@ static int init_config_space (struct acpiphp_func *func) ...@@ -127,7 +127,7 @@ static int init_config_space (struct acpiphp_func *func)
(u32)res->base); (u32)res->base);
if (bar & PCI_BASE_ADDRESS_MEM_TYPE_64) { /* takes up another dword */ if (bar & PCI_BASE_ADDRESS_MEM_TYPE_64) { /* takes up another dword */
dbg ("inside the pfmem 64 case, count %d", count); dbg("inside the pfmem 64 case, count %d\n", count);
count += 1; count += 1;
pci_bus_write_config_dword(pbus, devfn, pci_bus_write_config_dword(pbus, devfn,
address[count], address[count],
...@@ -143,7 +143,7 @@ static int init_config_space (struct acpiphp_func *func) ...@@ -143,7 +143,7 @@ static int init_config_space (struct acpiphp_func *func)
len = bar & 0xFFFFFFF0; len = bar & 0xFFFFFFF0;
len = ~len + 1; len = ~len + 1;
dbg("len in MEM %x, BAR %d", len, count); dbg("len in MEM %x, BAR %d\n", len, count);
spin_lock(&bridge->res_lock); spin_lock(&bridge->res_lock);
res = acpiphp_get_resource(&bridge->mem_head, len); res = acpiphp_get_resource(&bridge->mem_head, len);
...@@ -161,7 +161,7 @@ static int init_config_space (struct acpiphp_func *func) ...@@ -161,7 +161,7 @@ static int init_config_space (struct acpiphp_func *func)
if (bar & PCI_BASE_ADDRESS_MEM_TYPE_64) { if (bar & PCI_BASE_ADDRESS_MEM_TYPE_64) {
/* takes up another dword */ /* takes up another dword */
dbg ("inside mem 64 case, reg. mem, count %d", count); dbg("inside mem 64 case, reg. mem, count %d\n", count);
count += 1; count += 1;
pci_bus_write_config_dword(pbus, devfn, pci_bus_write_config_dword(pbus, devfn,
address[count], address[count],
...@@ -212,16 +212,16 @@ static int configure_pci_dev (struct pci_dev_wrapped *wrapped_dev, struct pci_bu ...@@ -212,16 +212,16 @@ static int configure_pci_dev (struct pci_dev_wrapped *wrapped_dev, struct pci_bu
//pci_proc_attach_device(dev); //pci_proc_attach_device(dev);
//pci_announce_device_to_drivers(dev); //pci_announce_device_to_drivers(dev);
info("Device %s configured", dev->slot_name); info("Device %s configured\n", dev->slot_name);
return 0; return 0;
} }
static int is_pci_dev_in_use (struct pci_dev* dev) static int is_pci_dev_in_use (struct pci_dev* dev)
{ {
/* /*
* dev->driver will be set if the device is in use by a new-style * dev->driver will be set if the device is in use by a new-style
* driver -- otherwise, check the device's regions to see if any * driver -- otherwise, check the device's regions to see if any
* driver has claimed them * driver has claimed them
*/ */
...@@ -263,13 +263,13 @@ static int unconfigure_pci_dev_driver (struct pci_dev_wrapped *wrapped_dev, stru ...@@ -263,13 +263,13 @@ static int unconfigure_pci_dev_driver (struct pci_dev_wrapped *wrapped_dev, stru
{ {
struct pci_dev *dev = wrapped_dev->dev; struct pci_dev *dev = wrapped_dev->dev;
dbg("attempting removal of driver for device %s", dev->slot_name); dbg("attempting removal of driver for device %s\n", dev->slot_name);
/* Now, remove the Linux Driver Representation */ /* Now, remove the Linux Driver Representation */
if (dev->driver) { if (dev->driver) {
if (dev->driver->remove) { if (dev->driver->remove) {
dev->driver->remove(dev); dev->driver->remove(dev);
dbg("driver was properly removed"); dbg("driver was properly removed\n");
} }
dev->driver = NULL; dev->driver = NULL;
} }
...@@ -286,7 +286,7 @@ static int unconfigure_pci_dev (struct pci_dev_wrapped *wrapped_dev, struct pci_ ...@@ -286,7 +286,7 @@ static int unconfigure_pci_dev (struct pci_dev_wrapped *wrapped_dev, struct pci_
/* Now, remove the Linux Representation */ /* Now, remove the Linux Representation */
if (dev) { if (dev) {
if (pci_hp_remove_device(dev) == 0) { if (pci_hp_remove_device(dev) == 0) {
info("Device %s removed", dev->slot_name); info("Device %s removed\n", dev->slot_name);
kfree(dev); /* Now, remove */ kfree(dev); /* Now, remove */
} else { } else {
return -1; /* problems while freeing, abort visitation */ return -1; /* problems while freeing, abort visitation */
...@@ -338,7 +338,7 @@ static int detect_used_resource (struct acpiphp_bridge *bridge, struct pci_dev * ...@@ -338,7 +338,7 @@ static int detect_used_resource (struct acpiphp_bridge *bridge, struct pci_dev *
int count; int count;
struct pci_resource *res; struct pci_resource *res;
dbg("Device %s", dev->slot_name); dbg("Device %s\n", dev->slot_name);
for (count = 0; address[count]; count++) { /* for 6 BARs */ for (count = 0; address[count]; count++) { /* for 6 BARs */
pci_read_config_dword(dev, address[count], &bar); pci_read_config_dword(dev, address[count], &bar);
...@@ -355,7 +355,7 @@ static int detect_used_resource (struct acpiphp_bridge *bridge, struct pci_dev * ...@@ -355,7 +355,7 @@ static int detect_used_resource (struct acpiphp_bridge *bridge, struct pci_dev *
len &= 0xFFFFFFFC; len &= 0xFFFFFFFC;
len = ~len + 1; len = ~len + 1;
dbg("BAR[%d] %08x - %08x (IO)", count, (u32)base, (u32)base + len - 1); dbg("BAR[%d] %08x - %08x (IO)\n", count, (u32)base, (u32)base + len - 1);
spin_lock(&bridge->res_lock); spin_lock(&bridge->res_lock);
res = acpiphp_get_resource_with_base(&bridge->io_head, base, len); res = acpiphp_get_resource_with_base(&bridge->io_head, base, len);
...@@ -372,10 +372,10 @@ static int detect_used_resource (struct acpiphp_bridge *bridge, struct pci_dev * ...@@ -372,10 +372,10 @@ static int detect_used_resource (struct acpiphp_bridge *bridge, struct pci_dev *
len = ~len + 1; len = ~len + 1;
if (len & PCI_BASE_ADDRESS_MEM_TYPE_64) { /* takes up another dword */ if (len & PCI_BASE_ADDRESS_MEM_TYPE_64) { /* takes up another dword */
dbg ("prefetch mem 64"); dbg("prefetch mem 64\n");
count += 1; count += 1;
} }
dbg("BAR[%d] %08x - %08x (PMEM)", count, (u32)base, (u32)base + len - 1); dbg("BAR[%d] %08x - %08x (PMEM)\n", count, (u32)base, (u32)base + len - 1);
spin_lock(&bridge->res_lock); spin_lock(&bridge->res_lock);
res = acpiphp_get_resource_with_base(&bridge->p_mem_head, base, len); res = acpiphp_get_resource_with_base(&bridge->p_mem_head, base, len);
spin_unlock(&bridge->res_lock); spin_unlock(&bridge->res_lock);
...@@ -389,10 +389,10 @@ static int detect_used_resource (struct acpiphp_bridge *bridge, struct pci_dev * ...@@ -389,10 +389,10 @@ static int detect_used_resource (struct acpiphp_bridge *bridge, struct pci_dev *
if (len & PCI_BASE_ADDRESS_MEM_TYPE_64) { if (len & PCI_BASE_ADDRESS_MEM_TYPE_64) {
/* takes up another dword */ /* takes up another dword */
dbg ("mem 64"); dbg("mem 64\n");
count += 1; count += 1;
} }
dbg("BAR[%d] %08x - %08x (MEM)", count, (u32)base, (u32)base + len - 1); dbg("BAR[%d] %08x - %08x (MEM)\n", count, (u32)base, (u32)base + len - 1);
spin_lock(&bridge->res_lock); spin_lock(&bridge->res_lock);
res = acpiphp_get_resource_with_base(&bridge->mem_head, base, len); res = acpiphp_get_resource_with_base(&bridge->mem_head, base, len);
spin_unlock(&bridge->res_lock); spin_unlock(&bridge->res_lock);
...@@ -414,7 +414,7 @@ static void detect_used_resource_bus(struct acpiphp_bridge *bridge, struct pci_b ...@@ -414,7 +414,7 @@ static void detect_used_resource_bus(struct acpiphp_bridge *bridge, struct pci_b
struct list_head *l; struct list_head *l;
struct pci_dev *dev; struct pci_dev *dev;
list_for_each(l, &bus->devices) { list_for_each (l, &bus->devices) {
dev = pci_dev_b(l); dev = pci_dev_b(l);
detect_used_resource(bridge, dev); detect_used_resource(bridge, dev);
/* XXX recursive call */ /* XXX recursive call */
...@@ -463,16 +463,16 @@ int acpiphp_init_func_resource (struct acpiphp_func *func) ...@@ -463,16 +463,16 @@ int acpiphp_init_func_resource (struct acpiphp_func *func)
struct pci_dev *dev; struct pci_dev *dev;
dev = func->pci_dev; dev = func->pci_dev;
dbg("Hot-pluggable device %s", dev->slot_name); dbg("Hot-pluggable device %s\n", dev->slot_name);
for (count = 0; address[count]; count++) { /* for 6 BARs */ for (count = 0; address[count]; count++) { /* for 6 BARs */
pci_read_config_dword (dev, address[count], &bar); pci_read_config_dword(dev, address[count], &bar);
if (!bar) /* This BAR is not implemented */ if (!bar) /* This BAR is not implemented */
continue; continue;
pci_write_config_dword (dev, address[count], 0xFFFFFFFF); pci_write_config_dword(dev, address[count], 0xFFFFFFFF);
pci_read_config_dword (dev, address[count], &len); pci_read_config_dword(dev, address[count], &len);
if (len & PCI_BASE_ADDRESS_SPACE_IO) { if (len & PCI_BASE_ADDRESS_SPACE_IO) {
/* This is IO */ /* This is IO */
...@@ -480,7 +480,7 @@ int acpiphp_init_func_resource (struct acpiphp_func *func) ...@@ -480,7 +480,7 @@ int acpiphp_init_func_resource (struct acpiphp_func *func)
len &= 0xFFFFFFFC; len &= 0xFFFFFFFC;
len = ~len + 1; len = ~len + 1;
dbg("BAR[%d] %08x - %08x (IO)", count, (u32)base, (u32)base + len - 1); dbg("BAR[%d] %08x - %08x (IO)\n", count, (u32)base, (u32)base + len - 1);
res = acpiphp_make_resource(base, len); res = acpiphp_make_resource(base, len);
if (!res) if (!res)
...@@ -499,10 +499,10 @@ int acpiphp_init_func_resource (struct acpiphp_func *func) ...@@ -499,10 +499,10 @@ int acpiphp_init_func_resource (struct acpiphp_func *func)
len = ~len + 1; len = ~len + 1;
if (len & PCI_BASE_ADDRESS_MEM_TYPE_64) { /* takes up another dword */ if (len & PCI_BASE_ADDRESS_MEM_TYPE_64) { /* takes up another dword */
dbg ("prefetch mem 64"); dbg("prefetch mem 64\n");
count += 1; count += 1;
} }
dbg("BAR[%d] %08x - %08x (PMEM)", count, (u32)base, (u32)base + len - 1); dbg("BAR[%d] %08x - %08x (PMEM)\n", count, (u32)base, (u32)base + len - 1);
res = acpiphp_make_resource(base, len); res = acpiphp_make_resource(base, len);
if (!res) if (!res)
goto no_memory; goto no_memory;
...@@ -518,10 +518,10 @@ int acpiphp_init_func_resource (struct acpiphp_func *func) ...@@ -518,10 +518,10 @@ int acpiphp_init_func_resource (struct acpiphp_func *func)
if (len & PCI_BASE_ADDRESS_MEM_TYPE_64) { if (len & PCI_BASE_ADDRESS_MEM_TYPE_64) {
/* takes up another dword */ /* takes up another dword */
dbg ("mem 64"); dbg("mem 64\n");
count += 1; count += 1;
} }
dbg("BAR[%d] %08x - %08x (MEM)", count, (u32)base, (u32)base + len - 1); dbg("BAR[%d] %08x - %08x (MEM)\n", count, (u32)base, (u32)base + len - 1);
res = acpiphp_make_resource(base, len); res = acpiphp_make_resource(base, len);
if (!res) if (!res)
goto no_memory; goto no_memory;
...@@ -532,7 +532,7 @@ int acpiphp_init_func_resource (struct acpiphp_func *func) ...@@ -532,7 +532,7 @@ int acpiphp_init_func_resource (struct acpiphp_func *func)
} }
} }
pci_write_config_dword (dev, address[count], bar); pci_write_config_dword(dev, address[count], bar);
} }
#if 1 #if 1
acpiphp_dump_func_resource(func); acpiphp_dump_func_resource(func);
...@@ -541,7 +541,7 @@ int acpiphp_init_func_resource (struct acpiphp_func *func) ...@@ -541,7 +541,7 @@ int acpiphp_init_func_resource (struct acpiphp_func *func)
return 0; return 0;
no_memory: no_memory:
err("out of memory"); err("out of memory\n");
acpiphp_free_resource(&func->io_head); acpiphp_free_resource(&func->io_head);
acpiphp_free_resource(&func->mem_head); acpiphp_free_resource(&func->mem_head);
acpiphp_free_resource(&func->p_mem_head); acpiphp_free_resource(&func->p_mem_head);
...@@ -574,7 +574,7 @@ int acpiphp_configure_slot (struct acpiphp_slot *slot) ...@@ -574,7 +574,7 @@ int acpiphp_configure_slot (struct acpiphp_slot *slot)
if (hdr & 0x80) if (hdr & 0x80)
is_multi = 1; is_multi = 1;
list_for_each(l, &slot->funcs) { list_for_each (l, &slot->funcs) {
func = list_entry(l, struct acpiphp_func, sibling); func = list_entry(l, struct acpiphp_func, sibling);
if (is_multi || func->function == 0) { if (is_multi || func->function == 0) {
pci_bus_read_config_dword(slot->bridge->pci_bus, pci_bus_read_config_dword(slot->bridge->pci_bus,
...@@ -583,7 +583,6 @@ int acpiphp_configure_slot (struct acpiphp_slot *slot) ...@@ -583,7 +583,6 @@ int acpiphp_configure_slot (struct acpiphp_slot *slot)
PCI_VENDOR_ID, &dvid); PCI_VENDOR_ID, &dvid);
if (dvid != 0xffffffff) { if (dvid != 0xffffffff) {
retval = init_config_space(func); retval = init_config_space(func);
if (retval) if (retval)
break; break;
} }
......
...@@ -273,7 +273,7 @@ struct pci_resource *acpiphp_get_max_resource (struct pci_resource **head, u32 s ...@@ -273,7 +273,7 @@ struct pci_resource *acpiphp_get_max_resource (struct pci_resource **head, u32 s
for (max = *head;max; max = max->next) { for (max = *head;max; max = max->next) {
/* If not big enough we could probably just bail, /* If not big enough we could probably just bail,
instead we'll continue to the next. */ instead we'll continue to the next. */
if (max->length < size) if (max->length < size)
continue; continue;
...@@ -370,13 +370,13 @@ struct pci_resource *acpiphp_get_resource (struct pci_resource **head, u32 size) ...@@ -370,13 +370,13 @@ struct pci_resource *acpiphp_get_resource (struct pci_resource **head, u32 size)
return NULL; return NULL;
for (node = *head; node; node = node->next) { for (node = *head; node; node = node->next) {
dbg("%s: req_size =%x node=%p, base=%x, length=%x", dbg("%s: req_size =%x node=%p, base=%x, length=%x\n",
__FUNCTION__, size, node, (u32)node->base, node->length); __FUNCTION__, size, node, (u32)node->base, node->length);
if (node->length < size) if (node->length < size)
continue; continue;
if (node->base & (size - 1)) { if (node->base & (size - 1)) {
dbg("%s: not aligned", __FUNCTION__); dbg("%s: not aligned\n", __FUNCTION__);
/* this one isn't base aligned properly /* this one isn't base aligned properly
so we'll make a new entry and split it up */ so we'll make a new entry and split it up */
temp_qword = (node->base | (size-1)) + 1; temp_qword = (node->base | (size-1)) + 1;
...@@ -400,7 +400,7 @@ struct pci_resource *acpiphp_get_resource (struct pci_resource **head, u32 size) ...@@ -400,7 +400,7 @@ struct pci_resource *acpiphp_get_resource (struct pci_resource **head, u32 size)
/* Don't need to check if too small since we already did */ /* Don't need to check if too small since we already did */
if (node->length > size) { if (node->length > size) {
dbg("%s: too big", __FUNCTION__); dbg("%s: too big\n", __FUNCTION__);
/* this one is longer than we need /* this one is longer than we need
so we'll make a new entry and split it up */ so we'll make a new entry and split it up */
split_node = acpiphp_make_resource(node->base + size, node->length - size); split_node = acpiphp_make_resource(node->base + size, node->length - size);
...@@ -415,7 +415,7 @@ struct pci_resource *acpiphp_get_resource (struct pci_resource **head, u32 size) ...@@ -415,7 +415,7 @@ struct pci_resource *acpiphp_get_resource (struct pci_resource **head, u32 size)
node->next = split_node; node->next = split_node;
} /* End of too big on top end */ } /* End of too big on top end */
dbg("%s: got one!!!", __FUNCTION__); dbg("%s: got one!!!\n", __FUNCTION__);
/* If we got here, then it is the right size /* If we got here, then it is the right size
Now take it out of the list */ Now take it out of the list */
if (*head == node) { if (*head == node) {
...@@ -437,7 +437,7 @@ struct pci_resource *acpiphp_get_resource (struct pci_resource **head, u32 size) ...@@ -437,7 +437,7 @@ struct pci_resource *acpiphp_get_resource (struct pci_resource **head, u32 size)
/** /**
* get_resource_with_base - get resource with specific base address * get_resource_with_base - get resource with specific base address
* *
* this function * this function
* returns the first node of "size" length located at specified base address. * returns the first node of "size" length located at specified base address.
* If it finds a node larger than "size" it will split it up. * If it finds a node larger than "size" it will split it up.
* *
...@@ -458,7 +458,7 @@ struct pci_resource *acpiphp_get_resource_with_base (struct pci_resource **head, ...@@ -458,7 +458,7 @@ struct pci_resource *acpiphp_get_resource_with_base (struct pci_resource **head,
return NULL; return NULL;
for (node = *head; node; node = node->next) { for (node = *head; node; node = node->next) {
dbg(": 1st req_base=%x req_size =%x node=%p, base=%x, length=%x", dbg(": 1st req_base=%x req_size =%x node=%p, base=%x, length=%x\n",
(u32)base, size, node, (u32)node->base, node->length); (u32)base, size, node, (u32)node->base, node->length);
if (node->base > base) if (node->base > base)
continue; continue;
...@@ -467,7 +467,7 @@ struct pci_resource *acpiphp_get_resource_with_base (struct pci_resource **head, ...@@ -467,7 +467,7 @@ struct pci_resource *acpiphp_get_resource_with_base (struct pci_resource **head,
continue; continue;
if (node->base < base) { if (node->base < base) {
dbg(": split 1"); dbg(": split 1\n");
/* this one isn't base aligned properly /* this one isn't base aligned properly
so we'll make a new entry and split it up */ so we'll make a new entry and split it up */
temp_qword = base; temp_qword = base;
...@@ -489,12 +489,12 @@ struct pci_resource *acpiphp_get_resource_with_base (struct pci_resource **head, ...@@ -489,12 +489,12 @@ struct pci_resource *acpiphp_get_resource_with_base (struct pci_resource **head,
node->next = split_node; node->next = split_node;
} }
dbg(": 2nd req_base=%x req_size =%x node=%p, base=%x, length=%x", dbg(": 2nd req_base=%x req_size =%x node=%p, base=%x, length=%x\n",
(u32)base, size, node, (u32)node->base, node->length); (u32)base, size, node, (u32)node->base, node->length);
/* Don't need to check if too small since we already did */ /* Don't need to check if too small since we already did */
if (node->length > size) { if (node->length > size) {
dbg(": split 2"); dbg(": split 2\n");
/* this one is longer than we need /* this one is longer than we need
so we'll make a new entry and split it up */ so we'll make a new entry and split it up */
split_node = acpiphp_make_resource(node->base + size, node->length - size); split_node = acpiphp_make_resource(node->base + size, node->length - size);
...@@ -509,7 +509,7 @@ struct pci_resource *acpiphp_get_resource_with_base (struct pci_resource **head, ...@@ -509,7 +509,7 @@ struct pci_resource *acpiphp_get_resource_with_base (struct pci_resource **head,
node->next = split_node; node->next = split_node;
} /* End of too big on top end */ } /* End of too big on top end */
dbg(": got one!!!"); dbg(": got one!!!\n");
/* If we got here, then it is the right size /* If we got here, then it is the right size
Now take it out of the list */ Now take it out of the list */
if (*head == node) { if (*head == node) {
...@@ -547,13 +547,13 @@ int acpiphp_resource_sort_and_combine (struct pci_resource **head) ...@@ -547,13 +547,13 @@ int acpiphp_resource_sort_and_combine (struct pci_resource **head)
if (!(*head)) if (!(*head))
return 1; return 1;
dbg("*head->next = %p",(*head)->next); dbg("*head->next = %p\n",(*head)->next);
if (!(*head)->next) if (!(*head)->next)
return 0; /* only one item on the list, already sorted! */ return 0; /* only one item on the list, already sorted! */
dbg("*head->base = 0x%x",(u32)(*head)->base); dbg("*head->base = 0x%x\n",(u32)(*head)->base);
dbg("*head->next->base = 0x%x", (u32)(*head)->next->base); dbg("*head->next->base = 0x%x\n", (u32)(*head)->next->base);
while (out_of_order) { while (out_of_order) {
out_of_order = 0; out_of_order = 0;
...@@ -587,7 +587,7 @@ int acpiphp_resource_sort_and_combine (struct pci_resource **head) ...@@ -587,7 +587,7 @@ int acpiphp_resource_sort_and_combine (struct pci_resource **head)
while (node1 && node1->next) { while (node1 && node1->next) {
if ((node1->base + node1->length) == node1->next->base) { if ((node1->base + node1->length) == node1->next->base) {
/* Combine */ /* Combine */
dbg("8.."); dbg("8..\n");
node1->length += node1->next->length; node1->length += node1->next->length;
node2 = node1->next; node2 = node1->next;
node1->next = node1->next->next; node1->next = node1->next->next;
...@@ -668,7 +668,7 @@ static void dump_resource(struct pci_resource *head) ...@@ -668,7 +668,7 @@ static void dump_resource(struct pci_resource *head)
cnt = 0; cnt = 0;
while (p) { while (p) {
dbg("[%02d] %08x - %08x", dbg("[%02d] %08x - %08x\n",
cnt++, (u32)p->base, (u32)p->base + p->length - 1); cnt++, (u32)p->base, (u32)p->base + p->length - 1);
p = p->next; p = p->next;
} }
...@@ -676,24 +676,24 @@ static void dump_resource(struct pci_resource *head) ...@@ -676,24 +676,24 @@ static void dump_resource(struct pci_resource *head)
void acpiphp_dump_resource(struct acpiphp_bridge *bridge) void acpiphp_dump_resource(struct acpiphp_bridge *bridge)
{ {
dbg("I/O resource:"); dbg("I/O resource:\n");
dump_resource(bridge->io_head); dump_resource(bridge->io_head);
dbg("MEM resource:"); dbg("MEM resource:\n");
dump_resource(bridge->mem_head); dump_resource(bridge->mem_head);
dbg("PMEM resource:"); dbg("PMEM resource:\n");
dump_resource(bridge->p_mem_head); dump_resource(bridge->p_mem_head);
dbg("BUS resource:"); dbg("BUS resource:\n");
dump_resource(bridge->bus_head); dump_resource(bridge->bus_head);
} }
void acpiphp_dump_func_resource(struct acpiphp_func *func) void acpiphp_dump_func_resource(struct acpiphp_func *func)
{ {
dbg("I/O resource:"); dbg("I/O resource:\n");
dump_resource(func->io_head); dump_resource(func->io_head);
dbg("MEM resource:"); dbg("MEM resource:\n");
dump_resource(func->mem_head); dump_resource(func->mem_head);
dbg("PMEM resource:"); dbg("PMEM resource:\n");
dump_resource(func->p_mem_head); dump_resource(func->p_mem_head);
dbg("BUS resource:"); dbg("BUS resource:\n");
dump_resource(func->bus_head); dump_resource(func->bus_head);
} }
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment