From patchwork Tue Sep 6 21:46:22 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Martin Blumenstingl X-Patchwork-Id: 9317951 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 2347760760 for ; Tue, 6 Sep 2016 21:46:41 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 29E7128EF5 for ; Tue, 6 Sep 2016 21:46:41 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 1EA7828F00; Tue, 6 Sep 2016 21:46:41 +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=-4.6 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 B78D228EF5 for ; Tue, 6 Sep 2016 21:46:40 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933970AbcIFVqj (ORCPT ); Tue, 6 Sep 2016 17:46:39 -0400 Received: from mail-wm0-f67.google.com ([74.125.82.67]:35024 "EHLO mail-wm0-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932651AbcIFVqf (ORCPT ); Tue, 6 Sep 2016 17:46:35 -0400 Received: by mail-wm0-f67.google.com with SMTP id a6so9522312wmc.2; Tue, 06 Sep 2016 14:46:34 -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=8EaFYpyWJ3d7657egAKGDhXhzsFLhXoeeipnTM8vdAk=; b=VmBAw4PK2v+5a7PdyjBfoB9GQKzYW1BoLjVxvIqT19nJH7C1qF5kGtj6NHlSC0YsZ3 bCYf+/2IZrzx+5mSf6AsH+veXqTW95MPTEETGwdOol9BatuaUyAyUc1pyvht59zKuwfp BGYezEsQlz370LMfRVTyVyLvbIeB5Gt8+dEgF0ChF0QT4NTqXKIl7W+Esu+EVqDDQ52M bVfJJQ9CxxMM1nDrI4Tn3aP5PEGKaU4GGKUWnzXRehBjQWcAIA+qg60fl9m6UD24zksq VOhPquGylGpPMZmKRJGtjls8O7b6wXFPrGFikwvfkln42aWm5ZHGzxr9rcsvOacCQjT+ CANw== 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=8EaFYpyWJ3d7657egAKGDhXhzsFLhXoeeipnTM8vdAk=; b=XHVQnn/8T+OBEKh8S4x5hJNQ/4BTRDpnZNmXQNPAb5Du3hXSWe4Usrbq01ALWdXDmU 0pimMxVJL16Y8ozgiY9FMAtvAxu/t5WFH2uLd7k9qRNlxFtFT2o0w9vnwKn0mlOdSK3b wL+u3RVHMvCyl2bFtugB4ztsLewPzW4DFC0B5MgLyFZY2T1UQvl22MCVSf+L4DydVjDt Lqp1+nibQpdguxzQBYlZy05w6tVL6+qlB7ysNbLByrtk9Tzkcuxw07wq+nXdzUgvz0rs BGRANfPoInrT2iM0O6vFbO2a8poh7NpC1FYttKMa7jEFIZwIykCUubc9BERU9L1nF2xU DBLA== X-Gm-Message-State: AE9vXwMDGqvQjdx/1yv/LqKLj8NuZ4bSAjxg5Vm6SnbwksCXFoJHHzm5UUwhMNd5ZJLHew== X-Received: by 10.28.208.130 with SMTP id h124mr651773wmg.101.1473198393988; Tue, 06 Sep 2016 14:46:33 -0700 (PDT) Received: from blackbox.darklights.net (p5DE38590.dip0.t-ipconnect.de. [93.227.133.144]) by smtp.googlemail.com with ESMTPSA id ex14sm35451113wjc.30.2016.09.06.14.46.32 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 06 Sep 2016 14:46:33 -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 v6 2/3] ath9k: add a helper to get the string representation of ath_bus_type Date: Tue, 6 Sep 2016 23:46:22 +0200 Message-Id: <20160906214623.20424-3-martin.blumenstingl@googlemail.com> X-Mailer: git-send-email 2.9.3 In-Reply-To: <20160906214623.20424-1-martin.blumenstingl@googlemail.com> References: <20160821143105.27487-1-martin.blumenstingl@googlemail.com> <20160906214623.20424-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);