From patchwork Wed Dec 20 14:09:19 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ulf Hansson X-Patchwork-Id: 10125777 X-Patchwork-Delegate: geert@linux-m68k.org 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 79EDE60388 for ; Wed, 20 Dec 2017 14:10:32 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 6C3BE28BD9 for ; Wed, 20 Dec 2017 14:10:32 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 5E44A28C94; Wed, 20 Dec 2017 14:10:32 +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=-7.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, RCVD_IN_DNSWL_HI autolearn=unavailable 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 06D1C28BD9 for ; Wed, 20 Dec 2017 14:10:32 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755431AbdLTOJy (ORCPT ); Wed, 20 Dec 2017 09:09:54 -0500 Received: from mail-lf0-f65.google.com ([209.85.215.65]:34873 "EHLO mail-lf0-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755287AbdLTOJc (ORCPT ); Wed, 20 Dec 2017 09:09:32 -0500 Received: by mail-lf0-f65.google.com with SMTP id j124so24199850lfg.2 for ; Wed, 20 Dec 2017 06:09:31 -0800 (PST) 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; bh=+TtaXOcfRw6Y8LWNnibJ7kn4m7ks4WivbXXT89YJPN8=; b=F+j8Zk8ZMOOhQdHxcH+LURSoVc8I7+adMJKIOAyMQAHrxcaGCJnFlm3z8WtMgWRvyd /co0XPrTPKNY2JMJSvJO4AT5IBrB3EjI65lSI0O6dM0lB1H8K/T2VjvGNVDfMMqUIyEn +OgvpiidO2eCBLCQbBnvP8bzjHn1zTmanWKhc= 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; bh=+TtaXOcfRw6Y8LWNnibJ7kn4m7ks4WivbXXT89YJPN8=; b=Kizy5+JYQPeJ8OgL137ulyvDrF3YlGFK5+oqUK012/aShLaeM8kwjBjV4zXuEMYWqv DcPhKOPlNpfdzbgVBR7QkIfAh+GE3oCsF4SDa1q5MChWGXIz1OsK03PV9QCxb+YP6T3S QF/Z/f10lYEFPr7KQGdQ1LBN1caTN6y+axijRrXfjYGKNvit11ZarSKvVfyV/TTKA/sh o4biQ3MuUHJvuJxIri9umbsfLlKXy9j9hJ/ctp6LrgyImSwVCzfFe6lrOZzGipNTUOWJ 05xolul74XKDe+WkEuugLxqLuwf6ZvulvRuskB1Fl/RPyto72DK0Vw584bydc2mIW4PK /a4w== X-Gm-Message-State: AKGB3mIsBlul3dsXaqngho1TDeGvkTSY171/BvXFc/vUz2c7mc48tZ4Z s2s4gKDuUobOg+oXluF/gk2eiQ== X-Google-Smtp-Source: ACJfBotDctwvFMgO8ejewSZ2ZzxVL4uONt/4RQ14TJHn/6uvCAHHCY2QaeRDeMquB7Cynx8DrMb4Gg== X-Received: by 10.25.216.12 with SMTP id p12mr3429945lfg.21.1513778971040; Wed, 20 Dec 2017 06:09:31 -0800 (PST) Received: from localhost.localdomain (h-158-174-22-67.NA.cust.bahnhof.se. [158.174.22.67]) by smtp.gmail.com with ESMTPSA id f10sm3869505lff.56.2017.12.20.06.09.29 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 20 Dec 2017 06:09:30 -0800 (PST) From: Ulf Hansson To: Kishon Vijay Abraham I , linux-kernel@vger.kernel.org Cc: "Rafael J . Wysocki" , linux-pm@vger.kernel.org, Yoshihiro Shimoda , Geert Uytterhoeven , linux-renesas-soc@vger.kernel.org, Ulf Hansson Subject: [PATCH v2 2/3] phy: core: Drop unused runtime PM APIs Date: Wed, 20 Dec 2017 15:09:19 +0100 Message-Id: <1513778960-10073-3-git-send-email-ulf.hansson@linaro.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1513778960-10073-1-git-send-email-ulf.hansson@linaro.org> References: <1513778960-10073-1-git-send-email-ulf.hansson@linaro.org> Sender: linux-renesas-soc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-renesas-soc@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP The phy core already deploys runtime PM support, so there seems to be no obvious reason for having dedicated APIs to control runtime PM for phys. Therefore, let's remove the APIs altogether and instead convert internal needed functions to be static. Signed-off-by: Ulf Hansson Tested-by: Yoshihiro Shimoda --- drivers/phy/phy-core.c | 50 +++---------------------------------------------- include/linux/phy/phy.h | 45 -------------------------------------------- 2 files changed, 3 insertions(+), 92 deletions(-) diff --git a/drivers/phy/phy-core.c b/drivers/phy/phy-core.c index 09588ec..1621625 100644 --- a/drivers/phy/phy-core.c +++ b/drivers/phy/phy-core.c @@ -149,22 +149,7 @@ static struct phy_provider *of_phy_provider_lookup(struct device_node *node) return ERR_PTR(-EPROBE_DEFER); } -int phy_pm_runtime_get(struct phy *phy) -{ - int ret; - - if (!phy->use_runtime_pm) - return -ENOTSUPP; - - ret = pm_runtime_get(phy->dev.parent); - if (ret < 0 && ret != -EINPROGRESS) - pm_runtime_put_noidle(phy->dev.parent); - - return ret; -} -EXPORT_SYMBOL_GPL(phy_pm_runtime_get); - -int phy_pm_runtime_get_sync(struct phy *phy) +static int phy_pm_runtime_get_sync(struct phy *phy) { int ret; @@ -177,43 +162,14 @@ int phy_pm_runtime_get_sync(struct phy *phy) return ret; } -EXPORT_SYMBOL_GPL(phy_pm_runtime_get_sync); -int phy_pm_runtime_put(struct phy *phy) +static int phy_pm_runtime_put(struct phy *phy) { if (!phy->use_runtime_pm) return -ENOTSUPP; return pm_runtime_put(phy->dev.parent); } -EXPORT_SYMBOL_GPL(phy_pm_runtime_put); - -int phy_pm_runtime_put_sync(struct phy *phy) -{ - if (!phy->use_runtime_pm) - return -ENOTSUPP; - - return pm_runtime_put_sync(phy->dev.parent); -} -EXPORT_SYMBOL_GPL(phy_pm_runtime_put_sync); - -void phy_pm_runtime_allow(struct phy *phy) -{ - if (!phy->use_runtime_pm) - return; - - pm_runtime_allow(phy->dev.parent); -} -EXPORT_SYMBOL_GPL(phy_pm_runtime_allow); - -void phy_pm_runtime_forbid(struct phy *phy) -{ - if (!phy->use_runtime_pm) - return; - - pm_runtime_forbid(phy->dev.parent); -} -EXPORT_SYMBOL_GPL(phy_pm_runtime_forbid); int phy_init(struct phy *phy) { @@ -306,7 +262,7 @@ int phy_power_on(struct phy *phy) err_pwr_on: mutex_unlock(&phy->mutex); - phy_pm_runtime_put_sync(phy); + phy_pm_runtime_put(phy); err_pm_sync: if (phy->pwr) regulator_disable(phy->pwr); diff --git a/include/linux/phy/phy.h b/include/linux/phy/phy.h index b4298a1..050b620 100644 --- a/include/linux/phy/phy.h +++ b/include/linux/phy/phy.h @@ -17,7 +17,6 @@ #include #include #include -#include #include struct phy; @@ -134,12 +133,6 @@ static inline void *phy_get_drvdata(struct phy *phy) } #if IS_ENABLED(CONFIG_GENERIC_PHY) -int phy_pm_runtime_get(struct phy *phy); -int phy_pm_runtime_get_sync(struct phy *phy); -int phy_pm_runtime_put(struct phy *phy); -int phy_pm_runtime_put_sync(struct phy *phy); -void phy_pm_runtime_allow(struct phy *phy); -void phy_pm_runtime_forbid(struct phy *phy); int phy_init(struct phy *phy); int phy_exit(struct phy *phy); int phy_power_on(struct phy *phy); @@ -188,44 +181,6 @@ void devm_of_phy_provider_unregister(struct device *dev, int phy_create_lookup(struct phy *phy, const char *con_id, const char *dev_id); void phy_remove_lookup(struct phy *phy, const char *con_id, const char *dev_id); #else -static inline int phy_pm_runtime_get(struct phy *phy) -{ - if (!phy) - return 0; - return -ENOSYS; -} - -static inline int phy_pm_runtime_get_sync(struct phy *phy) -{ - if (!phy) - return 0; - return -ENOSYS; -} - -static inline int phy_pm_runtime_put(struct phy *phy) -{ - if (!phy) - return 0; - return -ENOSYS; -} - -static inline int phy_pm_runtime_put_sync(struct phy *phy) -{ - if (!phy) - return 0; - return -ENOSYS; -} - -static inline void phy_pm_runtime_allow(struct phy *phy) -{ - return; -} - -static inline void phy_pm_runtime_forbid(struct phy *phy) -{ - return; -} - static inline int phy_init(struct phy *phy) { if (!phy)