From patchwork Sun Oct 2 21:47:42 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Martin Blumenstingl X-Patchwork-Id: 9359801 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 DFB1C60459 for ; Sun, 2 Oct 2016 21:47:59 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id C979C28A66 for ; Sun, 2 Oct 2016 21:47:59 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id BBE7E28A64; Sun, 2 Oct 2016 21:47: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=-7.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, FREEMAIL_FROM, RCVD_IN_DNSWL_HI 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 3AE6B28A64 for ; Sun, 2 Oct 2016 21:47:59 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751621AbcJBVrz (ORCPT ); Sun, 2 Oct 2016 17:47:55 -0400 Received: from mail-wm0-f68.google.com ([74.125.82.68]:34247 "EHLO mail-wm0-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751227AbcJBVrw (ORCPT ); Sun, 2 Oct 2016 17:47:52 -0400 Received: by mail-wm0-f68.google.com with SMTP id b201so6753358wmb.1; Sun, 02 Oct 2016 14:47:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlemail.com; s=20120113; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=UwIhdpJ4shxuyx+YAOe7cctLbdGpv168gQJn0AG3ZfA=; b=bpVX3RvTV/S3CA6gsB7YAwWT2OrbKsjF5KBMsMqTqBzQzeG2OsHsRNZ/rSWA+czlfN 1qczxot7UpTJ0prSdYFMwXPTGapcBDHIVkwISNtfe3PvUR7MAcB8w/Qn1TZX7y1+7yKj aQoGT9NRNOKd2Qycgn0glr98JMXjmFlVSGMYs/C6gxD7eugWBDazIrNQWWbA8IWZpQJl B6BhcFuQdgXH5YdnUF12IE4t2gFd7o/8fa5rv+gbYlp1td4vh3Y5uvpROQhD/7O5pumV bFmqUj4sg7pOTxnC7qepvU7S25MuVHmBf+f5hYC8NMgeDqT9INURLLwNyzpXTSaUqBG7 Jf3A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=UwIhdpJ4shxuyx+YAOe7cctLbdGpv168gQJn0AG3ZfA=; b=jELAM8bSNla3o7hSd7XKzm3XQYmzeRjT8yx/WW4fMzZpdFCpFB7rF5rz1cqu8Kpgaf qA25/cxrqJeKu1/PBjvz3Iq7TBNUIZ3Q5TjHsrv7nqW7L+/S4nAZC5GERIzeaPGqk1HY HszoXakGSKyHNXPpJvcG2oDF+HCDWWX8A4yGeFXfi47Qhy+rNk5JWnAfE0efyJRl4ZRg JqoxjH1usUjmVqB3u9NAVEe/RUQ8Z7pWhBNN/WFCKZzMGKFRRrmYRlpAryqI5xnCO1Ru RY0qiZ4YUiU6TzWmvsYCLRcGgjjwd6/lrzRpUm3mnmPox8Xhi9t5/hkzMo4385CbAJGf 7iqg== X-Gm-Message-State: AA6/9RnLKS3qBU1Akkr+l5lbmUk8BL2uHKaNa9GIWN9lusK0P3iwteHB9awMpWm2QDF1Nw== X-Received: by 10.28.145.129 with SMTP id t123mr6344715wmd.64.1475444870981; Sun, 02 Oct 2016 14:47:50 -0700 (PDT) Received: from blackbox.darklights.net (p200300DCD3D4610440DF0B34A14E22AB.dip0.t-ipconnect.de. [2003:dc:d3d4:6104:40df:b34:a14e:22ab]) by smtp.googlemail.com with ESMTPSA id e187sm15702064wma.21.2016.10.02.14.47.49 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 02 Oct 2016 14:47:50 -0700 (PDT) From: Martin Blumenstingl To: ath9k-devel@lists.ath9k.org, devicetree@vger.kernel.org, linux-wireless@vger.kernel.org, ath9k-devel@qca.qualcomm.com Cc: mcgrof@do-not-panic.com, mark.rutland@arm.com, robh+dt@kernel.org, kvalo@codeaurora.org, chunkeey@googlemail.com, arend.vanspriel@broadcom.com, julian.calaby@gmail.com, bjorn@mork.no, linux@rempel-privat.de, nbd@nbd.name, Martin Blumenstingl Subject: [PATCH v7 2/3] ath9k: add a helper to get the string representation of ath_bus_type Date: Sun, 2 Oct 2016 23:47:42 +0200 Message-Id: <20161002214743.2263-3-martin.blumenstingl@googlemail.com> X-Mailer: git-send-email 2.10.0 In-Reply-To: <20161002214743.2263-1-martin.blumenstingl@googlemail.com> References: <20160906214623.20424-1-martin.blumenstingl@googlemail.com> <20161002214743.2263-1-martin.blumenstingl@googlemail.com> 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 This can be used when the ath_bus_type has to be presented in a log message or firmware filename. Signed-off-by: Martin Blumenstingl --- drivers/net/wireless/ath/ath.h | 6 ++++++ drivers/net/wireless/ath/main.c | 7 +++++++ 2 files changed, 13 insertions(+) diff --git a/drivers/net/wireless/ath/ath.h b/drivers/net/wireless/ath/ath.h index da7a7c8..f3f2784 100644 --- a/drivers/net/wireless/ath/ath.h +++ b/drivers/net/wireless/ath/ath.h @@ -327,4 +327,10 @@ static inline const char *ath_opmode_to_string(enum nl80211_iftype opmode) } #endif +extern const char *ath_bus_type_strings[]; +static inline const char *ath_bus_type_to_string(enum ath_bus_type bustype) +{ + return ath_bus_type_strings[bustype]; +} + #endif /* ATH_H */ diff --git a/drivers/net/wireless/ath/main.c b/drivers/net/wireless/ath/main.c index 338d723..89f4b05 100644 --- a/drivers/net/wireless/ath/main.c +++ b/drivers/net/wireless/ath/main.c @@ -90,3 +90,10 @@ void ath_printk(const char *level, const struct ath_common* common, va_end(args); } EXPORT_SYMBOL(ath_printk); + +const char *ath_bus_type_strings[] = { + [ATH_PCI] = "pci", + [ATH_AHB] = "ahb", + [ATH_USB] = "usb", +}; +EXPORT_SYMBOL(ath_bus_type_strings);