aboutsummaryrefslogtreecommitdiffstats
path: root/arch/powerpc/platforms/powernv
diff options
context:
space:
mode:
Diffstat (limited to 'arch/powerpc/platforms/powernv')
-rw-r--r--arch/powerpc/platforms/powernv/pci-ioda.c25
1 files changed, 11 insertions, 14 deletions
diff --git a/arch/powerpc/platforms/powernv/pci-ioda.c b/arch/powerpc/platforms/powernv/pci-ioda.c
index 471aa3ccd9fd..53d052e95cfc 100644
--- a/arch/powerpc/platforms/powernv/pci-ioda.c
+++ b/arch/powerpc/platforms/powernv/pci-ioda.c
@@ -34,24 +34,12 @@
34#include "powernv.h" 34#include "powernv.h"
35#include "pci.h" 35#include "pci.h"
36 36
37static int __pe_printk(const char *level, const struct pnv_ioda_pe *pe,
38 struct va_format *vaf)
39{
40 char pfix[32];
41
42 if (pe->pdev)
43 strlcpy(pfix, dev_name(&pe->pdev->dev), sizeof(pfix));
44 else
45 sprintf(pfix, "%04x:%02x ",
46 pci_domain_nr(pe->pbus), pe->pbus->number);
47 return printk("pci %s%s: [PE# %.3d] %pV", level, pfix, pe->pe_number, vaf);
48}
49
50#define define_pe_printk_level(func, kern_level) \ 37#define define_pe_printk_level(func, kern_level) \
51static int func(const struct pnv_ioda_pe *pe, const char *fmt, ...) \ 38static int func(const struct pnv_ioda_pe *pe, const char *fmt, ...) \
52{ \ 39{ \
53 struct va_format vaf; \ 40 struct va_format vaf; \
54 va_list args; \ 41 va_list args; \
42 char pfix[32]; \
55 int r; \ 43 int r; \
56 \ 44 \
57 va_start(args, fmt); \ 45 va_start(args, fmt); \
@@ -59,7 +47,16 @@ static int func(const struct pnv_ioda_pe *pe, const char *fmt, ...) \
59 vaf.fmt = fmt; \ 47 vaf.fmt = fmt; \
60 vaf.va = &args; \ 48 vaf.va = &args; \
61 \ 49 \
62 r = __pe_printk(kern_level, pe, &vaf); \ 50 if (pe->pdev) \
51 strlcpy(pfix, dev_name(&pe->pdev->dev), \
52 sizeof(pfix)); \
53 else \
54 sprintf(pfix, "%04x:%02x ", \
55 pci_domain_nr(pe->pbus), \
56 pe->pbus->number); \
57 r = printk(kern_level "pci %s: [PE# %.3d] %pV", \
58 pfix, pe->pe_number, &vaf); \
59 \
63 va_end(args); \ 60 va_end(args); \
64 \ 61 \
65 return r; \ 62 return r; \