From patchwork Fri Sep 2 11:04:53 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Subhransu S. Prusty" X-Patchwork-Id: 9311337 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 C794E60756 for ; Fri, 2 Sep 2016 16:02:40 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id B905A297DE for ; Fri, 2 Sep 2016 16:02:40 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id ADD25297E3; Fri, 2 Sep 2016 16:02:40 +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=-1.9 required=2.0 tests=BAYES_00, RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.1 Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 35392297E0 for ; Fri, 2 Sep 2016 16:02:39 +0000 (UTC) Received: by alsa0.perex.cz (Postfix, from userid 1000) id 6AA69267796; Fri, 2 Sep 2016 18:02:38 +0200 (CEST) Received: from alsa0.perex.cz (localhost [127.0.0.1]) by alsa0.perex.cz (Postfix) with ESMTP id 73F73267634; Fri, 2 Sep 2016 16:15:06 +0200 (CEST) X-Original-To: alsa-devel@alsa-project.org Delivered-To: alsa-devel@alsa-project.org Received: by alsa0.perex.cz (Postfix, from userid 1000) id AC75B26762C; Fri, 2 Sep 2016 16:15:04 +0200 (CEST) Received: from mga07.intel.com (mga07.intel.com [134.134.136.100]) by alsa0.perex.cz (Postfix) with ESMTP id F302E26779A for ; Fri, 2 Sep 2016 13:10:46 +0200 (CEST) Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by orsmga105.jf.intel.com with ESMTP; 02 Sep 2016 04:10:46 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.30,270,1470726000"; d="scan'208";a="756489627" Received: from subhransu-desktop.iind.intel.com ([10.223.96.24]) by FMSMGA003.fm.intel.com with ESMTP; 02 Sep 2016 04:10:44 -0700 From: "Subhransu S. Prusty" To: alsa-devel@alsa-project.org Date: Fri, 2 Sep 2016 16:34:53 +0530 Message-Id: <1472814300-5629-5-git-send-email-subhransu.s.prusty@intel.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1472814300-5629-1-git-send-email-subhransu.s.prusty@intel.com> References: <1472814300-5629-1-git-send-email-subhransu.s.prusty@intel.com> Cc: tiwai@suse.de, lgirdwood@gmail.com, patches.audio@intel.com, broonie@kernel.org, Vinod Koul , "Subhransu S. Prusty" Subject: [alsa-devel] [PATCH v2 04/11] ALSA: hdac: Move 'to_hda_ext_device' helper to core X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: alsa-devel-bounces@alsa-project.org Sender: alsa-devel-bounces@alsa-project.org X-Virus-Scanned: ClamAV using ClamSMTP This helper is also useful for generic codec framework. So moving this to core for reuse. Signed-off-by: Subhransu S. Prusty Signed-off-by: Vinod Koul --- include/sound/hdaudio_ext.h | 8 ++++++++ sound/soc/codecs/hdac_hdmi.c | 8 +------- 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/include/sound/hdaudio_ext.h b/include/sound/hdaudio_ext.h index 5be7a59..2113765 100644 --- a/include/sound/hdaudio_ext.h +++ b/include/sound/hdaudio_ext.h @@ -256,6 +256,14 @@ struct hdac_ext_dma_params { }; #define to_ehdac_device(dev) (container_of((dev), \ struct hdac_ext_device, hdac)) + +static inline struct hdac_ext_device *to_hda_ext_device(struct device *dev) +{ + struct hdac_device *hdac = dev_to_hdac_dev(dev); + + return to_ehdac_device(hdac); +} + /* * HD-audio codec base driver */ diff --git a/sound/soc/codecs/hdac_hdmi.c b/sound/soc/codecs/hdac_hdmi.c index 4e181b2..8a9a5f8 100644 --- a/sound/soc/codecs/hdac_hdmi.c +++ b/sound/soc/codecs/hdac_hdmi.c @@ -30,6 +30,7 @@ #include #include #include +#include #include "../../hda/local.h" #include "hdac_hdmi.h" @@ -127,13 +128,6 @@ static struct hdac_hdmi_pcm *get_hdmi_pcm_from_id(struct hdac_hdmi_priv *hdmi, return NULL; } -static inline struct hdac_ext_device *to_hda_ext_device(struct device *dev) -{ - struct hdac_device *hdac = dev_to_hdac_dev(dev); - - return to_ehdac_device(hdac); -} - static unsigned int sad_format(const u8 *sad) { return ((sad[0] >> 0x3) & 0x1f);