Skip to content

Commit 15677df

Browse files
fredlawlgregkh
authored andcommitted
PCI: Add wrappers for dev_printk()
commit 7506dc7 upstream. Add PCI-specific dev_printk() wrappers and use them to simplify the code slightly. No functional change intended. Signed-off-by: Frederick Lawler <[email protected]> [bhelgaas: squash into one patch] Signed-off-by: Bjorn Helgaas <[email protected]> [only take the pci.h portion of this patch, to make backporting stuff easier over time - gregkh] Signed-off-by: Greg Kroah-Hartman <[email protected]>
1 parent 4bfd910 commit 15677df

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

include/linux/pci.h

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2292,4 +2292,16 @@ static inline bool pci_is_thunderbolt_attached(struct pci_dev *pdev)
22922292
/* provide the legacy pci_dma_* API */
22932293
#include <linux/pci-dma-compat.h>
22942294

2295+
#define pci_printk(level, pdev, fmt, arg...) \
2296+
dev_printk(level, &(pdev)->dev, fmt, ##arg)
2297+
2298+
#define pci_emerg(pdev, fmt, arg...) dev_emerg(&(pdev)->dev, fmt, ##arg)
2299+
#define pci_alert(pdev, fmt, arg...) dev_alert(&(pdev)->dev, fmt, ##arg)
2300+
#define pci_crit(pdev, fmt, arg...) dev_crit(&(pdev)->dev, fmt, ##arg)
2301+
#define pci_err(pdev, fmt, arg...) dev_err(&(pdev)->dev, fmt, ##arg)
2302+
#define pci_warn(pdev, fmt, arg...) dev_warn(&(pdev)->dev, fmt, ##arg)
2303+
#define pci_notice(pdev, fmt, arg...) dev_notice(&(pdev)->dev, fmt, ##arg)
2304+
#define pci_info(pdev, fmt, arg...) dev_info(&(pdev)->dev, fmt, ##arg)
2305+
#define pci_dbg(pdev, fmt, arg...) dev_dbg(&(pdev)->dev, fmt, ##arg)
2306+
22952307
#endif /* LINUX_PCI_H */

0 commit comments

Comments
 (0)