From: "Rafał Miłecki" <zajec5@gmail.com>
To: Kalle Valo <kvalo@codeaurora.org>
Cc: "Arend van Spriel" <arend.vanspriel@broadcom.com>,
"Franky Lin" <franky.lin@broadcom.com>,
"Hante Meuleman" <hante.meuleman@broadcom.com>,
"Pieter-Paul Giesberts" <pieter-paul.giesberts@broadcom.com>,
"Franky Lin" <frankyl@broadcom.com>,
linux-wireless@vger.kernel.org,
brcm80211-dev-list.pdl@broadcom.com,
"Rafał Miłecki" <rafal@milecki.pl>
Subject: [PATCH V3 9/9] brcmfmac: use dev_err to print errors
Date: Thu, 2 Feb 2017 22:33:21 +0100 [thread overview]
Message-ID: <20170202213321.11591-9-zajec5@gmail.com> (raw)
In-Reply-To: <20170202213321.11591-1-zajec5@gmail.com>
From: Rafał Miłecki <rafal@milecki.pl>
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@milecki.pl>
---
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
next prev parent reply other threads:[~2017-02-02 21:33 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-02-02 21:33 [PATCH V3 1/9] brcmfmac: merge two brcmf_err macros into one Rafał Miłecki
2017-02-02 21:33 ` [PATCH V3 2/9] brcmfmac: switch to C function (__brcmf_err) for printing errors Rafał Miłecki
2017-02-08 9:15 ` Arend Van Spriel
2017-02-02 21:33 ` [PATCH V3 3/9] brcmfmac: merge two remaining brcmf_err macros Rafał Miłecki
2017-02-08 9:52 ` Arend Van Spriel
2017-02-02 21:33 ` [PATCH V3 4/9] brcmfmac: add struct brcmf_pub parameter to the __brcmf_err Rafał Miłecki
2017-02-08 9:54 ` Arend Van Spriel
2017-02-08 10:00 ` Rafał Miłecki
2017-02-08 14:52 ` Kalle Valo
2017-02-08 15:09 ` Rafał Miłecki
2017-02-23 21:08 ` Rafał Miłecki
2017-02-23 21:41 ` Rafał Miłecki
2017-03-21 13:49 ` Arend Van Spriel
2017-02-02 21:33 ` [PATCH V3 5/9] brcmfmac: pcie: store private pointer to struct brcmf_pub Rafał Miłecki
2017-02-05 19:49 ` Arend Van Spriel
2017-02-02 21:33 ` [PATCH V3 6/9] brcmfmac: usb: " Rafał Miłecki
2017-02-02 21:33 ` [PATCH V3 7/9] brcmfmac: sdio: " Rafał Miłecki
2017-02-02 21:33 ` [PATCH V3 8/9] brcmfmac: modify all brcmf_err calls adding " Rafał Miłecki
2017-02-02 21:33 ` Rafał Miłecki [this message]
2017-02-08 9:02 ` [PATCH V3 1/9] brcmfmac: merge two brcmf_err macros into one Arend Van Spriel
2017-02-08 15:24 ` [V3,1/9] " Kalle Valo
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20170202213321.11591-9-zajec5@gmail.com \
--to=zajec5@gmail.com \
--cc=arend.vanspriel@broadcom.com \
--cc=brcm80211-dev-list.pdl@broadcom.com \
--cc=franky.lin@broadcom.com \
--cc=frankyl@broadcom.com \
--cc=hante.meuleman@broadcom.com \
--cc=kvalo@codeaurora.org \
--cc=linux-wireless@vger.kernel.org \
--cc=pieter-paul.giesberts@broadcom.com \
--cc=rafal@milecki.pl \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox