Received: by 2002:ac0:a5b6:0:0:0:0:0 with SMTP id m51-v6csp3206727imm; Tue, 29 May 2018 03:08:45 -0700 (PDT) X-Google-Smtp-Source: AB8JxZqYmctTZpWGOk46YRkTKNG+6+Xd1zWJQ5WlJxIAKf57a6BWvEWli37BAXKPl0r9SAa7YeGP X-Received: by 2002:a62:1282:: with SMTP id 2-v6mr16801935pfs.243.1527588525666; Tue, 29 May 2018 03:08:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1527588525; cv=none; d=google.com; s=arc-20160816; b=Tpr5fldOHx1CEbOT5MCkfAy1mFO85pOMDrJi4TAkXF0V1LFfWJFAESaUDCAtJoQG0y MraiPtF/UDbVajsNSdv9QF6Ctw5qN31MMTSRrLJ82O9RaNPag8xUx/i4Mn4z//scWmFM 55N9zJLlDabot1LLx760wyJkXUCSMAprun4a/9JeiRxKk/ycjaCvKC3cPJIuM7/cxhAV aHmYW0ef3Qc9MOC8ozt4qMae/lwX10H2vCWyqHkJK+maBzKXnRn1BZciasjYCPUEO6Nn 5u6d6Bvhhi3EOZNDtaTGqzoGv6siOwS/5ViGfSnOEBRGsA3sv5iYz7sa7XyRbBO5utBr uIHA== 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=dWpX9GjZyWi/EZMjmixZEwXhleiR7O0lE9qJPYWj4B8=; b=XRTtCL6RJZSJ4Nu+IfWUQB/X4ACYJSTpJV9cHGRxusIeR7b3rFl2XeEL3UvVcL9bfE tTptnRFlP5evT0/Tq+9RIXz39yh63wwWfrlWsUFcHVYbtr3ZisyG7G+VZzl/JQxtDCjn A2liUcRyD2YZSCUA4VO0ZXOTAMo7ojhry3876Tyw75yFI2cNimmkg4NB5ALp3aNvI1rs SrtDl9RQ0L4MNwuqM67Dws9mNHj/xHsircS40Yux9glW3zSslL4aof9gQGRgsBZ409dY X4x5cNF+2nsD7I4BZTfUSvyuUQNpm88I0ggQisb7k8U6AvWJ7d93xFLp6PBZ7SEnj9oP iv3Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=XbWKu90C; 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 ay5-v6si31153986plb.459.2018.05.29.03.08.31; Tue, 29 May 2018 03:08:45 -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=XbWKu90C; 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 S932914AbeE2KGm (ORCPT + 99 others); Tue, 29 May 2018 06:06:42 -0400 Received: from mail-wm0-f67.google.com ([74.125.82.67]:54750 "EHLO mail-wm0-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933026AbeE2KEd (ORCPT ); Tue, 29 May 2018 06:04:33 -0400 Received: by mail-wm0-f67.google.com with SMTP id f6-v6so38828250wmc.4 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=BOK9Om7Pv1zUgWXT5ilaw+nWEd4vsa/tkdsx7qcg3PxIAW11r8Ji6DN+3lVp0AgN80 Wa15pRXnteX1D7tm8/GF6xH+n4Kuy6+3gmxEU/74b6fGlWXHDYJZHmRt6/ZnZEV+1ePl FZp1NwmuE5iJbVUG/0dSS8OoklmHC2fqPqex3Hu2wMULk5EHzMP+HLlbPrAy4t3ei7/5 uG4gs0ew5XA8ITO5PRTlP+2kUhmWQq14qeqt/yMBF7scvbvwaqMAT8jSQIbiHHUOqor1 +dTJmnC1cClKoxEdjXZy/X4ViK4JHzqIY9f8/B+6AUMfWCtuY/cdQsT72vIit5yG31rt eqcA== X-Gm-Message-State: ALKqPwf3wZcA/hM4OnzQ89pvCTYMNz32JZvkU/DIjU0+A/Nq01ShW2iB eIREOjMCzMzNWsJ9fEHkmleFRQ== 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 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 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 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 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; } -- 2.17.0