From patchwork Thu Feb 2 21:33:21 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: 9553263 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 997B160405 for ; Thu, 2 Feb 2017 21:33:59 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 8D44F284A3 for ; Thu, 2 Feb 2017 21:33:59 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 82361284CE; Thu, 2 Feb 2017 21:33:59 +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 3273D284A3 for ; Thu, 2 Feb 2017 21:33:59 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751934AbdBBVd5 (ORCPT ); Thu, 2 Feb 2017 16:33:57 -0500 Received: from mail-lf0-f65.google.com ([209.85.215.65]:34455 "EHLO mail-lf0-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751500AbdBBVdw (ORCPT ); Thu, 2 Feb 2017 16:33:52 -0500 Received: by mail-lf0-f65.google.com with SMTP id q89so47020lfi.1 for ; Thu, 02 Feb 2017 13:33:51 -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=826ZcvvN4DafV95fSAPZKFi8vIhN/eNmrpMl3NE86dE=; b=NGIMbty2lGTycJhc9GzdFMF2e1teSLbvEacVqt1sTE+E7kAZh4I2gpaMNQTYobbimz NH5RKJfzyGqWFTcqe01mctpmmKT9rjlSp7ExJCrMh/g4gfLwO+I7K7xB2BxGaMrEkkyV XVxfWCNCyltz6nUCWYxkeQBvfSivEcpH3tmVoiu0E2p0D+5B0LcQH8qy5rlCGrs1zhEr CF4Jx8F3CDvxlgZ7LeeDx5+8/ebZaj6/NnnPxfGhkdpIdSe5OShbm3fm+577ECnYtlSt PTvdxBilUri8AKYJ7WCTg83sJ4zfYoB5rTVsLWSyQB3y8mfXXE/Kv4BA+PqKhzh69x+w /OTA== 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=826ZcvvN4DafV95fSAPZKFi8vIhN/eNmrpMl3NE86dE=; b=PON0r5kAaamBl5gYtYx49UGXjDlseAJhFlr3rfrJTrjOSOw8q3V03lyA+RVtPUr55A R7EoN0zYy3pYhSV5+w/loirhYCEqeKRWIa06YUH2DE9P7FZiTHT0+DDmRNFkhYbAlCqy INtXpNnXwex3p1PsI4zVUBozZi/2+eoL2As0D4Z7vUFukxXXSVcgCubXZ8O4wkH+rXrG N+pFY+tT9DH2D+XBnez3KSPPUfMtYy8ajrcLvQrvir22HFSRSywRsOmN29QJzaIzFK9z Xxjoa3k9mfekXMw+9mCVh1T/wLlroxIWpO+ZY0imPK15ynzkoQeULX6LlggS6qAld6ei ci1w== X-Gm-Message-State: AIkVDXLOC0kPC/mwVuqpK71z+USNtaIhGLGYWt9PblGfEb2o4qAEI4dn+lVTfK5CsNiufQ== X-Received: by 10.25.16.101 with SMTP id f98mr3155176lfi.120.1486071230354; Thu, 02 Feb 2017 13:33:50 -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 1sm2590003ljv.40.2017.02.02.13.33.49 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 02 Feb 2017 13:33:49 -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 V3 9/9] brcmfmac: use dev_err to print errors Date: Thu, 2 Feb 2017 22:33:21 +0100 Message-Id: <20170202213321.11591-9-zajec5@gmail.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20170202213321.11591-1-zajec5@gmail.com> References: <20170202213321.11591-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 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); }