From patchwork Sat Jul 9 23:28:33 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Martin Blumenstingl X-Patchwork-Id: 9222191 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 345346089D for ; Sat, 9 Jul 2016 23:28:59 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 2389D28466 for ; Sat, 9 Jul 2016 23:28:59 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 1817328471; Sat, 9 Jul 2016 23:28: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.8 required=2.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, T_DKIM_INVALID 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 BB72628466 for ; Sat, 9 Jul 2016 23:28:58 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933227AbcGIX25 (ORCPT ); Sat, 9 Jul 2016 19:28:57 -0400 Received: from mail-wm0-f65.google.com ([74.125.82.65]:34573 "EHLO mail-wm0-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933182AbcGIX2x (ORCPT ); Sat, 9 Jul 2016 19:28:53 -0400 Received: by mail-wm0-f65.google.com with SMTP id w75so12136903wmd.1; Sat, 09 Jul 2016 16:28:53 -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=aPATwIRydkN7c74Hk0JAqSxXkyDUEuhlmZQjb794d14=; b=aur+uvcguA62XEb223ywnsoBB5m6Ru2OOyR+cwPQne6EGGrTCfeKbdBGj59ytmASCT SyjBbY7aNj+Mf7igm+Rp1rChEM8GKa33ZWzv+Dy7/WedrVmzV2ZfBhOVwbL9QuviQYni yZr0KTS+++i9nLtn5UFlas6kGgQG7FQaWerg8v7Zi4ziEA1DAJkRGkdoh3x9wWb+MCgO rjZIpLQ0TDGyKRInrWP5/DSNVra2PzSwwuGPvWP4a4myh64H3A48WupLXzliGesjd+aS Z7sSQDBHPK/AU5C6yjCyXzu5c+4W0vstk7Hh900tPxV0iUfhGyPxNM77buzxfzG4AIKL r6Dg== 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=aPATwIRydkN7c74Hk0JAqSxXkyDUEuhlmZQjb794d14=; b=Xe1bx5XHojY1fktTNvRxxITElYgVOHUDOZlTzz2iRKhtKL6uKzzNS8HgL6Cc0HfzKh mPh8qM3Q4xGBD+j2SQ041CBkz8X2fpAqHGgEwDv/Gmlx2OPd5d4q9sM0i1lUKXH21/to gvhCbZLv89K1yFAkrnYvhg9vUorg03OyXZI/PFttDIlJC7y14I5A/E3RgGq3QzCSnwv9 o07eR9AygK7ZQZTC2IFxBUi03QAPRhuqmuQd6lfD8Zudh9FPWtcdC7WEYIvqtS2eO9vZ rYgC1CGASAyW5xikILy4hovNnGc5zAYHHMnX+u4oTlSI8oZP542mnBSFHKOcA2mUZAYc tL0A== X-Gm-Message-State: ALyK8tIFjGdhR3v0enwDTtzY14DSXgbDm+Qac/q4dVmDd9rwtiZ0yGPT8hfE8NIEk0ifLw== X-Received: by 10.28.13.211 with SMTP id 202mr9137511wmn.47.1468106932384; Sat, 09 Jul 2016 16:28:52 -0700 (PDT) Received: from blackbox.darklights.net (p5DE38945.dip0.t-ipconnect.de. [93.227.137.69]) by smtp.googlemail.com with ESMTPSA id r127sm10009891wmf.21.2016.07.09.16.28.50 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 09 Jul 2016 16:28:51 -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, galak@codeaurora.org, ijc+devicetree@hellion.org.uk, mark.rutland@arm.com, pawel.moll@arm.com, robh+dt@kernel.org, kvalo@codeaurora.org, chunkeey@googlemail.com, arend.vanspriel@broadcom.com, julian.calaby@gmail.com, Martin Blumenstingl Subject: [PATCH v4 2/3] ath9k: add a helper to get the string representation of ath_bus_type Date: Sun, 10 Jul 2016 01:28:33 +0200 Message-Id: <20160709232834.31654-3-martin.blumenstingl@googlemail.com> X-Mailer: git-send-email 2.9.0 In-Reply-To: <20160709232834.31654-1-martin.blumenstingl@googlemail.com> References: <20160624123430.4097-1-martin.blumenstingl@googlemail.com> <20160709232834.31654-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);