Received: by 2002:a05:6358:a55:b0:ec:fcf4:3ecf with SMTP id 21csp607784rwb; Fri, 13 Jan 2023 01:47:11 -0800 (PST) X-Google-Smtp-Source: AMrXdXuhnGVEiGN6pOHHOsEILlmes8raS1O7Cx/EA4Wa/U+OpguReuyqMssAJwaMT05Vsm+i3KYm X-Received: by 2002:a50:fc10:0:b0:49b:5a1c:9cb5 with SMTP id i16-20020a50fc10000000b0049b5a1c9cb5mr4622221edr.16.1673603231471; Fri, 13 Jan 2023 01:47:11 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1673603231; cv=none; d=google.com; s=arc-20160816; b=u2Yk61/9xjTk+mQn/h+fq5u2FZLx3RxYZg2WAmUeEbVR6aW34ex15utblca5c0GTMP xYHK0SLMakkYyldCQBSaF5aRA00y/jKnhwWxC8QhicBMZmynywgk/yDLwHSLKIF2c3jU OoJpsjGbTvhd9FUzRHB5amYRROnrRo3mk8d9RgSF9ViKiJYGWdUBvV59Gu88khuBtHjc EFp/N1kREKHOYKstgA5qJPLtDOvZ6InI+FkEpGixyMlYshLDRcfrTi7F9z560PKqgiQi /UuqNMtYOICDzqjQBnhEvypVV6iAZ76JMnfVLZLqSgAiLWsyV1Au2/uUcH0mO3U2euLI pr8Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=oDtzdusXMfWgZIwsQaDL8ckfOYnDKpA08Bj2OH+7lpk=; b=NKZxbdNjmPl11mVO9Ll1KJEaOtzSbBvOojx9UsOAYw11odlmkDfgL/3oDljzPSygnk pJKtEum53Hcu7avAT9ybYR1cEGZdI47LyD1/giGJCLq1b2a7wnPOPJBdiqleq+Jusdxa 3FMowQETpTcwojA3xz3OzAXHFqjWYC24UAhUnADid5pD78hWLzDZfKNhXoT7qzA3oaDS 5wG6OnB1mOSvWZwlfdjiFMJODcPu9Qak39F12KrlY4tJefclPjFkbysX28vQDgPszfpk +VWo/C3YfJ/axI5UAaUavn/X58kK44QragKYu1aJIOxLhvH3a0iVxCgL4Ixkhdq5VQb9 Gutg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=TfF+qpQq; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id by6-20020a0564021b0600b0049553740b71si18630993edb.431.2023.01.13.01.46.59; Fri, 13 Jan 2023 01:47:11 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=TfF+qpQq; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S240739AbjAMJeQ (ORCPT + 51 others); Fri, 13 Jan 2023 04:34:16 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55078 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S241280AbjAMJcG (ORCPT ); Fri, 13 Jan 2023 04:32:06 -0500 Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id EBDEE10AC for ; Fri, 13 Jan 2023 01:27:41 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1673602061; x=1705138061; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=7vfmYiwRnIv7Am96c9Qj/RTB4F0doxF2OEQMmfScbOc=; b=TfF+qpQqcLbIKZKlahkWop7ICQyduXmyTc0PgWxJMF4CjDKwiBUM13Uz Z6jBnRUfYZWJljfJo0lgk+d0Nrd5vM4X4H1Gf4ved/Irh71MrB+wu405F NCACY7kZ3h+3v4zPqlsNwerOUM1Fpce6ZGx4lx8rw9FrhzVx8ZsdAp14m 3FCusMgkMGjSce0/JyuXccLLCa+ntvtsyFTCxRccVmr60V2eZHjuDd43u rOXtv1WL2o47slBL7w3WG3W4rfkG4peHxaX/oOoM+Dr7ez/Y0po73Wc1F wZGosXMQkJG6i89nJkyrUtPriMBUHeE5xOHZ8Rhnaf4QD9NPX/rYPrIzp g==; X-IronPort-AV: E=McAfee;i="6500,9779,10588"; a="351189449" X-IronPort-AV: E=Sophos;i="5.97,213,1669104000"; d="scan'208";a="351189449" Received: from orsmga003.jf.intel.com ([10.7.209.27]) by fmsmga101.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 13 Jan 2023 01:27:25 -0800 X-IronPort-AV: E=McAfee;i="6500,9779,10588"; a="608116104" X-IronPort-AV: E=Sophos;i="5.97,213,1669104000"; d="scan'208";a="608116104" Received: from bard-ubuntu.sh.intel.com ([10.239.185.57]) by orsmga003-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 13 Jan 2023 01:27:23 -0800 From: Bard Liao To: alsa-devel@alsa-project.org, vkoul@kernel.org Cc: vinod.koul@linaro.org, linux-kernel@vger.kernel.org, pierre-louis.bossart@linux.intel.com, bard.liao@intel.com Subject: [PATCH 3/5] soundwire: bus: remove sdw_defer argument in sdw_transfer_defer() Date: Fri, 13 Jan 2023 17:35:30 +0800 Message-Id: <20230113093532.3872113-4-yung-chuan.liao@linux.intel.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230113093532.3872113-1-yung-chuan.liao@linux.intel.com> References: <20230113093532.3872113-1-yung-chuan.liao@linux.intel.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-4.3 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_EF,RCVD_IN_DNSWL_MED, RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,SPF_HELO_NONE,SPF_NONE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Pierre-Louis Bossart There's no point in passing an argument that is a pointer to a bus member. We can directly get the member and do an indirection when needed. This is a first step before simplifying the hardware-specific callbacks further. Signed-off-by: Pierre-Louis Bossart Reviewed-by: Ranjani Sridharan Signed-off-by: Bard Liao --- drivers/soundwire/bus.c | 10 ++++------ drivers/soundwire/bus.h | 3 +-- drivers/soundwire/stream.c | 4 +--- 3 files changed, 6 insertions(+), 11 deletions(-) diff --git a/drivers/soundwire/bus.c b/drivers/soundwire/bus.c index 633d411b64f3..572cc9a9af41 100644 --- a/drivers/soundwire/bus.c +++ b/drivers/soundwire/bus.c @@ -225,9 +225,9 @@ static inline int do_transfer(struct sdw_bus *bus, struct sdw_msg *msg) } static inline int do_transfer_defer(struct sdw_bus *bus, - struct sdw_msg *msg, - struct sdw_defer *defer) + struct sdw_msg *msg) { + struct sdw_defer *defer = &bus->defer_msg; int retry = bus->prop.err_threshold; enum sdw_command_response resp; int ret = 0, i; @@ -335,19 +335,17 @@ EXPORT_SYMBOL(sdw_show_ping_status); * sdw_transfer_defer() - Asynchronously transfer message to a SDW Slave device * @bus: SDW bus * @msg: SDW message to be xfered - * @defer: Defer block for signal completion * * Caller needs to hold the msg_lock lock while calling this */ -int sdw_transfer_defer(struct sdw_bus *bus, struct sdw_msg *msg, - struct sdw_defer *defer) +int sdw_transfer_defer(struct sdw_bus *bus, struct sdw_msg *msg) { int ret; if (!bus->ops->xfer_msg_defer) return -ENOTSUPP; - ret = do_transfer_defer(bus, msg, defer); + ret = do_transfer_defer(bus, msg); if (ret != 0 && ret != -ENODATA) dev_err(bus->dev, "Defer trf on Slave %d failed:%d\n", msg->dev_num, ret); diff --git a/drivers/soundwire/bus.h b/drivers/soundwire/bus.h index 7631ef5e71fb..96927a143796 100644 --- a/drivers/soundwire/bus.h +++ b/drivers/soundwire/bus.h @@ -151,8 +151,7 @@ int sdw_configure_dpn_intr(struct sdw_slave *slave, int port, bool enable, int mask); int sdw_transfer(struct sdw_bus *bus, struct sdw_msg *msg); -int sdw_transfer_defer(struct sdw_bus *bus, struct sdw_msg *msg, - struct sdw_defer *defer); +int sdw_transfer_defer(struct sdw_bus *bus, struct sdw_msg *msg); #define SDW_READ_INTR_CLEAR_RETRY 10 diff --git a/drivers/soundwire/stream.c b/drivers/soundwire/stream.c index f27bd37b154d..e0b0c63fc55c 100644 --- a/drivers/soundwire/stream.c +++ b/drivers/soundwire/stream.c @@ -684,8 +684,6 @@ static int sdw_bank_switch(struct sdw_bus *bus, int m_rt_count) if (!wr_msg) return -ENOMEM; - bus->defer_msg.msg = wr_msg; - wbuf = kzalloc(sizeof(*wbuf), GFP_KERNEL); if (!wbuf) { ret = -ENOMEM; @@ -713,7 +711,7 @@ static int sdw_bank_switch(struct sdw_bus *bus, int m_rt_count) multi_link = bus->multi_link && (m_rt_count >= bus->hw_sync_min_links); if (multi_link) - ret = sdw_transfer_defer(bus, wr_msg, &bus->defer_msg); + ret = sdw_transfer_defer(bus, wr_msg); else ret = sdw_transfer(bus, wr_msg); -- 2.25.1