PCI: Use dev_printk() when possible
authorBjorn Helgaas <bhelgaas@google.com>
Tue, 7 May 2019 22:37:53 +0000 (17:37 -0500)
committerBjorn Helgaas <bhelgaas@google.com>
Thu, 9 May 2019 12:49:49 +0000 (07:49 -0500)
Use dev_printk() when possible.  This makes messages more consistent with
other device-related messages and, in some cases, adds useful information.

Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
drivers/pci/pci-sysfs.c
drivers/pci/quirks.c

index 25794c27c7a4b960b5ed2e0293638d69d4ac9969..6d27475e39b2b9ab77f95c7e7b6e3f67d2881991 100644 (file)
@@ -1111,8 +1111,7 @@ legacy_io_err:
        kfree(b->legacy_io);
        b->legacy_io = NULL;
 kzalloc_err:
-       printk(KERN_WARNING "pci: warning: could not create legacy I/O port and ISA memory resources to sysfs\n");
-       return;
+       dev_warn(&b->dev, "could not create legacy I/O port and ISA memory resources in sysfs\n");
 }
 
 void pci_remove_legacy_files(struct pci_bus *b)
index a59ad09ce911d564c074930ea22968fcfab928e7..0f0f73ff9ee245827dddf6e7ac4467f2e6ec5466 100644 (file)
@@ -177,9 +177,9 @@ static int __init pci_apply_final_quirks(void)
                        if (!tmp || cls == tmp)
                                continue;
 
-                       printk(KERN_DEBUG "PCI: CLS mismatch (%u != %u), using %u bytes\n",
-                              cls << 2, tmp << 2,
-                              pci_dfl_cache_line_size << 2);
+                       pci_printk(KERN_DEBUG, dev, "CLS mismatch (%u != %u), using %u bytes\n",
+                                  cls << 2, tmp << 2,
+                                  pci_dfl_cache_line_size << 2);
                        pci_cache_line_size = pci_dfl_cache_line_size;
                }
        }