From patchwork Fri May 18 10:31:24 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Ulf Hansson X-Patchwork-Id: 916187 Return-Path: X-Original-To: incoming-imx@patchwork.ozlabs.org Delivered-To: patchwork-incoming-imx@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=lists.infradead.org (client-ip=2607:7c80:54:e::133; helo=bombadil.infradead.org; envelope-from=linux-arm-kernel-bounces+incoming-imx=patchwork.ozlabs.org@lists.infradead.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=linaro.org Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="pqI2ImyO"; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=linaro.org header.i=@linaro.org header.b="S+B602X/"; dkim-atps=neutral Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:e::133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 40nPff6TBsz9s2k for ; Fri, 18 May 2018 20:34:02 +1000 (AEST) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=CGwOlo0f0Hq/YV6Sv2fJNQiuMxmIVj9jIYWS38VJo6o=; b=pqI2ImyOBE2REe 53lVcCfqcTF7ruE1Z+bd55eDwOjgQMtv4j96LIwr8ARqRjuyKW+17CNd4zpF2yJjo7ZsT2Cdd0PDd KjGQKLkzfwNtWYF5wyOZ7koR8RySPuw5/PBVsBiaC8uT32Jz5AvFiDsLbNuVcU/VVQkfWpkVrrpWi MMPwagfb/LTCbNvqI8xflNvy+mP0L6/lsK4vDZ78o/6T2gBaWkQrBNDFJvVQcHI9wraHGWR16RkRK Q3gwoS9r9Yxt86xv8WGfEk99Izd31Drv4DvRulnrqVGZd6Y5jqrnofOSY0nxOFiaU7BOmZRJSV6Jd Eweclq70uU2gX9+Xfo3w==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1fJchu-0001yZ-Sn; Fri, 18 May 2018 10:33:55 +0000 Received: from mail-lf0-x244.google.com ([2a00:1450:4010:c07::244]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1fJcg3-0001I1-Cn for linux-arm-kernel@lists.infradead.org; Fri, 18 May 2018 10:32:03 +0000 Received: by mail-lf0-x244.google.com with SMTP id y72-v6so13229541lfd.2 for ; Fri, 18 May 2018 03:31:52 -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=mrlhryGd1zUtOvLg/ngqC5LqE3Y8XGBVqRFwggWHaTs=; b=S+B602X/KlaCWP6uFlXFWrmH7FqhohWe3/D8x92HusdtLldYaRE5dNHWk6+tDLjw5C oYLPx+Xo29TLaZl3/QXuTkXBywtGOLhZMRhcGM7MgV1IhMqKuTmDVFtRCpmG/jUeV1Q9 I262o1K0k4KxyM0u1qXUJLFjbbC03HiUS2hC4= 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=mrlhryGd1zUtOvLg/ngqC5LqE3Y8XGBVqRFwggWHaTs=; b=t02T/+w7HacJVB9rgxsVTO+Q7UFIFCYuwNcUB/KCX7Z8vI+fqWPwr9FZcP7CFj+GSs 3P4Ud0KXiPzpixIRal3+Lf5gifYRgUwWOzof2WqR1LyHRYJ2i8WtPDUjG5JpBO9GdR/p noUzIAAmLJFt/4iGcpnpRtJdKyhCNm5LJTxe5xD5/CneFJUnfS3zbqzgeETWy+GEqMtV AnLqdnXUoKyqB0LxPOSdoP3ofwJCQlmYD6NSqDhsMBkCaJEillJ7dqHgEzPuNdfk0X4B WVFAnyScG945JhJdcaOstY81o/b3E2Px/3Ryp3V655Wtx21Ou35lz2nmMoKzMpOtxco9 DWcQ== X-Gm-Message-State: ALKqPwdWvvczO9emAyF+yY2SSg12hKOY4G8McLQkDFMwH1LGWK/HKMbB 3QVAv4+8IPbLq8MuRcp62A4qKw== X-Google-Smtp-Source: AB8JxZoSU9iG6mBQQ90xm13k33Urc/Ocnxvp2NGBAuipMgL7V/kLR5ZV9/9m953bZZMGjTSF1DXxZQ== X-Received: by 2002:a19:e99b:: with SMTP id j27-v6mr19990694lfk.93.1526639511483; Fri, 18 May 2018 03:31:51 -0700 (PDT) Received: from localhost.localdomain (h-158-174-22-210.NA.cust.bahnhof.se. [158.174.22.210]) by smtp.gmail.com with ESMTPSA id u14-v6sm393447lfk.55.2018.05.18.03.31.49 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 18 May 2018 03:31:50 -0700 (PDT) From: Ulf Hansson To: "Rafael J . Wysocki" , linux-pm@vger.kernel.org Subject: [PATCH 3/9] PM / Domains: Drop genpd as in-param for pm_genpd_remove_device() Date: Fri, 18 May 2018 12:31:24 +0200 Message-Id: <1526639490-12167-4-git-send-email-ulf.hansson@linaro.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1526639490-12167-1-git-send-email-ulf.hansson@linaro.org> References: <1526639490-12167-1-git-send-email-ulf.hansson@linaro.org> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20180518_033159_465395_3F43676C X-CRM114-Status: GOOD ( 17.30 ) X-Spam-Score: -0.1 (/) X-Spam-Report: SpamAssassin version 3.4.1 on bombadil.infradead.org summary: Content analysis details: (-0.1 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at http://www.dnswl.org/, no trust [2a00:1450:4010:c07:0:0:0:244 listed in] [list.dnswl.org] -0.0 SPF_PASS SPF: sender matches SPF record 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: David Zhou , Ulf Hansson , Rajendra Nayak , Geert Uytterhoeven , Kevin Hilman , Greg Kroah-Hartman , linux-kernel@vger.kernel.org, Jon Hunter , Todor Tomov , Alex Deucher , Viresh Kumar , linux-tegra@vger.kernel.org, Vincent Guittot , =?utf-8?q?Christian_K=C3=B6nig?= , linux-arm-kernel@lists.infradead.org Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+incoming-imx=patchwork.ozlabs.org@lists.infradead.org List-Id: linux-imx-kernel.lists.patchwork.ozlabs.org There is no need to pass a genpd struct to pm_genpd_remove_device(), as we already have the information about the PM domain (genpd) through the device structure. Additionally, we don't allow to remove a PM domain from a device, other than the one it may have assigned to it, so really it does not make sense to have a separate in-param for it. For these reason, drop it and update the current only call to pm_genpd_remove_device() from amdgpu_acp. Cc: Alex Deucher Cc: Christian König Cc: David (ChunMing) Zhou Signed-off-by: Ulf Hansson --- drivers/base/power/domain.c | 8 ++++---- drivers/gpu/drm/amd/amdgpu/amdgpu_acp.c | 2 +- include/linux/pm_domain.h | 5 ++--- 3 files changed, 7 insertions(+), 8 deletions(-) diff --git a/drivers/base/power/domain.c b/drivers/base/power/domain.c index d58aee3..f08fa15 100644 --- a/drivers/base/power/domain.c +++ b/drivers/base/power/domain.c @@ -1475,13 +1475,13 @@ static int genpd_remove_device(struct generic_pm_domain *genpd, /** * pm_genpd_remove_device - Remove a device from an I/O PM domain. - * @genpd: PM domain to remove the device from. * @dev: Device to be removed. */ -int pm_genpd_remove_device(struct generic_pm_domain *genpd, - struct device *dev) +int pm_genpd_remove_device(struct device *dev) { - if (!genpd || genpd != genpd_lookup_dev(dev)) + struct generic_pm_domain *genpd = genpd_lookup_dev(dev); + + if (!genpd) return -EINVAL; return genpd_remove_device(genpd, dev); diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_acp.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_acp.c index a29362f..1255804 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_acp.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_acp.c @@ -513,7 +513,7 @@ static int acp_hw_fini(void *handle) if (adev->acp.acp_genpd) { for (i = 0; i < ACP_DEVS ; i++) { dev = get_mfd_cell_dev(adev->acp.acp_cell[i].name, i); - ret = pm_genpd_remove_device(&adev->acp.acp_genpd->gpd, dev); + ret = pm_genpd_remove_device(dev); /* If removal fails, dont giveup and try rest */ if (ret) dev_err(dev, "remove dev from genpd failed\n"); diff --git a/include/linux/pm_domain.h b/include/linux/pm_domain.h index 79888fb..42e0d64 100644 --- a/include/linux/pm_domain.h +++ b/include/linux/pm_domain.h @@ -144,7 +144,7 @@ static inline struct generic_pm_domain_data *dev_gpd_data(struct device *dev) } int pm_genpd_add_device(struct generic_pm_domain *genpd, struct device *dev); -int pm_genpd_remove_device(struct generic_pm_domain *genpd, struct device *dev); +int pm_genpd_remove_device(struct device *dev); int pm_genpd_add_subdomain(struct generic_pm_domain *genpd, struct generic_pm_domain *new_subdomain); int pm_genpd_remove_subdomain(struct generic_pm_domain *genpd, @@ -167,8 +167,7 @@ static inline int pm_genpd_add_device(struct generic_pm_domain *genpd, { return -ENOSYS; } -static inline int pm_genpd_remove_device(struct generic_pm_domain *genpd, - struct device *dev) +static inline int pm_genpd_remove_device(struct device *dev) { return -ENOSYS; }