From patchwork Tue Jan 24 15:06:12 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: 9535383 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 3DF6560434 for ; Tue, 24 Jan 2017 15:06:45 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 3277727F81 for ; Tue, 24 Jan 2017 15:06:45 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 2218927FA6; Tue, 24 Jan 2017 15:06:45 +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 3296228343 for ; Tue, 24 Jan 2017 15:06:44 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751226AbdAXPGm (ORCPT ); Tue, 24 Jan 2017 10:06:42 -0500 Received: from mail-lf0-f65.google.com ([209.85.215.65]:33327 "EHLO mail-lf0-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751022AbdAXPGk (ORCPT ); Tue, 24 Jan 2017 10:06:40 -0500 Received: by mail-lf0-f65.google.com with SMTP id x1so17837888lff.0 for ; Tue, 24 Jan 2017 07:06:34 -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=issO792ufUSJe1FB0T34oGvUNOojCiXVYAErM3zWg/QfduaBek4zNlO0ETwC/1jbnq 9bCRWwiiD5ajJ1o9OKVHN8u+OchvWqZn2gU/RnUKBtOVAZ8hLbA1jjXh+ckeXdTJG3qq nlB19lCgM76gS/I6/dbHqgGl0L+pGnE3hGfKLb0pY4gmNyXRRADR2mQ73phyPT+TizFR kxyvwswkxJ87cTC6rkIA8JftHH2RkWyXeEylG7Ex55/NI0eiMN03E7YYyFC3zMOjKiXG N7vfvvoMDC+U4YgqYgV2YY6K6+Linp7gumEK6GWEA5bEi6iBmiEQZNcx7RGUb6c7YBFz A6nA== 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=ShfwP1rH4r/u4AQDyYXY5/v5+Ipq1jQRDqCMQc6D+zqEb0m4FnqUhszypppynmjoKE eyfErlxA6Lc1TXMw/r5gUKLbJB1J3ZTOQ4Jbuj2D6aH+SDZYJFNDAmXJfIkTRBqmBtPx h9k2e/CXZNNqmvxzTIPnNcgIxHnt3D+fdQkUqig/8dRDUmjet7dah3rFYkrkYV9Ex+XA hC/xGpEN4PqSPmPHAx/DiTnQyqCVI0rAjFWKzXBxNJoBZRVrA3Wn6LsHFaVQfsJkfpWC OBViMap2dglRV0s+9r37sDhj9uZr6+Ifq3W7+Qh7Sy4BCchWsT2JOgVQoXX0v+zAbleA RUew== X-Gm-Message-State: AIkVDXJxZhIs159hRUkMW+BWxn2utq7hAVjz/C94RCv+AACtYfqdJ2d7AqHFpQKs5KHd2A== X-Received: by 10.46.20.73 with SMTP id 9mr14357758lju.10.1485270393875; Tue, 24 Jan 2017 07:06:33 -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 66sm7485352lfy.42.2017.01.24.07.06.32 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 24 Jan 2017 07:06:33 -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 6/6] brcmfmac: use dev_err to print errors Date: Tue, 24 Jan 2017 16:06:12 +0100 Message-Id: <20170124150612.25138-6-zajec5@gmail.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20170124150612.25138-1-zajec5@gmail.com> References: <20170124150612.25138-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); }