From patchwork Thu Feb 8 20:28:21 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Krzysztof Kozlowski X-Patchwork-Id: 198564 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:50ea:b0:106:860b:bbdd with SMTP id r10csp438295dyd; Thu, 8 Feb 2024 12:37:40 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCXXSzY9qSQPozY/nJTVXg+u8yIEsq0wcUMejEXnbPuP+iqRel28G9cuw62GYkK7PGUVGXyYf9tgnlvF1Ci8VOUGqoYLkQ== X-Google-Smtp-Source: AGHT+IGKVkXWZu9pPTkeWBdeIyYlHxRhbOBU5ni2sje/iHV4l7JWjPHiBrgwnmWn4wlQ0RhJ0H+C X-Received: by 2002:a17:906:33da:b0:a2f:d73d:e99c with SMTP id w26-20020a17090633da00b00a2fd73de99cmr259294eja.14.1707424659861; Thu, 08 Feb 2024 12:37:39 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1707424659; cv=pass; d=google.com; s=arc-20160816; b=SiPk/j+Mt3+Q/Ub6mujPv+mw0dUrQsO26DoilKuE/v9vOsojnVnFmMXvclIvcfUJ8V lAHXEfjArYMaOSZyz3mS13qs/iMzCpji84XJo8pb/OXTL1rDg0OWUDgDaj3TlafWQblQ FD5Kinw/qBqDjsUEI11Zi62ffQOnZzqdoxB3zV6Z3xxoVw+bY+ipFCHdowNCtdVGkE6r 5hISBbJFM+Uct4J4V0xUlRO29hY/yJzJK8qBuonSGViNGpZzXl8O7o0bCT15IM5fxsN2 tKmd9tlLAVB0rUK0SgJJJkdFuLCtf7N+ME9heKjp32gQRPUq+D+8/qyY53NuuGmb1+HU mbog== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:message-id:date:subject:cc:to :from:dkim-signature; bh=h35dRpjtXdfsQI1xSLGf2CRc3mPgECpofTf+8BcEtiA=; fh=q6MNC0m/QbK/YUv23ioKDR5x1L4A9ZuqTqRqFT7KMuQ=; b=Odn5tf0yZJvuZkTNetMgZr2j27YcLPNBCdftJiPXkbhTpXT9gjQuBV0FM8nwdnLyzD 15WL64BCydKvEbwcR0ocUpMC/4nCRLM6tYgtL2V9HeNN+o2gPzE0+SgNz39CWESUprw0 EU3T8YKHlE4PXetUyoVqHSuHM5LxZgV3C0gq3Hq5HyOsmfd3XxuhTIdUFMCyA9GcWPuf owtB116LQoXKaEys1XhLRrgTPtLQmElS1su4z+Xu6D0NITPHlCVrZfRiW7zcN118OlCu 95oetckK1XxB/YA4qV6ZPJDGE586D44ZDyXalUIM8Kq+b75Q5b0xYELLa4zt3aee6dBl RxPA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=b1H8h7Vi; arc=pass (i=1 spf=pass spfdomain=linaro.org dkim=pass dkdomain=linaro.org dmarc=pass fromdomain=linaro.org); spf=pass (google.com: domain of linux-kernel+bounces-58669-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-58669-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org X-Forwarded-Encrypted: i=2; AJvYcCWN0sSR4lRyfc6Z+U44bhoY4AYcqysg9WDAjWcZCOiYTQ3E7D0DJm87x7TPOdT6UkbqaQy8bWQDROlYD/EqA32TX/0+WA== Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id gy25-20020a170906f25900b00a379d8d3356si32729ejb.818.2024.02.08.12.37.39 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 08 Feb 2024 12:37:39 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-58669-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=b1H8h7Vi; arc=pass (i=1 spf=pass spfdomain=linaro.org dkim=pass dkdomain=linaro.org dmarc=pass fromdomain=linaro.org); spf=pass (google.com: domain of linux-kernel+bounces-58669-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-58669-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id 59CD11F3063D for ; Thu, 8 Feb 2024 20:29:06 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 723A23C494; Thu, 8 Feb 2024 20:28:36 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="b1H8h7Vi" Received: from mail-wr1-f51.google.com (mail-wr1-f51.google.com [209.85.221.51]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 841BB38DF9 for ; Thu, 8 Feb 2024 20:28:27 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.221.51 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707424113; cv=none; b=swpB41VAq93ubKFOoNvD3cVQouFWFAI6whh9Fqqk7O9ciJM5llEu9rvSUF9ximzDDq3ZPHND65ch9AiKS6WVUsJSRa/fEyQpnHwnoTunqqKh9cjIUXbKmNMidUmAsSsXyHK4IxFe8MV9gLtzl9m6oRWr9I5LOeVFYy+Y9zcnXkc= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707424113; c=relaxed/simple; bh=UIiV9ESsbPEqQYxT4Q1BZNvrcYMVMHfj0d1j5Kcslpg=; h=From:To:Cc:Subject:Date:Message-Id:MIME-Version; b=DiDSNyGikPskfNXMQ3xOqkic4Hy9glzGyoo3iwqcXq1jocwIBV+jiZZHwxaixDM4yUhjrAZloyLsBcGEJuyxyIbsl9vfgBG9+J7UnrAzSumHzois+zAbge4nIV/+CvznmBc3vvPQYW/mb2+8liliv0703BYP500NIWnbAJ0Qiqw= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org; spf=pass smtp.mailfrom=linaro.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b=b1H8h7Vi; arc=none smtp.client-ip=209.85.221.51 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linaro.org Received: by mail-wr1-f51.google.com with SMTP id ffacd0b85a97d-33b58ca0b95so50460f8f.0 for ; Thu, 08 Feb 2024 12:28:27 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1707424106; x=1708028906; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=h35dRpjtXdfsQI1xSLGf2CRc3mPgECpofTf+8BcEtiA=; b=b1H8h7VihVDhatvs0btWQgdJUgk1RJuf+zpqWf5Z8h/1+XI1OFxlnyZ5jkdmSSypMA MMsy+9osdRZSrTmhu8U2FgGvt2ZMGFmvw7fvnYGE+6jUmt2F1ZfW3We2fc/YLCRh8tYE Otq/3EtleWRGT/iI19gcgbAAQNxGmMCqygWfXjJd8fBg5StzzRSI7V94W9lUNhO0+jQO VhtwJICvtqLpsRNHZReX18oROfwNXE23edELMoEroN8Dn9DthyP7HWXxiKbQ2IoV/7on Ji1tVvUf+woxIfAv6gTpOCEbF47Wsc6iCRV48gusk7CFm7GSamsIsAsqJ/Q04l3dc91T walQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1707424106; x=1708028906; 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=h35dRpjtXdfsQI1xSLGf2CRc3mPgECpofTf+8BcEtiA=; b=kVxN3OHqccDIBfMWDdIOu42S0Tgjd0geZXPlQ1ZzHNj4xo5gi4W6IYhkScTbzV1C/0 3XAwxj/D68TWhGAvRtj9/kKlOL5Z0A0AZ58mYNQVi3wEWBbJuDqQf0KU3s6BS1Go4oDL 8nmuJUsoY49Of9SOOYOduNVwEUO4ZOWAasdk+xAXlozrhfrbiFnE91PYZvJE0hh1laTM zvSC6AHDTnYEIlDLBQdaU7OUd/SEb2plbhPnLkX8WSqaHTS0K7YQXgtihafYLWpz92YB iztST2g1zPM1mqmkf83QisE1A3N+iOEZVPCuAm+gJUj6iRKbIg5//yWoKbErM8TbK3oL +AWA== X-Forwarded-Encrypted: i=1; AJvYcCUf3L6/WxBoVMrqNcC+w5pIwAvQJhuYIFm+ptfQ6/CaPLUU74Db1uobTVeL9Hs++Mbn5/LLLx7AzAdTGdTEmpm92EGPSF8ZI31hwnuA X-Gm-Message-State: AOJu0YxyRx46hoRJ2ddk6xStgC4lfkis9Nzir8KbR0xGwuSVB3YPnq4y BXTKu8WTvF/OSybzyX4vGXzMviZL/SU/+8MPJ+4bGRBN5uQyLqFQ0lJKnhIoN/o= X-Received: by 2002:a5d:56c7:0:b0:33b:1a3f:a699 with SMTP id m7-20020a5d56c7000000b0033b1a3fa699mr364811wrw.62.1707424105808; Thu, 08 Feb 2024 12:28:25 -0800 (PST) X-Forwarded-Encrypted: i=1; AJvYcCVzkksqL6ijNTu+ChykDzdnhfrXwHt50ayfqYrwupVvquKe8T+v0Q/ETKx/yI3lkqh1WqWHoTUBFyEN4WcFMRdK8aDHfSZxim4b81425V37Z3xs5+U0JQiISpAQ459cQeLgWJmOjc41LDlz4o6HbxFvpJcOwV+4/3kWYrAv6+WIJ2X5yOV3YsBj42oyfkJnvpYpA33TIWPMpvY5UHhYVUywMe1bQSfjOovDuSUx8yfL/zNDs2KkhF/QNTuxQIosTVZ0R0wmBbcIbEhLCfu3BYLRLie+aFVXwSfVe0tjfvc2SM4sP7VSYJK6SXgVoq+nWAS1/y8Z5d+OjIw+9QjwMkqlKVNpdPSTiFJLrwMPM3QR90nDgbd5sNmErAZJb0+dUPB04/LUr1lTY5YqD1dM3Z/4BSvL+YlFPTrZ6+p1E9mrxU5zZ8x3fX/FPZ9zM8s02Kc96oqwDfcW6WSIPOxlGcMVKmnyxKTpGVrzKFE8DKK3dsmSbfjmLRkLctH8gOOQitZ0IqwysX2pe+rL80Jg/r6OOQQ+0t62iWGzU+7fBHQR+A== Received: from krzk-bin.. ([178.197.222.62]) by smtp.gmail.com with ESMTPSA id r16-20020adfce90000000b0033b47ee01f1sm114643wrn.49.2024.02.08.12.28.23 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 08 Feb 2024 12:28:25 -0800 (PST) From: Krzysztof Kozlowski To: Ulf Hansson , Shawn Guo , Sascha Hauer , Pengutronix Kernel Team , Fabio Estevam , NXP Linux Team , Thierry Reding , Jonathan Hunter , Nishanth Menon , Tero Kristo , Santosh Shilimkar , Michal Simek , "Rafael J. Wysocki" , linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-tegra@vger.kernel.org Cc: Krzysztof Kozlowski Subject: [PATCH 1/2] pmdomain: constify of_phandle_args in xlate Date: Thu, 8 Feb 2024 21:28:21 +0100 Message-Id: <20240208202822.631449-1-krzysztof.kozlowski@linaro.org> X-Mailer: git-send-email 2.34.1 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1790364519895809339 X-GMAIL-MSGID: 1790364519895809339 The xlate callbacks are supposed to translate of_phandle_args to proper provider without modifying the of_phandle_args. Make the argument pointer to const for code safety and readability. Signed-off-by: Krzysztof Kozlowski --- drivers/pmdomain/core.c | 4 ++-- drivers/pmdomain/imx/scu-pd.c | 2 +- drivers/pmdomain/tegra/powergate-bpmp.c | 2 +- drivers/pmdomain/ti/ti_sci_pm_domains.c | 2 +- drivers/pmdomain/xilinx/zynqmp-pm-domains.c | 2 +- include/linux/pm_domain.h | 2 +- 6 files changed, 7 insertions(+), 7 deletions(-) diff --git a/drivers/pmdomain/core.c b/drivers/pmdomain/core.c index 46331e71108a..ea4b29475206 100644 --- a/drivers/pmdomain/core.c +++ b/drivers/pmdomain/core.c @@ -2266,7 +2266,7 @@ static DEFINE_MUTEX(of_genpd_mutex); * to be a valid pointer to struct generic_pm_domain. */ static struct generic_pm_domain *genpd_xlate_simple( - struct of_phandle_args *genpdspec, + const struct of_phandle_args *genpdspec, void *data) { return data; @@ -2283,7 +2283,7 @@ static struct generic_pm_domain *genpd_xlate_simple( * the genpd_onecell_data struct when registering the provider. */ static struct generic_pm_domain *genpd_xlate_onecell( - struct of_phandle_args *genpdspec, + const struct of_phandle_args *genpdspec, void *data) { struct genpd_onecell_data *genpd_data = data; diff --git a/drivers/pmdomain/imx/scu-pd.c b/drivers/pmdomain/imx/scu-pd.c index 891c1d925a9d..05841b0bf7f3 100644 --- a/drivers/pmdomain/imx/scu-pd.c +++ b/drivers/pmdomain/imx/scu-pd.c @@ -393,7 +393,7 @@ static int imx_sc_pd_power_off(struct generic_pm_domain *domain) return imx_sc_pd_power(domain, false); } -static struct generic_pm_domain *imx_scu_pd_xlate(struct of_phandle_args *spec, +static struct generic_pm_domain *imx_scu_pd_xlate(const struct of_phandle_args *spec, void *data) { struct generic_pm_domain *domain = ERR_PTR(-ENOENT); diff --git a/drivers/pmdomain/tegra/powergate-bpmp.c b/drivers/pmdomain/tegra/powergate-bpmp.c index 179ed895c279..b0138ca9f851 100644 --- a/drivers/pmdomain/tegra/powergate-bpmp.c +++ b/drivers/pmdomain/tegra/powergate-bpmp.c @@ -305,7 +305,7 @@ static void tegra_bpmp_remove_powergates(struct tegra_bpmp *bpmp) } static struct generic_pm_domain * -tegra_powergate_xlate(struct of_phandle_args *spec, void *data) +tegra_powergate_xlate(const struct of_phandle_args *spec, void *data) { struct generic_pm_domain *domain = ERR_PTR(-ENOENT); struct genpd_onecell_data *genpd = data; diff --git a/drivers/pmdomain/ti/ti_sci_pm_domains.c b/drivers/pmdomain/ti/ti_sci_pm_domains.c index c091d569ecd5..9dddf227a3a6 100644 --- a/drivers/pmdomain/ti/ti_sci_pm_domains.c +++ b/drivers/pmdomain/ti/ti_sci_pm_domains.c @@ -85,7 +85,7 @@ static int ti_sci_pd_power_on(struct generic_pm_domain *domain) * @data: genpd core data for all the powerdomains on the device */ static struct generic_pm_domain *ti_sci_pd_xlate( - struct of_phandle_args *genpdspec, + const struct of_phandle_args *genpdspec, void *data) { struct genpd_onecell_data *genpd_data = data; diff --git a/drivers/pmdomain/xilinx/zynqmp-pm-domains.c b/drivers/pmdomain/xilinx/zynqmp-pm-domains.c index 6fd514286d82..0b5831e5ba1b 100644 --- a/drivers/pmdomain/xilinx/zynqmp-pm-domains.c +++ b/drivers/pmdomain/xilinx/zynqmp-pm-domains.c @@ -210,7 +210,7 @@ static void zynqmp_gpd_detach_dev(struct generic_pm_domain *domain, } static struct generic_pm_domain *zynqmp_gpd_xlate - (struct of_phandle_args *genpdspec, void *data) + (const struct of_phandle_args *genpdspec, void *data) { struct genpd_onecell_data *genpd_data = data; unsigned int i, idx = genpdspec->args[0]; diff --git a/include/linux/pm_domain.h b/include/linux/pm_domain.h index fb91770ba4ba..1a391ef1b6f8 100644 --- a/include/linux/pm_domain.h +++ b/include/linux/pm_domain.h @@ -349,7 +349,7 @@ static inline void dev_pm_genpd_resume(struct device *dev) {} /* OF PM domain providers */ struct of_device_id; -typedef struct generic_pm_domain *(*genpd_xlate_t)(struct of_phandle_args *args, +typedef struct generic_pm_domain *(*genpd_xlate_t)(const struct of_phandle_args *args, void *data); struct genpd_onecell_data { From patchwork Thu Feb 8 20:28:22 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Krzysztof Kozlowski X-Patchwork-Id: 198562 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:50ea:b0:106:860b:bbdd with SMTP id r10csp438091dyd; Thu, 8 Feb 2024 12:37:15 -0800 (PST) X-Google-Smtp-Source: AGHT+IGKZQBq3j3CrxHEnOslw8t91jw16OYWiuvFdHzEBYGGEKUKmZAHQfXTCItic6FQtHfVWnPX X-Received: by 2002:a05:6402:753:b0:560:3745:6576 with SMTP id p19-20020a056402075300b0056037456576mr271382edy.6.1707424635082; Thu, 08 Feb 2024 12:37:15 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1707424635; cv=pass; d=google.com; s=arc-20160816; b=u75utloaoX+II5O88CjgMvbYpolCmKEysfmtXu3/tKhrIZJm9XHU9WA+a8DGL///1O +MYAji6EZPQXOgihBYYaCgBfLJBmWdPHzrQLtjhNTifUOAeK2mUiDFQFZARToRWHT5Fp /KKhdMzSk7lXR4xMZP7n4gQ+7h1/4Af1L73vQn7m/VkTaloS+wqZGTRJTULFKqFrMs0/ Zg3DuewXkylWZAPaOE8rHE/yfifOvJiQlsVn02D6FaXvOJ8oba/jMAFCj8tyd9Wty1f+ k2WgWwRbSRROjrqJMclJ7tqna4b0ihoS90rTthqv4UUyqQSjb7JSNusQjWx6e84DDBxR E9+Q== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=mvrDBjoAHTErzMnmMJ2vCSaXAadIr1IUPSl1p95UmCk=; fh=D/zctSUnMIO+NzFQYIhTjvjmOV8Qtzk1St8+tGkv08A=; b=zRniBOuitEUyC7B8QcnbeRoKUWSbj+AbE+gFNRtP3aCMsjAnIT6Wb3dJsUIniNrNI5 ui6mJeDIMoHp6WU4XwMaGkUMldlHuGl1iUgGq5LH/wMHLeko0ioKNDLdaLqA36+X+nS8 G7e+vcIgi/xpmL08vSUcSo0vuxLSEg5QMYmzxDz3BNzngHQGGRpoQk6xU2TQ23PuHWJm Hjx8kvgc3YHkT1dwI1wt3iKk61xK1pG/dzkkV2mJyvH8HgfKKZPLEyxFVSlFhUgVW5aa TUmvMWWZ1enZPd0031bXKEga/+xcvUGpXkQdO1BPjxlwvkT2uADhsthkxHjVerxmONWp AqbA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=JpNIye8o; arc=pass (i=1 spf=pass spfdomain=linaro.org dkim=pass dkdomain=linaro.org dmarc=pass fromdomain=linaro.org); spf=pass (google.com: domain of linux-kernel+bounces-58668-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-58668-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org X-Forwarded-Encrypted: i=2; AJvYcCUh/wZAo4Wh/7K9+qttOKzm7fl1ikzctSX790UVtfqambyPwOu0CZ4w33RO3xwMfpfBkx9v2ceE8h5BdgEMVAaKKpHVtg== Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id da18-20020a056402177200b0055f39515e36si78840edb.360.2024.02.08.12.37.14 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 08 Feb 2024 12:37:15 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-58668-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=JpNIye8o; arc=pass (i=1 spf=pass spfdomain=linaro.org dkim=pass dkdomain=linaro.org dmarc=pass fromdomain=linaro.org); spf=pass (google.com: domain of linux-kernel+bounces-58668-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-58668-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id 6CCFD1F305DE for ; Thu, 8 Feb 2024 20:29:04 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 496C03C48F; Thu, 8 Feb 2024 20:28:36 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="JpNIye8o" Received: from mail-wr1-f52.google.com (mail-wr1-f52.google.com [209.85.221.52]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 02CA938F82 for ; Thu, 8 Feb 2024 20:28:29 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.221.52 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707424112; cv=none; b=SQ98HOnk2qtIm+OnUDvcp0uvROLEQb/LEJV5n9hlerSDaoVwQdGb6daVyoVfUTvzz8//4OKpC6Zd0ZgIL7i/OFtaPXuP3jECjFScUDTb22iJHAz77T9mkSl/K7C9ENMMc5EIUNSW4XIo7NtG8+Lpw5Qvk0G+n62Ls9h6hyA+hxY= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707424112; c=relaxed/simple; bh=MaJXUgIclpf/EWglWjbhZesimNmRnmJ7sAoUT4K4IHo=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=fTBn9LGqyz3CBsx3WBR7baRd0bHW+a/lbiP6skEnH6CD9V6rj/jIoezo+LS7jq+B+uPTjPmbg5GcsL9T8eN0QG0xamANal8g+jpWv2R3w5WeX/ZnxAoSBMUtJOSptFlDJUn47s4BL8E+njHM2KMzY3HEdhyjtE6Ik4Ky6hPEoAY= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org; spf=pass smtp.mailfrom=linaro.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b=JpNIye8o; arc=none smtp.client-ip=209.85.221.52 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linaro.org Received: by mail-wr1-f52.google.com with SMTP id ffacd0b85a97d-33b4e5ed890so71369f8f.2 for ; Thu, 08 Feb 2024 12:28:29 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1707424108; x=1708028908; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=mvrDBjoAHTErzMnmMJ2vCSaXAadIr1IUPSl1p95UmCk=; b=JpNIye8oaEv5dRHBkQ0KzR+ZlQcGFatiRd9h40BYERWchtULfs8AK8UujSyfJ5/ddd oHtuvPog+/z381chR1nGSXBjXWVumkUAot3QEliBlT/1bIFKT/DGqYS8/yyVT08Ay/B0 8nfyH8W10b/FRhpBzYlozPABJHZHRqzTFPyMKKbAZqw4k2RHK8+wNEXLm/gODRisRpGN AZy9LjEr62V6uWFD8O83P7TwPGfcY5OvOFJ9jGDUfusMtXToGmESjj8nXWMw+Lrh6Gj7 1ptyKjC8lULdUk8wH3AltYGp1OnJZ49U63kXanYeMX9YieaFW/nyG6OsWWn4cE9rlAHv eVDA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1707424108; x=1708028908; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=mvrDBjoAHTErzMnmMJ2vCSaXAadIr1IUPSl1p95UmCk=; b=DPQhiTvhsbxIyV/okFfLA6a11Gx7JxEhyC6EJDHoWjyMb4PxI+ZlhrwFTvUbYaUnmR WDL8+mMUMgmDXux/VvhRAXwXj2kvteYnL13IbMtdkBB6NW2DJmJYMJPRC7VLV2LpVA82 kTIwdByxkX0Rx5fl408zWB5RlpFf3XxQTKGNgaCOTrUv62UIHN2CrwUQICwbnwbULxuc YwXpqSJ6Q4z7gHNVEd2rTfhbbpPQn1eFiRirdqMmyiX0Z3Y2vSFi/Bpl5NxxswYIjPug QH2EoH5D9RgCSTHo8Vn0AD5v4M+pq4IDRY8OO5nX0V7vq7Q5Zkw45IcNOAufXH122g5B BOjA== X-Gm-Message-State: AOJu0YzPf7tH2BePsCELNRyrnEnF/n1K5EyNVdlB/Tp3GrkfONd7lKom 9zo0xtKyf6Omgn+hSYbFx2l8qTFvA72KUIHEQH6TsdiM5ctc1N/CvXeyGTYyiPY= X-Received: by 2002:adf:f88a:0:b0:33b:31f2:a957 with SMTP id u10-20020adff88a000000b0033b31f2a957mr381750wrp.21.1707424108366; Thu, 08 Feb 2024 12:28:28 -0800 (PST) X-Forwarded-Encrypted: i=1; AJvYcCUx2uTQ78/pzHPc0j0QINI8jebXKW5zA5HCUTsogwb5SVs+jPbq/h4F0k0suZBl8miv+iULjTLbEYP0SHNQiIb3+2QjFCpybqsCL9H161P+cxVAN/2XAUkSH/jcfEdv9xUdbZwlPbuShN09ouABAL3KAzh/U4oVWfOwQsqH9sELFB2yFboOhq/pdmExlOhJZFi3tdH/UZX6CH4cztvIgFd0dxayQZEg/8pvEQ1Zaer9v6pF6IfMZCn8adfzOf9lJ6mRDmYR4bg0KPs31OQI5lerl4BRMVJzM/HSHcYyvb7t43YeRgicapbmvVcW/8QYh8ZQtJteAbMK7aB/O2/+4XGOdiaWe0OfNff6oC+/hqIKCAwjNL91J4weQEqlvKleXUIh++GTvgC27iC43XBln08d5hodt7xOf8VfsJ44IZxnneGqVa5a//ei00fAN09vuCFrkloVJ0PpCr+Jq8ZMvBNXOKo9+DcVpdMiHGPsuLo0UAyTlrtCf0qHxdIM9qPlNJHWcykERRVqnK5cJEzbF/9/mymAMIMEiw5PNGr6v7DqQA== Received: from krzk-bin.. ([178.197.222.62]) by smtp.gmail.com with ESMTPSA id r16-20020adfce90000000b0033b47ee01f1sm114643wrn.49.2024.02.08.12.28.26 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 08 Feb 2024 12:28:28 -0800 (PST) From: Krzysztof Kozlowski To: Ulf Hansson , Shawn Guo , Sascha Hauer , Pengutronix Kernel Team , Fabio Estevam , NXP Linux Team , Thierry Reding , Jonathan Hunter , Nishanth Menon , Tero Kristo , Santosh Shilimkar , Michal Simek , "Rafael J. Wysocki" , linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-tegra@vger.kernel.org Cc: Krzysztof Kozlowski Subject: [PATCH 2/2] pmdomain: constify of_phandle_args in add device and subdomain Date: Thu, 8 Feb 2024 21:28:22 +0100 Message-Id: <20240208202822.631449-2-krzysztof.kozlowski@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240208202822.631449-1-krzysztof.kozlowski@linaro.org> References: <20240208202822.631449-1-krzysztof.kozlowski@linaro.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1790364494069134181 X-GMAIL-MSGID: 1790364494069134181 Pointer to of_phandle_args is not modified by of_genpd_add_device() and of_genpd_add_subdomain(), so it can be made pointer to const for code safety and readability. Signed-off-by: Krzysztof Kozlowski --- drivers/pmdomain/core.c | 12 ++++++------ include/linux/pm_domain.h | 20 ++++++++++---------- 2 files changed, 16 insertions(+), 16 deletions(-) diff --git a/drivers/pmdomain/core.c b/drivers/pmdomain/core.c index ea4b29475206..4215ffd9b11c 100644 --- a/drivers/pmdomain/core.c +++ b/drivers/pmdomain/core.c @@ -2526,7 +2526,7 @@ EXPORT_SYMBOL_GPL(of_genpd_del_provider); * on failure. */ static struct generic_pm_domain *genpd_get_from_provider( - struct of_phandle_args *genpdspec) + const struct of_phandle_args *genpdspec) { struct generic_pm_domain *genpd = ERR_PTR(-ENOENT); struct of_genpd_provider *provider; @@ -2557,7 +2557,7 @@ static struct generic_pm_domain *genpd_get_from_provider( * Looks-up an I/O PM domain based upon phandle args provided and adds * the device to the PM domain. Returns a negative error code on failure. */ -int of_genpd_add_device(struct of_phandle_args *genpdspec, struct device *dev) +int of_genpd_add_device(const struct of_phandle_args *genpdspec, struct device *dev) { struct generic_pm_domain *genpd; int ret; @@ -2591,8 +2591,8 @@ EXPORT_SYMBOL_GPL(of_genpd_add_device); * provided and adds the subdomain to the parent PM domain. Returns a * negative error code on failure. */ -int of_genpd_add_subdomain(struct of_phandle_args *parent_spec, - struct of_phandle_args *subdomain_spec) +int of_genpd_add_subdomain(const struct of_phandle_args *parent_spec, + const struct of_phandle_args *subdomain_spec) { struct generic_pm_domain *parent, *subdomain; int ret; @@ -2629,8 +2629,8 @@ EXPORT_SYMBOL_GPL(of_genpd_add_subdomain); * provided and removes the subdomain from the parent PM domain. Returns a * negative error code on failure. */ -int of_genpd_remove_subdomain(struct of_phandle_args *parent_spec, - struct of_phandle_args *subdomain_spec) +int of_genpd_remove_subdomain(const struct of_phandle_args *parent_spec, + const struct of_phandle_args *subdomain_spec) { struct generic_pm_domain *parent, *subdomain; int ret; diff --git a/include/linux/pm_domain.h b/include/linux/pm_domain.h index 1a391ef1b6f8..772d3280d35f 100644 --- a/include/linux/pm_domain.h +++ b/include/linux/pm_domain.h @@ -364,11 +364,11 @@ int of_genpd_add_provider_simple(struct device_node *np, int of_genpd_add_provider_onecell(struct device_node *np, struct genpd_onecell_data *data); void of_genpd_del_provider(struct device_node *np); -int of_genpd_add_device(struct of_phandle_args *args, struct device *dev); -int of_genpd_add_subdomain(struct of_phandle_args *parent_spec, - struct of_phandle_args *subdomain_spec); -int of_genpd_remove_subdomain(struct of_phandle_args *parent_spec, - struct of_phandle_args *subdomain_spec); +int of_genpd_add_device(const struct of_phandle_args *args, struct device *dev); +int of_genpd_add_subdomain(const struct of_phandle_args *parent_spec, + const struct of_phandle_args *subdomain_spec); +int of_genpd_remove_subdomain(const struct of_phandle_args *parent_spec, + const struct of_phandle_args *subdomain_spec); struct generic_pm_domain *of_genpd_remove_last(struct device_node *np); int of_genpd_parse_idle_states(struct device_node *dn, struct genpd_power_state **states, int *n); @@ -393,20 +393,20 @@ static inline int of_genpd_add_provider_onecell(struct device_node *np, static inline void of_genpd_del_provider(struct device_node *np) {} -static inline int of_genpd_add_device(struct of_phandle_args *args, +static inline int of_genpd_add_device(const struct of_phandle_args *args, struct device *dev) { return -ENODEV; } -static inline int of_genpd_add_subdomain(struct of_phandle_args *parent_spec, - struct of_phandle_args *subdomain_spec) +static inline int of_genpd_add_subdomain(const struct of_phandle_args *parent_spec, + const struct of_phandle_args *subdomain_spec) { return -ENODEV; } -static inline int of_genpd_remove_subdomain(struct of_phandle_args *parent_spec, - struct of_phandle_args *subdomain_spec) +static inline int of_genpd_remove_subdomain(const struct of_phandle_args *parent_spec, + const struct of_phandle_args *subdomain_spec) { return -ENODEV; }