PNPACPI: use dev_printk when possible

Use dev_printk() when possible for more informative error messages.

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>
This commit is contained in:
Bjorn Helgaas 2008-08-19 16:53:21 -06:00 committed by Len Brown
parent 6a0b93bae9
commit 958a1fdd39
1 changed files with 8 additions and 7 deletions

View File

@ -132,7 +132,8 @@ static void pnpacpi_parse_allocated_irqresource(struct pnp_dev *dev,
pnp_add_irq_resource(dev, irq, flags); pnp_add_irq_resource(dev, irq, flags);
} }
static int dma_flags(int type, int bus_master, int transfer) static int dma_flags(struct pnp_dev *dev, int type, int bus_master,
int transfer)
{ {
int flags = 0; int flags = 0;
@ -154,7 +155,7 @@ static int dma_flags(int type, int bus_master, int transfer)
default: default:
/* Set a default value ? */ /* Set a default value ? */
flags |= IORESOURCE_DMA_COMPATIBLE; flags |= IORESOURCE_DMA_COMPATIBLE;
pnp_err("Invalid DMA type"); dev_err(&dev->dev, "invalid DMA type %d\n", type);
} }
switch (transfer) { switch (transfer) {
case ACPI_TRANSFER_8: case ACPI_TRANSFER_8:
@ -169,7 +170,7 @@ static int dma_flags(int type, int bus_master, int transfer)
default: default:
/* Set a default value ? */ /* Set a default value ? */
flags |= IORESOURCE_DMA_8AND16BIT; flags |= IORESOURCE_DMA_8AND16BIT;
pnp_err("Invalid DMA transfer type"); dev_err(&dev->dev, "invalid DMA transfer type %d\n", transfer);
} }
return flags; return flags;
@ -336,7 +337,7 @@ static acpi_status pnpacpi_allocated_resource(struct acpi_resource *res,
case ACPI_RESOURCE_TYPE_DMA: case ACPI_RESOURCE_TYPE_DMA:
dma = &res->data.dma; dma = &res->data.dma;
if (dma->channel_count > 0 && dma->channels[0] != (u8) -1) if (dma->channel_count > 0 && dma->channels[0] != (u8) -1)
flags = dma_flags(dma->type, dma->bus_master, flags = dma_flags(dev, dma->type, dma->bus_master,
dma->transfer); dma->transfer);
else else
flags = IORESOURCE_DISABLED; flags = IORESOURCE_DISABLED;
@ -477,7 +478,7 @@ static __init void pnpacpi_parse_dma_option(struct pnp_dev *dev,
for (i = 0; i < p->channel_count; i++) for (i = 0; i < p->channel_count; i++)
map |= 1 << p->channels[i]; map |= 1 << p->channels[i];
flags = dma_flags(p->type, p->bus_master, p->transfer); flags = dma_flags(dev, p->type, p->bus_master, p->transfer);
pnp_register_dma_resource(dev, option_flags, map, flags); pnp_register_dma_resource(dev, option_flags, map, flags);
} }
@ -608,8 +609,8 @@ static __init void pnpacpi_parse_address_option(struct pnp_dev *dev,
unsigned char flags = 0; unsigned char flags = 0;
status = acpi_resource_to_address64(r, p); status = acpi_resource_to_address64(r, p);
if (!ACPI_SUCCESS(status)) { if (ACPI_FAILURE(status)) {
pnp_warn("PnPACPI: failed to convert resource type %d", dev_warn(&dev->dev, "can't convert resource type %d\n",
r->type); r->type);
return; return;
} }