[PATCH 1/2] PCI: Create minor pci_dev log wrapper functions

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Create minor pci_dev log wrapper functions

Signed-off-by: Frederick Lawler <fred@xxxxxxxxxxxx>
---
 include/linux/pci.h | 91 +++++++++++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 91 insertions(+)

diff --git a/include/linux/pci.h b/include/linux/pci.h
index 0403894..3d0e939 100644
--- a/include/linux/pci.h
+++ b/include/linux/pci.h
@@ -2278,4 +2278,95 @@ static inline bool pci_is_thunderbolt_attached(struct pci_dev *pdev)
 /* provide the legacy pci_dma_* API */
 #include <linux/pci-dma-compat.h>
 
+static inline void pci_printk(const char *level,
+			      const struct pci_dev *pdev,
+			      const char *fmt, ...)
+{
+	va_list argptr;
+
+	va_start(argptr, fmt);
+	dev_printk(level, &(pdev)->dev, fmt, argptr);
+	va_end(argptr);
+}
+
+static inline void pci_emerg(const struct pci_dev *pdev,
+			     const char *fmt, ...)
+{
+	va_list argptr;
+
+	va_start(argptr, fmt);
+	dev_emerg(&(pdev)->dev, fmt, argptr);
+	va_end(argptr);
+}
+
+static inline void pci_crit(const struct pci_dev *pdev,
+			    const char *fmt, ...)
+{
+	va_list argptr;
+
+	va_start(argptr, fmt);
+	dev_crit(&(pdev)->dev, fmt, argptr);
+	va_end(argptr);
+}
+
+static inline void pci_alert(const struct pci_dev *pdev,
+			     const char *fmt, ...)
+{
+	va_list argptr;
+
+	va_start(argptr, fmt);
+	dev_alert(&(pdev)->dev, fmt, argptr);
+	va_end(argptr);
+}
+
+static inline void pci_err(const struct pci_dev *pdev,
+			   const char *fmt, ...)
+{
+	va_list argptr;
+
+	va_start(argptr, fmt);
+	dev_err(&(pdev)->dev, fmt, argptr);
+	va_end(argptr);
+}
+
+static inline void pci_notice(const struct pci_dev *pdev,
+			      const char *fmt, ...)
+{
+	va_list argptr;
+
+	va_start(argptr, fmt);
+	dev_notice(&(pdev)->dev, fmt, argptr);
+	va_end(argptr);
+}
+
+static inline void pci_warn(const struct pci_dev *pdev,
+			    const char *fmt, ...)
+{
+	va_list argptr;
+
+	va_start(argptr, fmt);
+	dev_warn(&(pdev)->dev, fmt, argptr);
+	va_end(argptr);
+}
+
+static inline void pci_info(const struct pci_dev *pdev,
+			    const char *fmt, ...)
+{
+	va_list argptr;
+
+	va_start(argptr, fmt);
+	dev_info(&(pdev)->dev, fmt, argptr);
+	va_end(argptr);
+}
+
+static inline void pci_dbg(const struct pci_dev *pdev,
+			   const char *fmt, ...)
+{
+	va_list argptr;
+
+	va_start(argptr, fmt);
+	dev_dbg(&(pdev)->dev, fmt, argptr);
+	va_end(argptr);
+}
+
 #endif /* LINUX_PCI_H */
-- 
2.7.4




[Index of Archives]     [DMA Engine]     [Linux Coverity]     [Linux USB]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Greybus]

  Powered by Linux