From patchwork Wed Jan 26 01:17:07 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Liao, Bard" X-Patchwork-Id: 537109 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 4AE25C3525A for ; Wed, 26 Jan 2022 01:21:59 +0000 (UTC) Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id 9668F1FBB; Wed, 26 Jan 2022 02:21:07 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 9668F1FBB DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1643160117; bh=j9FedpyuD/S2NgO/mc5ZrDZt8ygTqEiARrruER7q7HU=; h=From:To:Subject:Date:In-Reply-To:References:Cc:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=YU7pq1DolZXy4K8ZtqvYgcXBWz1/wtT/wKCKuiq552CgyvddaqF/4JLrdlyzQ3Zzr b3uavICGRWWzqWSbnmL7r4xK4/ZR2RB7otaqWgrjkoa+nogwFAHXDDqXFFho0L2DB5 gu68zYqMadNnQ73Dk9B/qm76KRNGHKQfxns8vnfM= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id 1C29EF80557; Wed, 26 Jan 2022 02:18:06 +0100 (CET) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 0DA26F80557; Wed, 26 Jan 2022 02:18:05 +0100 (CET) Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id D9945F80552 for ; Wed, 26 Jan 2022 02:18:01 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz D9945F80552 Authentication-Results: alsa1.perex.cz; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="bA6Sb4xl" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1643159883; x=1674695883; h=from:to:cc:subject:date:message-id:in-reply-to: references; bh=j9FedpyuD/S2NgO/mc5ZrDZt8ygTqEiARrruER7q7HU=; b=bA6Sb4xlv4V4yIhjU1Ua0ow3u5nFfhYjubqTrNxa9z45ODbXMgvK9GYz x1znCpPCTrZhZP4yv8c8e7rLSODzjvdqfRSNq1/lv0jI601mpTJv1vgCx 2dsdaek/NWAbLK7XCBeXGo13LTw2eYp9jshoSE7xobYqEGiSCnG77ubRu iPVVtES/BBM+7zSt/R2rqMpQ8LpuZbusvYGQz8C5ijF6im7J9lY0upqzB o/GEuDMplRaAJF4YV+SpD+WOYg22YPA6ycCKCJBDA7cwKnY9glSSnwJO1 vONpjp+dXRJqS3NaT1J7H0zgscqAF6PYoc/eAtG0NScf/PdMpRiApGBIM Q==; X-IronPort-AV: E=McAfee;i="6200,9189,10238"; a="246236200" X-IronPort-AV: E=Sophos;i="5.88,316,1635231600"; d="scan'208";a="246236200" Received: from orsmga007.jf.intel.com ([10.7.209.58]) by orsmga102.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 25 Jan 2022 17:17:59 -0800 X-IronPort-AV: E=Sophos;i="5.88,316,1635231600"; d="scan'208";a="520617541" Received: from bard-ubuntu.sh.intel.com ([10.239.185.57]) by orsmga007-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 25 Jan 2022 17:17:56 -0800 From: Bard Liao To: alsa-devel@alsa-project.org, vkoul@kernel.org Subject: [PATCH 11/19] soundwire: stream: move sdw_alloc_slave_rt() before 'master' helpers Date: Wed, 26 Jan 2022 09:17:07 +0800 Message-Id: <20220126011715.28204-12-yung-chuan.liao@linux.intel.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20220126011715.28204-1-yung-chuan.liao@linux.intel.com> References: <20220126011715.28204-1-yung-chuan.liao@linux.intel.com> Cc: vinod.koul@linaro.org, gregkh@linuxfoundation.org, pierre-louis.bossart@linux.intel.com, linux-kernel@vger.kernel.org, srinivas.kandagatla@linaro.org, sanyog.r.kale@intel.com, bard.liao@intel.com X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.15 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: , Errors-To: alsa-devel-bounces@alsa-project.org Sender: "Alsa-devel" From: Pierre-Louis Bossart Code move before splitting the function in two. No functionality change. Signed-off-by: Pierre-Louis Bossart Reviewed-by: Rander Wang Signed-off-by: Bard Liao --- drivers/soundwire/stream.c | 52 +++++++++++++++++++------------------- 1 file changed, 26 insertions(+), 26 deletions(-) diff --git a/drivers/soundwire/stream.c b/drivers/soundwire/stream.c index e38c9208c77b..eef2e5fd245e 100644 --- a/drivers/soundwire/stream.c +++ b/drivers/soundwire/stream.c @@ -1054,6 +1054,32 @@ struct sdw_stream_runtime *sdw_alloc_stream(const char *stream_name) } EXPORT_SYMBOL(sdw_alloc_stream); +/** + * sdw_alloc_slave_rt() - Allocate and initialize Slave runtime handle. + * + * @slave: Slave handle + * @stream_config: Stream configuration + * + * This function is to be called with bus_lock held. + */ +static struct sdw_slave_runtime +*sdw_alloc_slave_rt(struct sdw_slave *slave, + struct sdw_stream_config *stream_config) +{ + struct sdw_slave_runtime *s_rt; + + s_rt = kzalloc(sizeof(*s_rt), GFP_KERNEL); + if (!s_rt) + return NULL; + + INIT_LIST_HEAD(&s_rt->port_list); + s_rt->ch_count = stream_config->ch_count; + s_rt->direction = stream_config->direction; + s_rt->slave = slave; + + return s_rt; +} + static struct sdw_master_runtime *sdw_master_rt_find(struct sdw_bus *bus, struct sdw_stream_runtime *stream) @@ -1118,32 +1144,6 @@ static int sdw_master_rt_config(struct sdw_master_runtime *m_rt, return 0; } -/** - * sdw_alloc_slave_rt() - Allocate and initialize Slave runtime handle. - * - * @slave: Slave handle - * @stream_config: Stream configuration - * - * This function is to be called with bus_lock held. - */ -static struct sdw_slave_runtime -*sdw_alloc_slave_rt(struct sdw_slave *slave, - struct sdw_stream_config *stream_config) -{ - struct sdw_slave_runtime *s_rt; - - s_rt = kzalloc(sizeof(*s_rt), GFP_KERNEL); - if (!s_rt) - return NULL; - - INIT_LIST_HEAD(&s_rt->port_list); - s_rt->ch_count = stream_config->ch_count; - s_rt->direction = stream_config->direction; - s_rt->slave = slave; - - return s_rt; -} - /** * sdw_release_slave_stream() - Free Slave(s) runtime handle *