From patchwork Mon Feb 1 13:52:41 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ulf Hansson X-Patchwork-Id: 60931 Delivered-To: patches@linaro.org Received: by 10.112.130.2 with SMTP id oa2csp4942lbb; Mon, 1 Feb 2016 05:52:47 -0800 (PST) X-Received: by 10.112.138.66 with SMTP id qo2mr354078lbb.35.1454334767578; Mon, 01 Feb 2016 05:52:47 -0800 (PST) Return-Path: Received: from mail-lf0-x22f.google.com (mail-lf0-x22f.google.com. [2a00:1450:4010:c07::22f]) by mx.google.com with ESMTPS id p203si15215851lfp.198.2016.02.01.05.52.47 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 01 Feb 2016 05:52:47 -0800 (PST) Received-SPF: pass (google.com: domain of ulf.hansson@linaro.org designates 2a00:1450:4010:c07::22f as permitted sender) client-ip=2a00:1450:4010:c07::22f; Authentication-Results: mx.google.com; spf=pass (google.com: domain of ulf.hansson@linaro.org designates 2a00:1450:4010:c07::22f as permitted sender) smtp.mailfrom=ulf.hansson@linaro.org; dkim=pass header.i=@linaro.org Received: by mail-lf0-x22f.google.com with SMTP id l143so29571005lfe.2 for ; Mon, 01 Feb 2016 05:52:47 -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; bh=7XCO+LKqRgN42AknoLWgHpNg8JPEK97WQj6cuTIz8do=; b=hXfXLPP3CF9d5wHTGADCJaxu7/d02Mn3IUcZWlLQE8BBvk1qLdfKDPS4Io+7D3n64l UpYREPsk0g6ELB6sf4K+tg7runZbZ+tKadcmZAzy8+vh2uTtsoMTsUgbHRaoAiJMpK4J 8e+Cu/spJBTTAlGxsqzObyvZRT0dkroA+c48k= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=7XCO+LKqRgN42AknoLWgHpNg8JPEK97WQj6cuTIz8do=; b=kIh9enwhvzXpAjLluVhICAgnTp7sGvsf7vTgiPGwD42CvJf26z3dfnQC1DBNIgv/s8 TOW8AsV2hD5Mfem3zS/pCXj55Uzp9nw0yInFx+OIPTm6uWGTtNOfnF9PTH9/+lV7nylm 6TBHD+Id9vEwKTv4FwPYCoTXLsTrCLCKz0xgLtpxkbWUSftNpToBHxHoCD+C5mAGmho8 8LPPhf61NvKog0qHdnpsDz2bWwTr83yjDDYzNiWJebuFoCPI7nXkt2EjG63QPkqUZBNc lIu5CYP3iObo6C+4xfU/b95ThjsMevIOKSNoUNLSmoW4/V9EbEtUvAZzUGkhKFtSYPIk uTKg== X-Gm-Message-State: AG10YOTP587b3cdOf53J9ufiLXkecG5akc7dGgrh/vAXZdCsHQ9AqrVyULeb1doWHAKXeV9wpAM= X-Received: by 10.25.146.193 with SMTP id u184mr8821043lfd.86.1454334767354; Mon, 01 Feb 2016 05:52:47 -0800 (PST) Return-Path: Received: from uffe-Latitude-E6430s.ideon.se ([85.235.10.227]) by smtp.gmail.com with ESMTPSA id rk1sm4067933lbb.0.2016.02.01.05.52.45 (version=TLSv1/SSLv3 cipher=OTHER); Mon, 01 Feb 2016 05:52:46 -0800 (PST) From: Ulf Hansson To: "Rafael J. Wysocki" , Kevin Hilman , Ulf Hansson , linux-pm@vger.kernel.org Cc: Len Brown , Pavel Machek , Arnd Bergmann Subject: [PATCH] PM / Domains: Silence compiler warning for an unused function Date: Mon, 1 Feb 2016 14:52:41 +0100 Message-Id: <1454334761-13678-1-git-send-email-ulf.hansson@linaro.org> X-Mailer: git-send-email 1.9.1 The only remaining caller of genpd_poweron() is conditionally compiled based on CONFIG_PM_GENERIC_DOMAINS_OF, so we get a warning when that is unset. By moving the locking/unlocking of the genpd outside genpd_poweron(), thus to the caller, genpd_poweron() becomes redundant. Within this context let's then rename the wrapper function, __genpd_poweron(), to genpd_poweron() as it will then be consistent with its friend genpd_poweroff(). This change silence the warning about the unused function. Reported-by: Arnd Bergmann Fixes: ea823c7cbffa ("PM / Domains: Remove pm_genpd_poweron() API") Signed-off-by: Ulf Hansson --- drivers/base/power/domain.c | 27 +++++++-------------------- 1 file changed, 7 insertions(+), 20 deletions(-) -- 1.9.1 Acked-by: Arnd Bergmann diff --git a/drivers/base/power/domain.c b/drivers/base/power/domain.c index 784dbe8..301b785 100644 --- a/drivers/base/power/domain.c +++ b/drivers/base/power/domain.c @@ -173,14 +173,14 @@ static void genpd_queue_power_off_work(struct generic_pm_domain *genpd) } /** - * __genpd_poweron - Restore power to a given PM domain and its masters. + * genpd_poweron - Restore power to a given PM domain and its masters. * @genpd: PM domain to power up. * @depth: nesting count for lockdep. * * Restore power to @genpd and all of its masters so that it is possible to * resume a device belonging to it. */ -static int __genpd_poweron(struct generic_pm_domain *genpd, unsigned int depth) +static int genpd_poweron(struct generic_pm_domain *genpd, unsigned int depth) { struct gpd_link *link; int ret = 0; @@ -200,7 +200,7 @@ static int __genpd_poweron(struct generic_pm_domain *genpd, unsigned int depth) genpd_sd_counter_inc(master); mutex_lock_nested(&master->lock, depth + 1); - ret = __genpd_poweron(master, depth + 1); + ret = genpd_poweron(master, depth + 1); mutex_unlock(&master->lock); if (ret) { @@ -227,21 +227,6 @@ static int __genpd_poweron(struct generic_pm_domain *genpd, unsigned int depth) return ret; } -/** - * genpd_poweron - Restore power to a given PM domain and its masters. - * @genpd: PM domain to power up. - */ -static int genpd_poweron(struct generic_pm_domain *genpd) -{ - int ret; - - mutex_lock(&genpd->lock); - ret = __genpd_poweron(genpd, 0); - mutex_unlock(&genpd->lock); - return ret; -} - - static int genpd_save_dev(struct generic_pm_domain *genpd, struct device *dev) { return GENPD_DEV_CALLBACK(genpd, int, save_state, dev); @@ -489,7 +474,7 @@ static int pm_genpd_runtime_resume(struct device *dev) } mutex_lock(&genpd->lock); - ret = __genpd_poweron(genpd, 0); + ret = genpd_poweron(genpd, 0); mutex_unlock(&genpd->lock); if (ret) @@ -1821,8 +1806,10 @@ int genpd_dev_pm_attach(struct device *dev) dev->pm_domain->detach = genpd_dev_pm_detach; dev->pm_domain->sync = genpd_dev_pm_sync; - ret = genpd_poweron(pd); + mutex_lock(&pd->lock); + ret = genpd_poweron(pd, 0); + mutex_unlock(&pd->lock); out: return ret ? -EPROBE_DEFER : 0; }