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>
This commit is contained in:
Frederick Lawler 2019-05-07 18:24:51 -05:00 коммит произвёл Bjorn Helgaas
Родитель 017124725c
Коммит 94dbc9562e
5 изменённых файлов: 19 добавлений и 10 удалений

Просмотреть файл

@ -35,22 +35,22 @@ extern int pciehp_poll_time;
* enable debug messages. * enable debug messages.
*/ */
#define dbg(format, arg...) \ #define dbg(format, arg...) \
pr_debug("%s: " format, MY_NAME, ## arg); pr_debug(format, ## arg);
#define err(format, arg...) \ #define err(format, arg...) \
printk(KERN_ERR "%s: " format, MY_NAME, ## arg) pr_err(format, ## arg)
#define info(format, arg...) \ #define info(format, arg...) \
printk(KERN_INFO "%s: " format, MY_NAME, ## arg) pr_info(format, ## arg)
#define warn(format, arg...) \ #define warn(format, arg...) \
printk(KERN_WARNING "%s: " format, MY_NAME, ## arg) pr_warn(format, ## arg)
#define ctrl_dbg(ctrl, format, arg...) \ #define ctrl_dbg(ctrl, format, arg...) \
dev_dbg(&ctrl->pcie->device, format, ## arg) pci_dbg(ctrl->pcie->port, format, ## arg)
#define ctrl_err(ctrl, format, arg...) \ #define ctrl_err(ctrl, format, arg...) \
dev_err(&ctrl->pcie->device, format, ## arg) pci_err(ctrl->pcie->port, format, ## arg)
#define ctrl_info(ctrl, format, arg...) \ #define ctrl_info(ctrl, format, arg...) \
dev_info(&ctrl->pcie->device, format, ## arg) pci_info(ctrl->pcie->port, format, ## arg)
#define ctrl_warn(ctrl, format, arg...) \ #define ctrl_warn(ctrl, format, arg...) \
dev_warn(&ctrl->pcie->device, format, ## arg) pci_warn(ctrl->pcie->port, format, ## arg)
#define SLOT_NAME_SIZE 10 #define SLOT_NAME_SIZE 10

Просмотреть файл

@ -17,6 +17,9 @@
* Dely Sy <dely.l.sy@intel.com>" * Dely Sy <dely.l.sy@intel.com>"
*/ */
#define pr_fmt(fmt) "pciehp: " fmt
#define dev_fmt pr_fmt
#include <linux/moduleparam.h> #include <linux/moduleparam.h>
#include <linux/kernel.h> #include <linux/kernel.h>
#include <linux/slab.h> #include <linux/slab.h>
@ -179,14 +182,14 @@ static int pciehp_probe(struct pcie_device *dev)
if (!dev->port->subordinate) { if (!dev->port->subordinate) {
/* Can happen if we run out of bus numbers during probe */ /* Can happen if we run out of bus numbers during probe */
dev_err(&dev->device, pci_err(dev->port,
"Hotplug bridge without secondary bus, ignoring\n"); "Hotplug bridge without secondary bus, ignoring\n");
return -ENODEV; return -ENODEV;
} }
ctrl = pcie_init(dev); ctrl = pcie_init(dev);
if (!ctrl) { if (!ctrl) {
dev_err(&dev->device, "Controller initialization failed\n"); pci_err(dev->port, "Controller initialization failed\n");
return -ENODEV; return -ENODEV;
} }
set_service_data(dev, ctrl); set_service_data(dev, ctrl);

Просмотреть файл

@ -13,6 +13,8 @@
* *
*/ */
#define dev_fmt(fmt) "pciehp: " fmt
#include <linux/kernel.h> #include <linux/kernel.h>
#include <linux/types.h> #include <linux/types.h>
#include <linux/pm_runtime.h> #include <linux/pm_runtime.h>

Просмотреть файл

@ -12,6 +12,8 @@
* Send feedback to <greg@kroah.com>,<kristen.c.accardi@intel.com> * Send feedback to <greg@kroah.com>,<kristen.c.accardi@intel.com>
*/ */
#define dev_fmt(fmt) "pciehp: " fmt
#include <linux/kernel.h> #include <linux/kernel.h>
#include <linux/types.h> #include <linux/types.h>
#include <linux/jiffies.h> #include <linux/jiffies.h>

Просмотреть файл

@ -13,6 +13,8 @@
* *
*/ */
#define dev_fmt(fmt) "pciehp: " fmt
#include <linux/kernel.h> #include <linux/kernel.h>
#include <linux/types.h> #include <linux/types.h>
#include <linux/pci.h> #include <linux/pci.h>