Skip to content

Commit

Permalink
PNP: convert to using pnp_dbg()
Browse files Browse the repository at this point in the history
pnp_dbg() is equivalent to dev_dbg() except that we can turn it
on at boot-time with the "pnp.debug" kernel parameter, so we don't
have to build a new kernel image.

Signed-off-by: Bjorn Helgaas <bjorn.helgaas@hp.com>
Signed-off-by: Andi Kleen <ak@linux.intel.com>
Signed-off-by: Len Brown <len.brown@intel.com>
  • Loading branch information
Bjorn Helgaas authored and Len Brown committed Oct 11, 2008
1 parent 97ef062 commit 2f53432
Show file tree
Hide file tree
Showing 10 changed files with 63 additions and 63 deletions.
2 changes: 1 addition & 1 deletion drivers/pnp/core.c
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,7 @@ int pnp_add_device(struct pnp_dev *dev)
for (id = dev->id; id; id = id->next)
len += scnprintf(buf + len, sizeof(buf) - len, " %s", id->id);

dev_dbg(&dev->dev, "%s device, IDs%s (%s)\n",
pnp_dbg(&dev->dev, "%s device, IDs%s (%s)\n",
dev->protocol->name, buf, dev->active ? "active" : "disabled");
return 0;
}
Expand Down
12 changes: 6 additions & 6 deletions drivers/pnp/isapnp/core.c
Original file line number Diff line number Diff line change
Expand Up @@ -901,7 +901,7 @@ static int isapnp_get_resources(struct pnp_dev *dev)
{
int i, ret;

dev_dbg(&dev->dev, "get resources\n");
pnp_dbg(&dev->dev, "get resources\n");
pnp_init_resources(dev);
isapnp_cfg_begin(dev->card->number, dev->number);
dev->active = isapnp_read_byte(ISAPNP_CFG_ACTIVATE);
Expand Down Expand Up @@ -939,13 +939,13 @@ static int isapnp_set_resources(struct pnp_dev *dev)
struct resource *res;
int tmp;

dev_dbg(&dev->dev, "set resources\n");
pnp_dbg(&dev->dev, "set resources\n");
isapnp_cfg_begin(dev->card->number, dev->number);
dev->active = 1;
for (tmp = 0; tmp < ISAPNP_MAX_PORT; tmp++) {
res = pnp_get_resource(dev, IORESOURCE_IO, tmp);
if (pnp_resource_enabled(res)) {
dev_dbg(&dev->dev, " set io %d to %#llx\n",
pnp_dbg(&dev->dev, " set io %d to %#llx\n",
tmp, (unsigned long long) res->start);
isapnp_write_word(ISAPNP_CFG_PORT + (tmp << 1),
res->start);
Expand All @@ -957,22 +957,22 @@ static int isapnp_set_resources(struct pnp_dev *dev)
int irq = res->start;
if (irq == 2)
irq = 9;
dev_dbg(&dev->dev, " set irq %d to %d\n", tmp, irq);
pnp_dbg(&dev->dev, " set irq %d to %d\n", tmp, irq);
isapnp_write_byte(ISAPNP_CFG_IRQ + (tmp << 1), irq);
}
}
for (tmp = 0; tmp < ISAPNP_MAX_DMA; tmp++) {
res = pnp_get_resource(dev, IORESOURCE_DMA, tmp);
if (pnp_resource_enabled(res)) {
dev_dbg(&dev->dev, " set dma %d to %lld\n",
pnp_dbg(&dev->dev, " set dma %d to %lld\n",
tmp, (unsigned long long) res->start);
isapnp_write_byte(ISAPNP_CFG_DMA + tmp, res->start);
}
}
for (tmp = 0; tmp < ISAPNP_MAX_MEM; tmp++) {
res = pnp_get_resource(dev, IORESOURCE_MEM, tmp);
if (pnp_resource_enabled(res)) {
dev_dbg(&dev->dev, " set mem %d to %#llx\n",
pnp_dbg(&dev->dev, " set mem %d to %#llx\n",
tmp, (unsigned long long) res->start);
isapnp_write_word(ISAPNP_CFG_MEM + (tmp << 3),
(res->start >> 8) & 0xffff);
Expand Down
34 changes: 17 additions & 17 deletions drivers/pnp/manager.c
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ static int pnp_assign_port(struct pnp_dev *dev, struct pnp_port *rule, int idx)

res = pnp_get_resource(dev, IORESOURCE_IO, idx);
if (res) {
dev_dbg(&dev->dev, " io %d already set to %#llx-%#llx "
pnp_dbg(&dev->dev, " io %d already set to %#llx-%#llx "
"flags %#lx\n", idx, (unsigned long long) res->start,
(unsigned long long) res->end, res->flags);
return 0;
Expand All @@ -38,7 +38,7 @@ static int pnp_assign_port(struct pnp_dev *dev, struct pnp_port *rule, int idx)

if (!rule->size) {
res->flags |= IORESOURCE_DISABLED;
dev_dbg(&dev->dev, " io %d disabled\n", idx);
pnp_dbg(&dev->dev, " io %d disabled\n", idx);
goto __add;
}

Expand All @@ -49,7 +49,7 @@ static int pnp_assign_port(struct pnp_dev *dev, struct pnp_port *rule, int idx)
res->start += rule->align;
res->end = res->start + rule->size - 1;
if (res->start > rule->max || !rule->align) {
dev_dbg(&dev->dev, " couldn't assign io %d "
pnp_dbg(&dev->dev, " couldn't assign io %d "
"(min %#llx max %#llx)\n", idx,
(unsigned long long) rule->min,
(unsigned long long) rule->max);
Expand All @@ -68,7 +68,7 @@ static int pnp_assign_mem(struct pnp_dev *dev, struct pnp_mem *rule, int idx)

res = pnp_get_resource(dev, IORESOURCE_MEM, idx);
if (res) {
dev_dbg(&dev->dev, " mem %d already set to %#llx-%#llx "
pnp_dbg(&dev->dev, " mem %d already set to %#llx-%#llx "
"flags %#lx\n", idx, (unsigned long long) res->start,
(unsigned long long) res->end, res->flags);
return 0;
Expand All @@ -90,7 +90,7 @@ static int pnp_assign_mem(struct pnp_dev *dev, struct pnp_mem *rule, int idx)

if (!rule->size) {
res->flags |= IORESOURCE_DISABLED;
dev_dbg(&dev->dev, " mem %d disabled\n", idx);
pnp_dbg(&dev->dev, " mem %d disabled\n", idx);
goto __add;
}

Expand All @@ -101,7 +101,7 @@ static int pnp_assign_mem(struct pnp_dev *dev, struct pnp_mem *rule, int idx)
res->start += rule->align;
res->end = res->start + rule->size - 1;
if (res->start > rule->max || !rule->align) {
dev_dbg(&dev->dev, " couldn't assign mem %d "
pnp_dbg(&dev->dev, " couldn't assign mem %d "
"(min %#llx max %#llx)\n", idx,
(unsigned long long) rule->min,
(unsigned long long) rule->max);
Expand All @@ -126,7 +126,7 @@ static int pnp_assign_irq(struct pnp_dev *dev, struct pnp_irq *rule, int idx)

res = pnp_get_resource(dev, IORESOURCE_IRQ, idx);
if (res) {
dev_dbg(&dev->dev, " irq %d already set to %d flags %#lx\n",
pnp_dbg(&dev->dev, " irq %d already set to %d flags %#lx\n",
idx, (int) res->start, res->flags);
return 0;
}
Expand All @@ -138,7 +138,7 @@ static int pnp_assign_irq(struct pnp_dev *dev, struct pnp_irq *rule, int idx)

if (bitmap_empty(rule->map.bits, PNP_IRQ_NR)) {
res->flags |= IORESOURCE_DISABLED;
dev_dbg(&dev->dev, " irq %d disabled\n", idx);
pnp_dbg(&dev->dev, " irq %d disabled\n", idx);
goto __add;
}

Expand All @@ -160,11 +160,11 @@ static int pnp_assign_irq(struct pnp_dev *dev, struct pnp_irq *rule, int idx)
res->start = -1;
res->end = -1;
res->flags |= IORESOURCE_DISABLED;
dev_dbg(&dev->dev, " irq %d disabled (optional)\n", idx);
pnp_dbg(&dev->dev, " irq %d disabled (optional)\n", idx);
goto __add;
}

dev_dbg(&dev->dev, " couldn't assign irq %d\n", idx);
pnp_dbg(&dev->dev, " couldn't assign irq %d\n", idx);
return -EBUSY;

__add:
Expand All @@ -184,7 +184,7 @@ static int pnp_assign_dma(struct pnp_dev *dev, struct pnp_dma *rule, int idx)

res = pnp_get_resource(dev, IORESOURCE_DMA, idx);
if (res) {
dev_dbg(&dev->dev, " dma %d already set to %d flags %#lx\n",
pnp_dbg(&dev->dev, " dma %d already set to %d flags %#lx\n",
idx, (int) res->start, res->flags);
return 0;
}
Expand All @@ -205,7 +205,7 @@ static int pnp_assign_dma(struct pnp_dev *dev, struct pnp_dma *rule, int idx)
res->start = res->end = MAX_DMA_CHANNELS;
#endif
res->flags |= IORESOURCE_DISABLED;
dev_dbg(&dev->dev, " disable dma %d\n", idx);
pnp_dbg(&dev->dev, " disable dma %d\n", idx);

__add:
pnp_add_dma_resource(dev, res->start, res->flags);
Expand Down Expand Up @@ -238,7 +238,7 @@ static int pnp_assign_resources(struct pnp_dev *dev, int set)
int nport = 0, nmem = 0, nirq = 0, ndma = 0;
int ret = 0;

dev_dbg(&dev->dev, "pnp_assign_resources, try dependent set %d\n", set);
pnp_dbg(&dev->dev, "pnp_assign_resources, try dependent set %d\n", set);
mutex_lock(&pnp_res_mutex);
pnp_clean_resource_table(dev);

Expand Down Expand Up @@ -270,7 +270,7 @@ static int pnp_assign_resources(struct pnp_dev *dev, int set)

mutex_unlock(&pnp_res_mutex);
if (ret < 0) {
dev_dbg(&dev->dev, "pnp_assign_resources failed (%d)\n", ret);
pnp_dbg(&dev->dev, "pnp_assign_resources failed (%d)\n", ret);
pnp_clean_resource_table(dev);
} else
dbg_pnp_show_resources(dev, "pnp_assign_resources succeeded");
Expand All @@ -286,7 +286,7 @@ int pnp_auto_config_dev(struct pnp_dev *dev)
int i, ret;

if (!pnp_can_configure(dev)) {
dev_dbg(&dev->dev, "configuration not supported\n");
pnp_dbg(&dev->dev, "configuration not supported\n");
return -ENODEV;
}

Expand All @@ -313,7 +313,7 @@ int pnp_auto_config_dev(struct pnp_dev *dev)
int pnp_start_dev(struct pnp_dev *dev)
{
if (!pnp_can_write(dev)) {
dev_dbg(&dev->dev, "activation not supported\n");
pnp_dbg(&dev->dev, "activation not supported\n");
return -EINVAL;
}

Expand All @@ -336,7 +336,7 @@ int pnp_start_dev(struct pnp_dev *dev)
int pnp_stop_dev(struct pnp_dev *dev)
{
if (!pnp_can_disable(dev)) {
dev_dbg(&dev->dev, "disabling not supported\n");
pnp_dbg(&dev->dev, "disabling not supported\n");
return -EINVAL;
}
if (dev->protocol->disable(dev) < 0) {
Expand Down
4 changes: 2 additions & 2 deletions drivers/pnp/pnpacpi/core.c
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ static int __init ispnpidacpi(char *id)

static int pnpacpi_get_resources(struct pnp_dev *dev)
{
dev_dbg(&dev->dev, "get resources\n");
pnp_dbg(&dev->dev, "get resources\n");
return pnpacpi_parse_allocated_resource(dev);
}

Expand All @@ -86,7 +86,7 @@ static int pnpacpi_set_resources(struct pnp_dev *dev)
int ret;
acpi_status status;

dev_dbg(&dev->dev, "set resources\n");
pnp_dbg(&dev->dev, "set resources\n");
ret = pnpacpi_build_resource_template(dev, &buffer);
if (ret)
return ret;
Expand Down
28 changes: 14 additions & 14 deletions drivers/pnp/pnpacpi/rsparser.c
Original file line number Diff line number Diff line change
Expand Up @@ -450,7 +450,7 @@ int pnpacpi_parse_allocated_resource(struct pnp_dev *dev)
acpi_handle handle = dev->data;
acpi_status status;

dev_dbg(&dev->dev, "parse allocated resources\n");
pnp_dbg(&dev->dev, "parse allocated resources\n");

pnp_init_resources(dev);

Expand Down Expand Up @@ -736,7 +736,7 @@ int __init pnpacpi_parse_resource_option_data(struct pnp_dev *dev)
acpi_status status;
struct acpipnp_parse_option_s parse_data;

dev_dbg(&dev->dev, "parse resource options\n");
pnp_dbg(&dev->dev, "parse resource options\n");

parse_data.dev = dev;
parse_data.option_flags = 0;
Expand Down Expand Up @@ -844,7 +844,7 @@ static void pnpacpi_encode_irq(struct pnp_dev *dev,

if (!pnp_resource_enabled(p)) {
irq->interrupt_count = 0;
dev_dbg(&dev->dev, " encode irq (%s)\n",
pnp_dbg(&dev->dev, " encode irq (%s)\n",
p ? "disabled" : "missing");
return;
}
Expand All @@ -856,7 +856,7 @@ static void pnpacpi_encode_irq(struct pnp_dev *dev,
irq->interrupt_count = 1;
irq->interrupts[0] = p->start;

dev_dbg(&dev->dev, " encode irq %d %s %s %s (%d-byte descriptor)\n",
pnp_dbg(&dev->dev, " encode irq %d %s %s %s (%d-byte descriptor)\n",
(int) p->start,
triggering == ACPI_LEVEL_SENSITIVE ? "level" : "edge",
polarity == ACPI_ACTIVE_LOW ? "low" : "high",
Expand All @@ -873,7 +873,7 @@ static void pnpacpi_encode_ext_irq(struct pnp_dev *dev,

if (!pnp_resource_enabled(p)) {
extended_irq->interrupt_count = 0;
dev_dbg(&dev->dev, " encode extended irq (%s)\n",
pnp_dbg(&dev->dev, " encode extended irq (%s)\n",
p ? "disabled" : "missing");
return;
}
Expand All @@ -886,7 +886,7 @@ static void pnpacpi_encode_ext_irq(struct pnp_dev *dev,
extended_irq->interrupt_count = 1;
extended_irq->interrupts[0] = p->start;

dev_dbg(&dev->dev, " encode irq %d %s %s %s\n", (int) p->start,
pnp_dbg(&dev->dev, " encode irq %d %s %s %s\n", (int) p->start,
triggering == ACPI_LEVEL_SENSITIVE ? "level" : "edge",
polarity == ACPI_ACTIVE_LOW ? "low" : "high",
extended_irq->sharable == ACPI_SHARED ? "shared" : "exclusive");
Expand All @@ -900,7 +900,7 @@ static void pnpacpi_encode_dma(struct pnp_dev *dev,

if (!pnp_resource_enabled(p)) {
dma->channel_count = 0;
dev_dbg(&dev->dev, " encode dma (%s)\n",
pnp_dbg(&dev->dev, " encode dma (%s)\n",
p ? "disabled" : "missing");
return;
}
Expand Down Expand Up @@ -935,7 +935,7 @@ static void pnpacpi_encode_dma(struct pnp_dev *dev,
dma->channel_count = 1;
dma->channels[0] = p->start;

dev_dbg(&dev->dev, " encode dma %d "
pnp_dbg(&dev->dev, " encode dma %d "
"type %#x transfer %#x master %d\n",
(int) p->start, dma->type, dma->transfer, dma->bus_master);
}
Expand All @@ -959,7 +959,7 @@ static void pnpacpi_encode_io(struct pnp_dev *dev,
io->address_length = 0;
}

dev_dbg(&dev->dev, " encode io %#x-%#x decode %#x\n", io->minimum,
pnp_dbg(&dev->dev, " encode io %#x-%#x decode %#x\n", io->minimum,
io->minimum + io->address_length - 1, io->io_decode);
}

Expand All @@ -977,7 +977,7 @@ static void pnpacpi_encode_fixed_io(struct pnp_dev *dev,
fixed_io->address_length = 0;
}

dev_dbg(&dev->dev, " encode fixed_io %#x-%#x\n", fixed_io->address,
pnp_dbg(&dev->dev, " encode fixed_io %#x-%#x\n", fixed_io->address,
fixed_io->address + fixed_io->address_length - 1);
}

Expand All @@ -1000,7 +1000,7 @@ static void pnpacpi_encode_mem24(struct pnp_dev *dev,
memory24->address_length = 0;
}

dev_dbg(&dev->dev, " encode mem24 %#x-%#x write_protect %#x\n",
pnp_dbg(&dev->dev, " encode mem24 %#x-%#x write_protect %#x\n",
memory24->minimum,
memory24->minimum + memory24->address_length - 1,
memory24->write_protect);
Expand All @@ -1024,7 +1024,7 @@ static void pnpacpi_encode_mem32(struct pnp_dev *dev,
memory32->alignment = 0;
}

dev_dbg(&dev->dev, " encode mem32 %#x-%#x write_protect %#x\n",
pnp_dbg(&dev->dev, " encode mem32 %#x-%#x write_protect %#x\n",
memory32->minimum,
memory32->minimum + memory32->address_length - 1,
memory32->write_protect);
Expand All @@ -1047,7 +1047,7 @@ static void pnpacpi_encode_fixed_mem32(struct pnp_dev *dev,
fixed_memory32->address_length = 0;
}

dev_dbg(&dev->dev, " encode fixed_mem32 %#x-%#x write_protect %#x\n",
pnp_dbg(&dev->dev, " encode fixed_mem32 %#x-%#x write_protect %#x\n",
fixed_memory32->address,
fixed_memory32->address + fixed_memory32->address_length - 1,
fixed_memory32->write_protect);
Expand All @@ -1061,7 +1061,7 @@ int pnpacpi_encode_resources(struct pnp_dev *dev, struct acpi_buffer *buffer)
struct acpi_resource *resource = buffer->pointer;
int port = 0, irq = 0, dma = 0, mem = 0;

dev_dbg(&dev->dev, "encode %d resources\n", res_cnt);
pnp_dbg(&dev->dev, "encode %d resources\n", res_cnt);
while (i < res_cnt) {
switch (resource->type) {
case ACPI_RESOURCE_TYPE_IRQ:
Expand Down
4 changes: 2 additions & 2 deletions drivers/pnp/pnpbios/core.c
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,7 @@ static int pnpbios_get_resources(struct pnp_dev *dev)
if (!pnpbios_is_dynamic(dev))
return -EPERM;

dev_dbg(&dev->dev, "get resources\n");
pnp_dbg(&dev->dev, "get resources\n");
node = kzalloc(node_info.max_node_size, GFP_KERNEL);
if (!node)
return -1;
Expand All @@ -234,7 +234,7 @@ static int pnpbios_set_resources(struct pnp_dev *dev)
if (!pnpbios_is_dynamic(dev))
return -EPERM;

dev_dbg(&dev->dev, "set resources\n");
pnp_dbg(&dev->dev, "set resources\n");
node = kzalloc(node_info.max_node_size, GFP_KERNEL);
if (!node)
return -1;
Expand Down
Loading

0 comments on commit 2f53432

Please sign in to comment.