Skip to content

Commit bf5144a

Browse files
committed
ACPI: PCI: IRQ: Consolidate printing diagnostic messages
The code in pci_irq.c prints diagnostic messages using different and inconsistent methods. The majority of them are printed with the help of the dev_*() familiy of logging functions, but ACPI_DEBUG_PRINT() and ACPI_DEBUG_PRINT_RAW() are still used in some places which requires the ACPICA debug to be enabled additionally which is a nuisance and one message is printed using the raw printk(). To consolidate the printing of messages in that code, convert all of the ACPI_DEBUG_PRINT() instances in it into dev_dbg(), which is consistent with the way the other messages are printed by it, replace the only ACPI_DEBUG_PRINT_RAW() instance with pr_debug() and make it use pr_warn() istead of printk(KERN_WARNING ). Also add a pr_fmt() definition to that file and drop the _COMPONENT and ACPI_MODULE_NAME() definitions that are not used any more after the above changes. Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com> Reviewed-by: Hanjun Guo <guohanjun@huawei.com>
1 parent a38fd87 commit bf5144a

1 file changed

Lines changed: 10 additions & 24 deletions

File tree

drivers/acpi/pci_irq.c

Lines changed: 10 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
* Bjorn Helgaas <bjorn.helgaas@hp.com>
1010
*/
1111

12+
#define pr_fmt(fmt) "ACPI: PCI: " fmt
1213

1314
#include <linux/dmi.h>
1415
#include <linux/kernel.h>
@@ -22,11 +23,6 @@
2223
#include <linux/slab.h>
2324
#include <linux/interrupt.h>
2425

25-
#define PREFIX "ACPI: "
26-
27-
#define _COMPONENT ACPI_PCI_COMPONENT
28-
ACPI_MODULE_NAME("pci_irq");
29-
3026
struct acpi_prt_entry {
3127
struct acpi_pci_id id;
3228
u8 pin;
@@ -126,7 +122,7 @@ static void do_prt_fixups(struct acpi_prt_entry *entry,
126122
entry->pin == quirk->pin &&
127123
!strcmp(prt->source, quirk->source) &&
128124
strlen(prt->source) >= strlen(quirk->actual_source)) {
129-
printk(KERN_WARNING PREFIX "firmware reports "
125+
pr_warn("Firmware reports "
130126
"%04x:%02x:%02x PCI INT %c connected to %s; "
131127
"changing to %s\n",
132128
entry->id.segment, entry->id.bus,
@@ -191,12 +187,9 @@ static int acpi_pci_irq_check_entry(acpi_handle handle, struct pci_dev *dev,
191187
* the IRQ value, which is hardwired to specific interrupt inputs on
192188
* the interrupt controller.
193189
*/
194-
195-
ACPI_DEBUG_PRINT_RAW((ACPI_DB_INFO,
196-
" %04x:%02x:%02x[%c] -> %s[%d]\n",
197-
entry->id.segment, entry->id.bus,
198-
entry->id.device, pin_name(entry->pin),
199-
prt->source, entry->index));
190+
pr_debug("%04x:%02x:%02x[%c] -> %s[%d]\n",
191+
entry->id.segment, entry->id.bus, entry->id.device,
192+
pin_name(entry->pin), prt->source, entry->index);
200193

201194
*entry_ptr = entry;
202195

@@ -307,8 +300,7 @@ static struct acpi_prt_entry *acpi_pci_irq_lookup(struct pci_dev *dev, int pin)
307300
#ifdef CONFIG_X86_IO_APIC
308301
acpi_reroute_boot_interrupt(dev, entry);
309302
#endif /* CONFIG_X86_IO_APIC */
310-
ACPI_DEBUG_PRINT((ACPI_DB_INFO, "Found %s[%c] _PRT entry\n",
311-
pci_name(dev), pin_name(pin)));
303+
dev_dbg(&dev->dev, "Found [%c] _PRT entry\n", pin_name(pin));
312304
return entry;
313305
}
314306

@@ -324,20 +316,16 @@ static struct acpi_prt_entry *acpi_pci_irq_lookup(struct pci_dev *dev, int pin)
324316
/* PC card has the same IRQ as its cardbridge */
325317
bridge_pin = bridge->pin;
326318
if (!bridge_pin) {
327-
ACPI_DEBUG_PRINT((ACPI_DB_INFO,
328-
"No interrupt pin configured for device %s\n",
329-
pci_name(bridge)));
319+
dev_dbg(&bridge->dev, "No interrupt pin configured\n");
330320
return NULL;
331321
}
332322
pin = bridge_pin;
333323
}
334324

335325
ret = acpi_pci_irq_find_prt_entry(bridge, pin, &entry);
336326
if (!ret && entry) {
337-
ACPI_DEBUG_PRINT((ACPI_DB_INFO,
338-
"Derived GSI for %s INT %c from %s\n",
339-
pci_name(dev), pin_name(orig_pin),
340-
pci_name(bridge)));
327+
dev_dbg(&dev->dev, "Derived GSI INT %c from %s\n",
328+
pin_name(orig_pin), pci_name(bridge));
341329
return entry;
342330
}
343331

@@ -413,9 +401,7 @@ int acpi_pci_irq_enable(struct pci_dev *dev)
413401

414402
pin = dev->pin;
415403
if (!pin) {
416-
ACPI_DEBUG_PRINT((ACPI_DB_INFO,
417-
"No interrupt pin configured for device %s\n",
418-
pci_name(dev)));
404+
dev_dbg(&dev->dev, "No interrupt pin configured\n");
419405
return 0;
420406
}
421407

0 commit comments

Comments
 (0)