Skip to content

Commit

Permalink
PNP: in debug resource dump, make empty list obvious
Browse files Browse the repository at this point in the history
If the resource list is empty, say that explicitly.  Previously,
it was confusing because often the heading was followed by zero
resource lines, then some "add resource" lines from auto-assignment,
so the "add" lines looked like current resources.

Signed-off-by: Bjorn Helgaas <[email protected]>
Signed-off-by: Andi Kleen <[email protected]>
Acked-by: Rene Herman <[email protected]>
Signed-off-by: Len Brown <[email protected]>
  • Loading branch information
Bjorn Helgaas authored and Andi Kleen committed Jul 16, 2008
1 parent fcfb7ce commit 819beac
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion drivers/pnp/support.c
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,12 @@ void dbg_pnp_show_resources(struct pnp_dev *dev, char *desc)
struct pnp_resource *pnp_res;
struct resource *res;

dev_dbg(&dev->dev, "current resources: %s\n", desc);
if (list_empty(&dev->resources)) {
dev_dbg(&dev->dev, "%s: no current resources\n", desc);
return;
}

dev_dbg(&dev->dev, "%s: current resources:\n", desc);
list_for_each_entry(pnp_res, &dev->resources, list) {
res = &pnp_res->res;

Expand Down

0 comments on commit 819beac

Please sign in to comment.