From 958a1fdd3904b009c926cb840be48ce3c5f2389e Mon Sep 17 00:00:00 2001 From: Bjorn Helgaas Date: Tue, 19 Aug 2008 16:53:21 -0600 Subject: PNPACPI: use dev_printk when possible Use dev_printk() when possible for more informative error messages. Signed-off-by: Bjorn Helgaas Signed-off-by: Andi Kleen Signed-off-by: Len Brown --- drivers/pnp/pnpacpi/rsparser.c | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) (limited to 'drivers/pnp/pnpacpi') diff --git a/drivers/pnp/pnpacpi/rsparser.c b/drivers/pnp/pnpacpi/rsparser.c index 95015cbfd33..0461d4b82c4 100644 --- a/drivers/pnp/pnpacpi/rsparser.c +++ b/drivers/pnp/pnpacpi/rsparser.c @@ -132,7 +132,8 @@ static void pnpacpi_parse_allocated_irqresource(struct pnp_dev *dev, 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; @@ -154,7 +155,7 @@ static int dma_flags(int type, int bus_master, int transfer) default: /* Set a default value ? */ flags |= IORESOURCE_DMA_COMPATIBLE; - pnp_err("Invalid DMA type"); + dev_err(&dev->dev, "invalid DMA type %d\n", type); } switch (transfer) { case ACPI_TRANSFER_8: @@ -169,7 +170,7 @@ static int dma_flags(int type, int bus_master, int transfer) default: /* Set a default value ? */ flags |= IORESOURCE_DMA_8AND16BIT; - pnp_err("Invalid DMA transfer type"); + dev_err(&dev->dev, "invalid DMA transfer type %d\n", transfer); } return flags; @@ -336,7 +337,7 @@ static acpi_status pnpacpi_allocated_resource(struct acpi_resource *res, case ACPI_RESOURCE_TYPE_DMA: dma = &res->data.dma; 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); else 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++) 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); } @@ -608,8 +609,8 @@ static __init void pnpacpi_parse_address_option(struct pnp_dev *dev, unsigned char flags = 0; status = acpi_resource_to_address64(r, p); - if (!ACPI_SUCCESS(status)) { - pnp_warn("PnPACPI: failed to convert resource type %d", + if (ACPI_FAILURE(status)) { + dev_warn(&dev->dev, "can't convert resource type %d\n", r->type); return; } -- cgit v1.2.3 From c865d2f6eb160c15b74245b4891c8e945d67d96c Mon Sep 17 00:00:00 2001 From: Bjorn Helgaas Date: Tue, 19 Aug 2008 16:53:26 -0600 Subject: PNP: convert the last few pnp_info() uses to printk() There are only a few remaining uses of pnp_info(), so I just converted them to printk and removed the pnp_err(), pnp_info(), pnp_warn(), and pnp_dbg() wrappers. I also removed a couple debug messages that don't seem useful any more ("driver registered", "driver unregistered", "driver attached"). Signed-off-by: Bjorn Helgaas Signed-off-by: Andi Kleen Signed-off-by: Len Brown --- drivers/pnp/pnpacpi/core.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'drivers/pnp/pnpacpi') diff --git a/drivers/pnp/pnpacpi/core.c b/drivers/pnp/pnpacpi/core.c index c1b9ea34977..67c651bcaf7 100644 --- a/drivers/pnp/pnpacpi/core.c +++ b/drivers/pnp/pnpacpi/core.c @@ -255,14 +255,14 @@ int pnpacpi_disabled __initdata; static int __init pnpacpi_init(void) { if (acpi_disabled || pnpacpi_disabled) { - pnp_info("PnP ACPI: disabled"); + printk(KERN_INFO "pnp: PnP ACPI: disabled\n"); return 0; } - pnp_info("PnP ACPI init"); + printk(KERN_INFO "pnp: PnP ACPI init\n"); pnp_register_protocol(&pnpacpi_protocol); register_acpi_bus_type(&acpi_pnp_bus); acpi_get_devices(NULL, pnpacpi_add_device_handler, NULL, NULL); - pnp_info("PnP ACPI: found %d devices", num); + printk(KERN_INFO "pnp: PnP ACPI: found %d devices\n", num); unregister_acpi_bus_type(&acpi_pnp_bus); pnp_platform_devices = 1; return 0; -- cgit v1.2.3 From 2f53432c2aedbe79020e44525eb069d9138a01dd Mon Sep 17 00:00:00 2001 From: Bjorn Helgaas Date: Tue, 19 Aug 2008 16:53:47 -0600 Subject: PNP: convert to using pnp_dbg() 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 Signed-off-by: Andi Kleen Signed-off-by: Len Brown --- drivers/pnp/pnpacpi/core.c | 4 ++-- drivers/pnp/pnpacpi/rsparser.c | 28 ++++++++++++++-------------- 2 files changed, 16 insertions(+), 16 deletions(-) (limited to 'drivers/pnp/pnpacpi') diff --git a/drivers/pnp/pnpacpi/core.c b/drivers/pnp/pnpacpi/core.c index 67c651bcaf7..b57d9d59dca 100644 --- a/drivers/pnp/pnpacpi/core.c +++ b/drivers/pnp/pnpacpi/core.c @@ -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); } @@ -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; diff --git a/drivers/pnp/pnpacpi/rsparser.c b/drivers/pnp/pnpacpi/rsparser.c index 0461d4b82c4..adf17856bac 100644 --- a/drivers/pnp/pnpacpi/rsparser.c +++ b/drivers/pnp/pnpacpi/rsparser.c @@ -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); @@ -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; @@ -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; } @@ -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", @@ -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; } @@ -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"); @@ -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; } @@ -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); } @@ -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); } @@ -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); } @@ -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); @@ -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); @@ -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); @@ -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: -- cgit v1.2.3 From ac88a8f3f7df04774b386ddaf586040adb819b58 Mon Sep 17 00:00:00 2001 From: Bjorn Helgaas Date: Tue, 19 Aug 2008 16:53:52 -0600 Subject: PNP: remove old CONFIG_PNP_DEBUG option CONFIG_PNP_DEBUG is no longer used to turn on dev_dbg() in PNP, since we have pnp_dbg() which can be enabled at boot-time, so this patch removes the config option. Note that pnp_dock_event() checks "#ifdef DEBUG". But there's never been a clear path for enabling that via configgery. It happened that CONFIG_PNP_DEBUG enabled it after 1bd17e63a068db6, but that was accidental and only in 2.6.26. Signed-off-by: Bjorn Helgaas Signed-off-by: Andi Kleen Signed-off-by: Len Brown --- drivers/pnp/pnpacpi/Makefile | 4 ---- 1 file changed, 4 deletions(-) (limited to 'drivers/pnp/pnpacpi') diff --git a/drivers/pnp/pnpacpi/Makefile b/drivers/pnp/pnpacpi/Makefile index 2d7a1e6908b..905326fcca8 100644 --- a/drivers/pnp/pnpacpi/Makefile +++ b/drivers/pnp/pnpacpi/Makefile @@ -3,7 +3,3 @@ # obj-y := core.o rsparser.o - -ifeq ($(CONFIG_PNP_DEBUG),y) -EXTRA_CFLAGS += -DDEBUG -endif -- cgit v1.2.3