From patchwork Sun Oct 16 20:59:06 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Martin Blumenstingl X-Patchwork-Id: 9378319 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 BD98F6086B for ; Sun, 16 Oct 2016 20:59:56 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id AC7A628BB3 for ; Sun, 16 Oct 2016 20:59:56 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id A127128BE4; Sun, 16 Oct 2016 20:59:56 +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 290E128BAF for ; Sun, 16 Oct 2016 20:59:56 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756892AbcJPU7v (ORCPT ); Sun, 16 Oct 2016 16:59:51 -0400 Received: from mail-lf0-f68.google.com ([209.85.215.68]:34618 "EHLO mail-lf0-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756493AbcJPU7r (ORCPT ); Sun, 16 Oct 2016 16:59:47 -0400 Received: by mail-lf0-f68.google.com with SMTP id x23so17408269lfi.1; Sun, 16 Oct 2016 13:59:46 -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=mD6WO6cKE39dI/gXwc0C4224tKfSZig+DXSMea8i3tOqwsajUxeIhRFBhSaTjiOJaR +O4Qdl8Y3a88pfXrkfujZcvWtN38WHG5yU/xMJUrCq2t2Ax+WjpSja7l4hbk9+KUqUtc 5MdlSoSTPn1O630V5cBv8MuoHul9+OHyXMp15L5ra50kzPwnAdxGGUlHEMc8vmpChH8v oiC/naT4rKT4HgK0q1picNicO+XszKUXzH1Ra02z5Cr0XlGiG2JG2o7TRZqFZzIeZWoL 0u7BDkqM9zey+C2rwn9jIAnTpKV/CLEETT0wclgqM7ighQbljRlIdMqakpmakDrUCFwv Eraw== 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=S6jP9KotX5M4ciionsA4oaK0yUKa3x1b4vMkR+2gP6BTjIBnpZMq6wMPn3zNcMG1lC 7un3hMBDkK5g5j2jhPGzlfyD8RHAcRWgO8ukuSjQTkPJgoVglKWTZaGwxbrtnwj9i75l E8c0kobzxea7zWqt5nc1ojQjZyuAKug+0MXL+UIcchBALe9NkR2i+TQG53CYHaf/rKpS THjxFJmVI4sq/qz0s3dj/Sv1VfdzkkWVDSsYO4drnh0WzJ7WMYXpMyPz3WQY0hfS43Xx EBq6g6BT2r0IOl0Z54fEuQrhDyizC+uam4FOipxPJkxbvANR2OUqoBWeuaZk3t1ULsMY PZ5A== X-Gm-Message-State: AA6/9RnU9LQYtW4s+FV7UitH0z5cIT669becO28j2ku8tn1AU7TipoHmhWzTH+U+6/LUfg== X-Received: by 10.194.79.170 with SMTP id k10mr9236521wjx.209.1476651585113; Sun, 16 Oct 2016 13:59:45 -0700 (PDT) Received: from blackbox.darklights.net (p5DE38391.dip0.t-ipconnect.de. [93.227.131.145]) by smtp.googlemail.com with ESMTPSA id a1sm46106784wju.41.2016.10.16.13.59.43 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 16 Oct 2016 13:59:44 -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, robh+dt@kernel.org Cc: mcgrof@do-not-panic.com, mark.rutland@arm.com, 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 v8 2/3] ath9k: add a helper to get the string representation of ath_bus_type Date: Sun, 16 Oct 2016 22:59:06 +0200 Message-Id: <20161016205907.19927-3-martin.blumenstingl@googlemail.com> X-Mailer: git-send-email 2.10.0 In-Reply-To: <20161016205907.19927-1-martin.blumenstingl@googlemail.com> References: <20161002214743.2263-1-martin.blumenstingl@googlemail.com> <20161016205907.19927-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);