From patchwork Tue May 29 10:04:15 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Ulf Hansson X-Patchwork-Id: 921949 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="oeYp+8T2"; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=linaro.org header.i=@linaro.org header.b="XbWKu90C"; 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 40w8q56dJXz9s0W for ; Tue, 29 May 2018 20:19:45 +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=U7Qnl9IMn7GL9tgUqwHaHfcr/jlDeug7GjNaq/m3Ubc=; b=oeYp+8T2MrJk22 xJ1NZglEQHoHHMDmQXS3GM589mPDZsrMPMzfvZqN6iGELMj9gh+yXQQATasLQrrRPc2kP+b3dYMWr hhbZhebAWufn0reACysrefuRmWzxc5IGoCl8RJTiI7UW5hT6mZU26+mISwHIBN2DJ+E0cn2TBkUyD AuOPk/8QCccpJV4El8cmoyDr8XBLE8tDzs5TKVGq7gLSyiTaKgz69jc7SJ6NLhLB+VZvv7u4NwJvm w/2+LBQj/JwslIWiFEXtGZORpn6GcxWN1t+jGpJTZgd8FQRRpp/wH0H/Py24zSrN6Am5u7PL9HR8i v1kNvCrKuq0jCo9XRSZw==; 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 1fNbj7-0007Yy-2Q; Tue, 29 May 2018 10:19:37 +0000 Received: from mail-wm0-x244.google.com ([2a00:1450:400c:c09::244]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1fNbUi-0004vf-8Y for linux-arm-kernel@lists.infradead.org; Tue, 29 May 2018 10:04:56 +0000 Received: by mail-wm0-x244.google.com with SMTP id a8-v6so38803055wmg.5 for ; Tue, 29 May 2018 03:04:33 -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=dWpX9GjZyWi/EZMjmixZEwXhleiR7O0lE9qJPYWj4B8=; b=XbWKu90Co9xv1XQeW+SUI9hGDj3qL+LaMn+it6SB0ePZT7krrqevsIP5UPCHgRfCZX xzRe6yTkP8kwVvsqBcPMXP99fTT+IMbMH4twcRHqP4Dr63yQypH9quqM8GJfFhqqTsF3 6kHlt7K/Ktj8+o2Yd4Llrr+xMV/HGa1peVeFs= 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=dWpX9GjZyWi/EZMjmixZEwXhleiR7O0lE9qJPYWj4B8=; b=KnHZYYFW8dRf1H7Q6QW3EF8fBXV3bSi7twXt9WcxCTw3YR4FSYa0EzBtY/pelZMDo6 Qo094EHKqZPqRRgWx2Fp43AEkztjWhJse1gicqMHLRMRbgrHV+8xaCpbSIKpovHJt2b0 taiThMy29RkNaNgDegpUn1ZeuWtlEW95a0027daQUZUnAyUyvZD7WNj2g69YshH6tGA8 YvuJVPO28OSrxD/VhK8QSU3+ss9Z0wtc3sYknfb0DL3GKmY9vzbQ0V55MvQIzD2G20ft V6iuF494tblMug1sms0vgKWbsujNgWZsQ7AjuBfEUb1Cp8qFiflEzxtzKYfKlASitnCS 6+Sw== X-Gm-Message-State: ALKqPwfH+93q4rNdSBK3YFEiySnOl+QL2RK+K5ST2XnhalnAnT+QrDbr 0RHNBKFIuIJ/GNNDlTuNElo8Iw== X-Google-Smtp-Source: AB8JxZrRIwXyOABx/Xb4X51c5Lcj3oLNew6FULQYHdusf/qHmEQEeaK/yntpRkYYTI1ZwJwNwYoHxg== X-Received: by 2002:a2e:2e17:: with SMTP id u23-v6mr10592341lju.77.1527588272582; Tue, 29 May 2018 03:04:32 -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 e21-v6sm2561718lfg.74.2018.05.29.03.04.31 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 29 May 2018 03:04:31 -0700 (PDT) From: Ulf Hansson To: "Rafael J . Wysocki" , linux-pm@vger.kernel.org Subject: [PATCH v2 3/9] PM / Domains: Drop genpd as in-param for pm_genpd_remove_device() Date: Tue, 29 May 2018 12:04:15 +0200 Message-Id: <20180529100421.31022-4-ulf.hansson@linaro.org> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20180529100421.31022-1-ulf.hansson@linaro.org> References: <20180529100421.31022-1-ulf.hansson@linaro.org> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20180529_030444_325143_13A5EDEF X-CRM114-Status: GOOD ( 17.10 ) 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:400c:c09:0:0:0:244 listed in] [list.dnswl.org] -0.0 SPF_PASS SPF: sender matches SPF record -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid 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 Reviewed-by: Viresh Kumar --- 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 469edb401811..c89b0ad068b7 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 a29362f9ef41..12558044acd4 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 79888fb4a81f..42e0d649e653 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; }