From: Rafał Miłecki <rafal@xxxxxxxxxx> This adds a nice prefix to all error messages making it possible to identify device they are related to. It's really useful for e.g. home routers commonly having 2 or even 3 wireless devices. Signed-off-by: Rafał Miłecki <rafal@xxxxxxxxxx> --- drivers/net/wireless/broadcom/brcm80211/brcmfmac/common.c | 3 ++- drivers/net/wireless/broadcom/brcm80211/brcmfmac/tracepoint.c | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/common.c b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/common.c index c0ac7979c9ea..5845a3e5150a 100644 --- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/common.c +++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/common.c @@ -223,6 +223,7 @@ int brcmf_c_preinit_dcmds(struct brcmf_if *ifp) #ifndef CONFIG_BRCM_TRACING void __brcmf_err(struct brcmf_pub *pub, const char *func, const char *fmt, ...) { + struct device *dev = pub && pub->bus_if ? pub->bus_if->dev : NULL; struct va_format vaf; va_list args; @@ -230,7 +231,7 @@ void __brcmf_err(struct brcmf_pub *pub, const char *func, const char *fmt, ...) vaf.fmt = fmt; vaf.va = &args; - pr_err("%s: %pV", func, &vaf); + dev_err(dev, "%s: %pV", func, &vaf); va_end(args); } diff --git a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/tracepoint.c b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/tracepoint.c index 329cb65eb78b..393c1b31ed28 100644 --- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/tracepoint.c +++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/tracepoint.c @@ -25,6 +25,7 @@ void __brcmf_err(struct brcmf_pub *pub, const char *func, const char *fmt, ...) { + struct device *dev = pub && pub->bus_if ? pub->bus_if->dev : NULL; struct va_format vaf = { .fmt = fmt, }; @@ -32,7 +33,7 @@ void __brcmf_err(struct brcmf_pub *pub, const char *func, const char *fmt, ...) va_start(args, fmt); vaf.va = &args; - pr_err("%s: %pV", func, &vaf); + dev_err(dev, "%s: %pV", func, &vaf); trace_brcmf_err(func, &vaf); va_end(args); } -- 2.11.0