Received: by 2002:a05:6a10:c604:0:0:0:0 with SMTP id y4csp3838400pxt; Tue, 10 Aug 2021 12:32:05 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxBguMacvI77baGW2iPUAcRUkYB5kYm77+3qg6L/0pzPvZg7tpaqa/1cBKMDnnxgXNTYBX/ X-Received: by 2002:a17:906:81c8:: with SMTP id e8mr85858ejx.401.1628623925637; Tue, 10 Aug 2021 12:32:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1628623925; cv=none; d=google.com; s=arc-20160816; b=ff9s9kjRPiqfPdFVF+fqgxS570Muxmb/OTuMphRZ7QdhTGFhwtKTWnzdSIyziS44/2 w1YiX5dkgHabieUWr4AyQwHYF/40HZQhLNUaElEd3g6ifOf4L80Vi421vhrmjaE9UYnv L045Hz7XSBVyGN8mIw8Jd6J8DOEL3/jAw78kISjDPUwkIBRm++XCR++OULYjsujzA8wu IcwVn3rhHvNACwT4XL4xahUZukElTTWzhRZg7PKazh82qtJonxgNyne+K8J6vJMdQSA2 aPqXq85wPiIp1mhZ+KroUPwWEgiyziBCvXmqjsRKQtulEK0UlTgzQgSNVPtnBC6GY9Na QxLQ== 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=MR4KCI2yYpZ9otoweP9rpmQowf+z82KBy/Idz2Qlj/0=; b=injCYT7Z7d5WDAgI3eSmTD5ym41qEfr4qki/Rp8VcaKgYWlwGwmmmAkhHg86wQRHXN Rvr3DXTWpioH+Sd7a3rhMgaUOLQnoanz6dEW0DaeS5KSsZw0tdULKmhRQSjQ2ea8L+CM 3rc6C95dWIJfhaTIm/QwlOrGUb9yYQY8M9FjV22Fkz6dUzNpd/mvK15q3eRlTFKR9+Rb 3ZidHpojQBe8ey+Xz4thbPpT7Qa/T30UzyFzEiQ9QG1TskY7bIPyA0u6indern+/VEDP ySEjovDCZVn4tGT9Yv001FAClM3ll3uRRZFMEHVSDiFkmMDa+OVcyCkJNL15CoaVa08P MwqQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=mefo2O63; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id cx28si9118098edb.322.2021.08.10.12.31.34; Tue, 10 Aug 2021 12:32:05 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=mefo2O63; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232888AbhHJT17 (ORCPT + 99 others); Tue, 10 Aug 2021 15:27:59 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49232 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232761AbhHJT1f (ORCPT ); Tue, 10 Aug 2021 15:27:35 -0400 Received: from mail-io1-xd2c.google.com (mail-io1-xd2c.google.com [IPv6:2607:f8b0:4864:20::d2c]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7E144C0613D3 for ; Tue, 10 Aug 2021 12:27:13 -0700 (PDT) Received: by mail-io1-xd2c.google.com with SMTP id h1so380773iol.9 for ; Tue, 10 Aug 2021 12:27:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=MR4KCI2yYpZ9otoweP9rpmQowf+z82KBy/Idz2Qlj/0=; b=mefo2O63gy+ObFFjRU56/Lf4YYjX7qPvTBcZFAFkrC0V6Lg2lTrXRZFlioULpqQrhL TRJJ0/ksQUy11b+fvz8hzUmH0viq0CoTjXp/hbLUmvI/Ckf451vL0suUHJLbcA1bEJZC GIz+Er0hnAxKR1+HcBp/Sfm6mn/8RMR7PBanazy52m7yCw2aDW4rnGkMzTm6Da2otcVK oFymNzFpcB/Ty+mdrMOW5YUtGfYSePXXdk5+iwYABV/giHCq4aY9QzEKkV136VBGR0wk tfgAW6fNPtTr1wYFP+B97a+dL3xZ2oncoLXYgBuj9YpjLVvUFPsM9+ZPn+cjGiKFuC1X xzIg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=MR4KCI2yYpZ9otoweP9rpmQowf+z82KBy/Idz2Qlj/0=; b=r84VH41Z7HJiWT4nc6D82hbKQwNHTl5DYeDQtM/1KIKL8Y5ts5x0en+GD/t96oYzlp eReO3u2nXaWGVJPKZ9OVdQ7HyzBSRTFvh5JGZSc844SmLABVMzUa+yz44YjH8bhw63gt CSbJwZh9gpNBhBkqOzJkPC5rLiXWQnzkwBx0Yhx7GEAsm8dlhumlmhnCOYtrAdh3fnIh KioWK2RUUirQUMtsa+623CgBCCGB4YqzsIQvcDEwzeGWhnuS7/NNzqbfZ0al2espsjXJ IAnRIo60W1xIa/Qje6kZKvCJ7clvc7dQy0EiC45PFmgzEOCDAnVUDCeZgNLmmXbnXTG7 FjLA== X-Gm-Message-State: AOAM5331BtlK4Dhn9+KrNdtfXFZDUVyNZ3uAqbSFdbgF+aaxZOC1W0ff ++IetOgzSFdFEN65NWfCwB5v5A== X-Received: by 2002:a5d:91c2:: with SMTP id k2mr56591ior.117.1628623632939; Tue, 10 Aug 2021 12:27:12 -0700 (PDT) Received: from presto.localdomain (c-73-185-129-58.hsd1.mn.comcast.net. [73.185.129.58]) by smtp.gmail.com with ESMTPSA id c5sm3025356ioz.25.2021.08.10.12.27.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 10 Aug 2021 12:27:12 -0700 (PDT) From: Alex Elder To: davem@davemloft.net, kuba@kernel.org Cc: bjorn.andersson@linaro.org, evgreen@chromium.org, cpratapa@codeaurora.org, subashab@codeaurora.org, elder@kernel.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH net-next 7/7] net: ipa: kill ipa_clock_get_additional() Date: Tue, 10 Aug 2021 14:27:04 -0500 Message-Id: <20210810192704.2476461-8-elder@linaro.org> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20210810192704.2476461-1-elder@linaro.org> References: <20210810192704.2476461-1-elder@linaro.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Now that ipa_clock_get_additional() is a trivial wrapper around pm_runtime_get_if_active(), just open-code it in its only caller and delete the function. Signed-off-by: Alex Elder --- drivers/net/ipa/ipa_clock.c | 9 --------- drivers/net/ipa/ipa_clock.h | 10 ---------- drivers/net/ipa/ipa_smp2p.c | 5 ++++- 3 files changed, 4 insertions(+), 20 deletions(-) diff --git a/drivers/net/ipa/ipa_clock.c b/drivers/net/ipa/ipa_clock.c index ab6626c617b91..6df66c574d594 100644 --- a/drivers/net/ipa/ipa_clock.c +++ b/drivers/net/ipa/ipa_clock.c @@ -264,15 +264,6 @@ static int ipa_runtime_idle(struct device *dev) return -EAGAIN; } -/* Get an IPA clock reference, but only if the reference count is - * already non-zero. Returns true if the additional reference was - * added successfully, or false otherwise. - */ -bool ipa_clock_get_additional(struct ipa *ipa) -{ - return pm_runtime_get_if_active(&ipa->pdev->dev, true) > 0; -} - /* Get an IPA clock reference. If the reference count is non-zero, it is * incremented and return is immediate. Otherwise the IPA clock is * enabled. diff --git a/drivers/net/ipa/ipa_clock.h b/drivers/net/ipa/ipa_clock.h index 8692c0d98bd1c..5c118f2c42e7a 100644 --- a/drivers/net/ipa/ipa_clock.h +++ b/drivers/net/ipa/ipa_clock.h @@ -62,16 +62,6 @@ void ipa_clock_exit(struct ipa_clock *clock); */ int ipa_clock_get(struct ipa *ipa); -/** - * ipa_clock_get_additional() - Get an IPA clock reference if not first - * @ipa: IPA pointer - * - * Return: true if reference taken, false otherwise - * - * This returns immediately, and only takes a reference if not the first - */ -bool ipa_clock_get_additional(struct ipa *ipa); - /** * ipa_clock_put() - Drop an IPA clock reference * @ipa: IPA pointer diff --git a/drivers/net/ipa/ipa_smp2p.c b/drivers/net/ipa/ipa_smp2p.c index f84d6523636e3..04b977cf91593 100644 --- a/drivers/net/ipa/ipa_smp2p.c +++ b/drivers/net/ipa/ipa_smp2p.c @@ -9,6 +9,7 @@ #include #include #include +#include #include #include @@ -84,13 +85,15 @@ struct ipa_smp2p { */ static void ipa_smp2p_notify(struct ipa_smp2p *smp2p) { + struct device *dev; u32 value; u32 mask; if (smp2p->notified) return; - smp2p->clock_on = ipa_clock_get_additional(smp2p->ipa); + dev = &smp2p->ipa->pdev->dev; + smp2p->clock_on = pm_runtime_get_if_active(dev, true) > 0; /* Signal whether the clock is enabled */ mask = BIT(smp2p->enabled_bit); -- 2.27.0