Received: by 2002:ac0:a594:0:0:0:0:0 with SMTP id m20-v6csp4341059imm; Fri, 18 May 2018 03:34:34 -0700 (PDT) X-Google-Smtp-Source: AB8JxZqWK7iet6HsAGfhyU0Lu2ThOwaBCRtHACaIxvQs0gxpJYzDHZ7Sd3H2FmdaLBTE1DcLfn7q X-Received: by 2002:a17:902:6686:: with SMTP id e6-v6mr8982770plk.35.1526639674381; Fri, 18 May 2018 03:34:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1526639674; cv=none; d=google.com; s=arc-20160816; b=fGGoj0OvoiNOY1sukYVRvoMmi0Fb5J3Ke+4gWEP2cT8BdZyjrmD+fZiQXsA3frZF9c UCsrvjIpYxYYzz7bClggA/IjDq5qnWbv/deKu07f31Lb28T31C3DyLYxxZ2q8evADWQm P5e2Gbxc/68mt2I3g7RrLNFH8BGdKnbF7L7LGH6TCht+KULOf4u3ycV6HrnmkZjh4H9M JR5dxDU9hvRW+M6uoR9ElfsN3rbdF2jc9TenxplwdRobXtovaKDfsbrjC2A3YftCMlhQ 37tqrVsRSyzs3BTC+afYTkUcw33QRXZNBMgYkhQYqqkQ5Vztv+hDXY8j414mFYUm1xGz v4JA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature:arc-authentication-results; bh=mrlhryGd1zUtOvLg/ngqC5LqE3Y8XGBVqRFwggWHaTs=; b=zWmAjqqt3DTV+J2/2xN4X4F1aUbWiicqb1z96o4/ZGH6MrwpJByMEVaHjZQ1ZmZt4W 9AEEK4H2kxYg/i87PZdh3sCbQ4rVUaUihosfGndd7Rk3epGsSFgYJJRiSaPwr6fg2XUl DWLnPSWGX56trTE29KsVRkzSgDyTOCKR6+/liWdTw7UQL8RHnYDrOeXDN2bsbh4/TqJg fRUtIdKj8s7NREqsFLady/hvbxDhlePzymIUnJ5ldgLjFBMZj5o0H/dmGySHE/aD5lrV aZ/+Z+NjH6daN2roDjuZHCoeCtPnl37FLsqQICxkjxp2v3Jx8yERGfU4CNWJJ8dJQSFl jCrA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=S+B602X/; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 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. [209.132.180.67]) by mx.google.com with ESMTP id n3-v6si7003336pld.116.2018.05.18.03.34.20; Fri, 18 May 2018 03:34:34 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=S+B602X/; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 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 S1752802AbeERKdz (ORCPT + 99 others); Fri, 18 May 2018 06:33:55 -0400 Received: from mail-lf0-f67.google.com ([209.85.215.67]:41663 "EHLO mail-lf0-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752530AbeERKbx (ORCPT ); Fri, 18 May 2018 06:31:53 -0400 Received: by mail-lf0-f67.google.com with SMTP id m17-v6so13205785lfj.8 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=Q8qDacapZEi9TOJvSydlzKi8dKLi8w1kClxuhvVmY/jIJf8A0yRm6Ei40nVuRkhh23 DbeVfMfgjZR5CYxK2H+P5TMFtwiKkhdy62ESUy32KBhVVY+epJRCaQbLDAVm7A54VOsw dQbsKBa8jXKea9oDATmwIkSUEvRHmxDqXWwCtbzrmx3pmNtS9aqLkx+WkyLGnpB2OmJB tzkff1iVoAadwXHf+WwhlADfClQklQ4mumeJI1+3rKLX8+hfU0H6W5foRN9OowyzghcR QCJLZNwLAjqaoPJ2hLJTa9yvE9Eyhl1y7YPtZwK4hGE0D3IJ+FfOx9I52O/1V4J9EHFV 5tXA== X-Gm-Message-State: ALKqPwdr+yzJ/lE8VFu5+DuDgR3dXmqn1pngfyRCfzJAlxCBjI9PDOwj YoMNGjIu46hBkOQcVzDONmKTrQ== 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 Cc: Ulf Hansson , Greg Kroah-Hartman , Jon Hunter , Geert Uytterhoeven , Todor Tomov , Rajendra Nayak , Viresh Kumar , Vincent Guittot , Kevin Hilman , linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-tegra@vger.kernel.org, Alex Deucher , =?UTF-8?q?Christian=20K=C3=B6nig?= , David Zhou 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 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.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; } -- 2.7.4