From patchwork Thu Feb 2 12:16:59 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?b?UmFmYcWCIE1pxYJlY2tp?= X-Patchwork-Id: 9551731 X-Patchwork-Delegate: kvalo@adurom.com Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 3CD32604E0 for ; Thu, 2 Feb 2017 12:17:32 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 3472828425 for ; Thu, 2 Feb 2017 12:17:32 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 294F228440; Thu, 2 Feb 2017 12:17:32 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.5 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, RCVD_IN_SORBS_SPAM autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id CD21B28425 for ; Thu, 2 Feb 2017 12:17:31 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751565AbdBBMRa (ORCPT ); Thu, 2 Feb 2017 07:17:30 -0500 Received: from mail-lf0-f67.google.com ([209.85.215.67]:34048 "EHLO mail-lf0-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751553AbdBBMR2 (ORCPT ); Thu, 2 Feb 2017 07:17:28 -0500 Received: by mail-lf0-f67.google.com with SMTP id q89so1232937lfi.1 for ; Thu, 02 Feb 2017 04:17:27 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=D1Pv9/mxPW9WTADKlDohCNh6oSZbb+Ip4DWAI+QvOW0=; b=glyN3qMYHfAZAfxqpHTVtumKlu9KOvJJCpmPI8osuQFgXpy3OWIYy1kbT02qszk98x MDxiedjMB+bXkNsbcogDi/qRfXZlzo6sbUjlv8JxtzxONZEvn5JYZHaNbwBD2xyrOFGi o/LZO5QtEV/aBGRDKVsTGqTCSM8+KDLJUWw+AAgFOFibM3DCMSRf27ds7Ia+jc660KOY 4cCgipKKp1mMc+9gITAatKltwwAjawTC3qJxXpJyn2PWCVPEJus/vQ58Ib9JmAMvjMbk 9KE91xvhhmxMg185G/fngG30LHfQY56hme9cnC+FU5SbRYuPyL+4XcmQQsA87TyHNdk8 uMUg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=D1Pv9/mxPW9WTADKlDohCNh6oSZbb+Ip4DWAI+QvOW0=; b=DWblCSplgv+HBb+Bl7uRAg+NetdFdmLxLY3B3rxYbx6SbSdlkH++Y5lCyc1JeQWgfL 1wG6F+IIdOH7EYQsfYkBW+bhPls0Nb2VuwaPlAVE677H8mpuaMCL8N+39xllvsK/VXXy Se2xb4ef8DTOa4kv4e8M5wfuF2hJonuAq0VOSdMw1iMnBAgnl+FDNhz2KVZxMRxtPrrw veV8DHCbXNTQwKfZBU75Rd2hx0GmJmx6bawmhfAtXBmzsmNkarnO/avrZC8kENCTlhqK v/kFVcKSqczE0XwN7sKh27onfEtkzOW6gvFdmH3kATADGWW+vFMgWrE1GPKG0fYdHP0z +6WQ== X-Gm-Message-State: AIkVDXIldDrezjSCI3dtlFxpPDcX/JuCrShMVDyr6dJ0rsk4L6aZlxXN9UcdiiZljx9rlA== X-Received: by 10.25.28.199 with SMTP id c190mr2935425lfc.173.1486037846670; Thu, 02 Feb 2017 04:17:26 -0800 (PST) Received: from linux-samsung.lan (ip-194-187-74-233.konfederacka.maverick.com.pl. [194.187.74.233]) by smtp.gmail.com with ESMTPSA id t10sm2878398lja.48.2017.02.02.04.17.25 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 02 Feb 2017 04:17:26 -0800 (PST) From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= To: Kalle Valo Cc: Arend van Spriel , Franky Lin , Hante Meuleman , Pieter-Paul Giesberts , Franky Lin , linux-wireless@vger.kernel.org, brcm80211-dev-list.pdl@broadcom.com, =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= Subject: [PATCH V2 7/7] brcmfmac: use dev_err to print errors Date: Thu, 2 Feb 2017 13:16:59 +0100 Message-Id: <20170202121659.21130-7-zajec5@gmail.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20170202121659.21130-1-zajec5@gmail.com> References: <20170202121659.21130-1-zajec5@gmail.com> MIME-Version: 1.0 Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Rafał Miłecki 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 --- 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 9ad9bd652ca2..28b08cba7dbe 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; @@ -233,7 +234,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); }