Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

PCI: pciehp: Log messages with pci_dev, not pcie_device

Log messages with pci_dev, not pcie_device. Factor out common message
prefixes with dev_fmt().

Example output change:

- pciehp 0000:00:06.0:pcie004: Slot(0) Powering on due to button press
+ pcieport 0000:00:06.0: pciehp: Slot(0) Powering on due to button press

Link: https://lore.kernel.org/lkml/20190509141456.223614-8-helgaas@kernel.org
Signed-off-by: Frederick Lawler <fred@fredlawl.com>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Reviewed-by: Keith Busch <keith.busch@intel.com>
Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com>

authored by

Frederick Lawler and committed by
Bjorn Helgaas
94dbc956 01712472

+19 -10
+8 -8
drivers/pci/hotplug/pciehp.h
··· 35 35 * enable debug messages. 36 36 */ 37 37 #define dbg(format, arg...) \ 38 - pr_debug("%s: " format, MY_NAME, ## arg); 38 + pr_debug(format, ## arg); 39 39 #define err(format, arg...) \ 40 - printk(KERN_ERR "%s: " format, MY_NAME, ## arg) 40 + pr_err(format, ## arg) 41 41 #define info(format, arg...) \ 42 - printk(KERN_INFO "%s: " format, MY_NAME, ## arg) 42 + pr_info(format, ## arg) 43 43 #define warn(format, arg...) \ 44 - printk(KERN_WARNING "%s: " format, MY_NAME, ## arg) 44 + pr_warn(format, ## arg) 45 45 46 46 #define ctrl_dbg(ctrl, format, arg...) \ 47 - dev_dbg(&ctrl->pcie->device, format, ## arg) 47 + pci_dbg(ctrl->pcie->port, format, ## arg) 48 48 #define ctrl_err(ctrl, format, arg...) \ 49 - dev_err(&ctrl->pcie->device, format, ## arg) 49 + pci_err(ctrl->pcie->port, format, ## arg) 50 50 #define ctrl_info(ctrl, format, arg...) \ 51 - dev_info(&ctrl->pcie->device, format, ## arg) 51 + pci_info(ctrl->pcie->port, format, ## arg) 52 52 #define ctrl_warn(ctrl, format, arg...) \ 53 - dev_warn(&ctrl->pcie->device, format, ## arg) 53 + pci_warn(ctrl->pcie->port, format, ## arg) 54 54 55 55 #define SLOT_NAME_SIZE 10 56 56
+5 -2
drivers/pci/hotplug/pciehp_core.c
··· 17 17 * Dely Sy <dely.l.sy@intel.com>" 18 18 */ 19 19 20 + #define pr_fmt(fmt) "pciehp: " fmt 21 + #define dev_fmt pr_fmt 22 + 20 23 #include <linux/moduleparam.h> 21 24 #include <linux/kernel.h> 22 25 #include <linux/slab.h> ··· 182 179 183 180 if (!dev->port->subordinate) { 184 181 /* Can happen if we run out of bus numbers during probe */ 185 - dev_err(&dev->device, 182 + pci_err(dev->port, 186 183 "Hotplug bridge without secondary bus, ignoring\n"); 187 184 return -ENODEV; 188 185 } 189 186 190 187 ctrl = pcie_init(dev); 191 188 if (!ctrl) { 192 - dev_err(&dev->device, "Controller initialization failed\n"); 189 + pci_err(dev->port, "Controller initialization failed\n"); 193 190 return -ENODEV; 194 191 } 195 192 set_service_data(dev, ctrl);
+2
drivers/pci/hotplug/pciehp_ctrl.c
··· 13 13 * 14 14 */ 15 15 16 + #define dev_fmt(fmt) "pciehp: " fmt 17 + 16 18 #include <linux/kernel.h> 17 19 #include <linux/types.h> 18 20 #include <linux/pm_runtime.h>
+2
drivers/pci/hotplug/pciehp_hpc.c
··· 12 12 * Send feedback to <greg@kroah.com>,<kristen.c.accardi@intel.com> 13 13 */ 14 14 15 + #define dev_fmt(fmt) "pciehp: " fmt 16 + 15 17 #include <linux/kernel.h> 16 18 #include <linux/types.h> 17 19 #include <linux/jiffies.h>
+2
drivers/pci/hotplug/pciehp_pci.c
··· 13 13 * 14 14 */ 15 15 16 + #define dev_fmt(fmt) "pciehp: " fmt 17 + 16 18 #include <linux/kernel.h> 17 19 #include <linux/types.h> 18 20 #include <linux/pci.h>