From patchwork Wed Feb 28 15:11:39 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ulf Hansson X-Patchwork-Id: 13575691 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 9349EC5478C for ; Wed, 28 Feb 2024 15:12:04 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:Message-Id:Date:Subject:Cc :To:From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=1zJ+OF7WnaJ464GhN4grUKKjq3NjrjfF6EUOZXBnsis=; b=Q2YsoyIq2wgwRd x03XvIkBfH7lU2vqqjP8EciSuKpHLAsDpLGULN5mfQIYo6QmItb6Uk3v44vv+VuD7xk1w5dPOfxDf zv6KeJDqCtHIq0MrjPWvOvhS8zX9bDPe+E+HRsVsJuTC+dnVleGKe3CdHf/qHKWdRIn2NgXWMf25Z wgNjwbPhcGTzh0V1z3sv2qIM9fiuVjYVmvstW59AuuosLZMa+1akTWYw0n5I5x9GDIcflKDCtecPX PRfD7lbcjCuKmA1vGwtQuSAyeVUayWKbE1Qt70v8twP/CIYKa+SyAPIBx+aVBe7dW95nRyFyjIeH1 ECE2HgjMXv5AoSw+xNbg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1rfLb1-00000009qF6-34vF; Wed, 28 Feb 2024 15:11:47 +0000 Received: from mail-lj1-x232.google.com ([2a00:1450:4864:20::232]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1rfLaz-00000009qED-2Zpd for linux-arm-kernel@lists.infradead.org; Wed, 28 Feb 2024 15:11:46 +0000 Received: by mail-lj1-x232.google.com with SMTP id 38308e7fff4ca-2d2ab9c5e83so18646851fa.2 for ; Wed, 28 Feb 2024 07:11:44 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1709133103; x=1709737903; darn=lists.infradead.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=LtE+UgD0QskHrQJXqL71ZDAEvdhVjPCJCqkXaGVdmTI=; b=qGbfpH2qKFVMGAqCUTh4gJ4MT1XIYUzxGQpl2aMsUJOdsb86LWjkgbiTDaN3p9I+Y0 UGlvASWQjvANRj6L9oBTMs3q7mtfN+cbKkaLUq4IcH78/VKNxq4692MyXr7yPMS3rDX1 R4UOPxQdXlLCH48cwcS+ApSyIjg1XMKCOxaL25xviBokuWS4mq1LJp89MouM9gvVscEM QL1RVOqL/1yfdl1Q5F6e4QYHX5iJl7m4iF7XYrj429symtcEWzk/1w2PxZ4lqo9nN58n pzX1xjXQPTIN6Jhb/TquHCBCaeSNWqkIX3AHNYtNKUIYa4qCfEjWg5VqRAgxh27w2R+G N+mQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1709133103; x=1709737903; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=LtE+UgD0QskHrQJXqL71ZDAEvdhVjPCJCqkXaGVdmTI=; b=Jurxn6b8mS4kfDMOfXtA1/Rp4p6rYyrppzaaadLoXhgrjZQyXHjA8xKAPmcjxN27cM zfUKn9TDq5BWFpNVGJVEzMoI+FRQXAQkOwrkhWrxsB6MG1f0l7ZfvEMzLbMMK06QgCKU F/obKv0xOWT/GhBld6beizXKDNWqY994MXmcn1rNRm9bmZTeKo0AJ1oBecIPEpmtoNcv gTo3Ge2jDPi2x3orYl3YsfZXLJBJFvuEqiBUJYJok8gQ1iE+lFxaBSUGh+xw3TFbpraQ 3nKpAzAGK0QGpvrH7jMrRlQBPxJGPAkJm+18SEkajuQcfAFi9KEJpOJGK97rGCf+tb3T dYFg== X-Forwarded-Encrypted: i=1; AJvYcCXes8Z6aIHXtuHdP2Q+PlttdTYuWmvQlyjC2k98AxbNfjly3L+0lV+7iWcFi/8/jEH+Pyc30Xj9usnIvBuXyzcrQ1rdNAjhNiMLDS4Hcgux0DowNN0= X-Gm-Message-State: AOJu0YxQu02EDKNaebGz+gD8LcoMXvdYOFB/FP4y4Wxmzgot+7auolIs 81sa/LTl1HMDr3iTG5kGHHTqX9B804UEzyiyUs1PruAcZK93lvgP37UMF+2T7gw= X-Google-Smtp-Source: AGHT+IFjY2DdxE3YaQu9B/2dyU4BKjLYmqLA9+zox9Fix3aI+88/D2kZyxgGrpvERvBgjO5Eq0TSHw== X-Received: by 2002:a2e:84d5:0:b0:2d2:2ce1:1196 with SMTP id q21-20020a2e84d5000000b002d22ce11196mr8197892ljh.53.1709133103567; Wed, 28 Feb 2024 07:11:43 -0800 (PST) Received: from uffe-tuxpro14.. (h-178-174-189-39.A498.priv.bahnhof.se. [178.174.189.39]) by smtp.gmail.com with ESMTPSA id k2-20020a2ea282000000b002d10daeb6dasm1652560lja.126.2024.02.28.07.11.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 28 Feb 2024 07:11:43 -0800 (PST) From: Ulf Hansson To: "Rafael J . Wysocki" , Sudeep Holla , linux-pm@vger.kernel.org Cc: Lorenzo Pieralisi , Daniel Lezcano , Maulik Shah , Ulf Hansson , linux-arm-kernel@lists.infradead.org Subject: [PATCH] cpuidle: psci: Drop superfluous wrappers psci_dt_attach|detach_cpu() Date: Wed, 28 Feb 2024 16:11:39 +0100 Message-Id: <20240228151139.2650258-1-ulf.hansson@linaro.org> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240228_071145_684428_CB07D1E2 X-CRM114-Status: GOOD ( 12.79 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org To simplify the code, let's drop psci_dt_attach|detach_cpu() and use the common dt_idle_attach|detach_cpu() directly instead. Signed-off-by: Ulf Hansson Reviewed-by: Sudeep Holla --- drivers/cpuidle/cpuidle-psci-domain.c | 1 + drivers/cpuidle/cpuidle-psci.c | 5 +++-- drivers/cpuidle/cpuidle-psci.h | 20 -------------------- 3 files changed, 4 insertions(+), 22 deletions(-) diff --git a/drivers/cpuidle/cpuidle-psci-domain.c b/drivers/cpuidle/cpuidle-psci-domain.c index b88af1262f1a..2b47811d986f 100644 --- a/drivers/cpuidle/cpuidle-psci-domain.c +++ b/drivers/cpuidle/cpuidle-psci-domain.c @@ -20,6 +20,7 @@ #include #include "cpuidle-psci.h" +#include "dt_idle_genpd.h" struct psci_pd_provider { struct list_head link; diff --git a/drivers/cpuidle/cpuidle-psci.c b/drivers/cpuidle/cpuidle-psci.c index bf68920d038a..782030a27703 100644 --- a/drivers/cpuidle/cpuidle-psci.c +++ b/drivers/cpuidle/cpuidle-psci.c @@ -28,6 +28,7 @@ #include "cpuidle-psci.h" #include "dt_idle_states.h" +#include "dt_idle_genpd.h" struct psci_cpuidle_data { u32 *psci_states; @@ -224,7 +225,7 @@ static int psci_dt_cpu_init_topology(struct cpuidle_driver *drv, if (IS_ENABLED(CONFIG_PREEMPT_RT)) return 0; - data->dev = psci_dt_attach_cpu(cpu); + data->dev = dt_idle_attach_cpu(cpu, "psci"); if (IS_ERR_OR_NULL(data->dev)) return PTR_ERR_OR_ZERO(data->dev); @@ -311,7 +312,7 @@ static void psci_cpu_deinit_idle(int cpu) { struct psci_cpuidle_data *data = per_cpu_ptr(&psci_cpuidle_data, cpu); - psci_dt_detach_cpu(data->dev); + dt_idle_detach_cpu(data->dev); psci_cpuidle_use_cpuhp = false; } diff --git a/drivers/cpuidle/cpuidle-psci.h b/drivers/cpuidle/cpuidle-psci.h index 4e132640ed64..ef004ec7a7c5 100644 --- a/drivers/cpuidle/cpuidle-psci.h +++ b/drivers/cpuidle/cpuidle-psci.h @@ -3,29 +3,9 @@ #ifndef __CPUIDLE_PSCI_H #define __CPUIDLE_PSCI_H -struct device; struct device_node; void psci_set_domain_state(u32 state); int psci_dt_parse_state_node(struct device_node *np, u32 *state); -#ifdef CONFIG_ARM_PSCI_CPUIDLE_DOMAIN - -#include "dt_idle_genpd.h" - -static inline struct device *psci_dt_attach_cpu(int cpu) -{ - return dt_idle_attach_cpu(cpu, "psci"); -} - -static inline void psci_dt_detach_cpu(struct device *dev) -{ - dt_idle_detach_cpu(dev); -} - -#else -static inline struct device *psci_dt_attach_cpu(int cpu) { return NULL; } -static inline void psci_dt_detach_cpu(struct device *dev) { } -#endif - #endif /* __CPUIDLE_PSCI_H */