From patchwork Mon Sep 9 13:51:12 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Krzysztof Kozlowski X-Patchwork-Id: 13797162 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 1240EECE57A for ; Mon, 9 Sep 2024 14:15:18 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Cc:To:In-Reply-To:References :Message-Id:Content-Transfer-Encoding:Content-Type:MIME-Version:Subject:Date: From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=V74UlEO/iR2Z+cYu5ZNF8RMi5oBAw+IToxt2LjZmjGY=; b=clfUI1HsZCIs70p5xmZ7NThIY2 VFCZAfrTSrjsmcywmgh1PpTJvvFHt0O6sQ+OClEF7JIjoocEphSBcCLbiTWmHZuocirEidFo9gobM v4REq6kn96jXoUAJI83h+usUWXwYPcgDFBmWQWONRpAfakH0leWwaK8kkt0YQ76JF7qdHztfgHfai vWtTzsU+RH6+8jjLL5LodMOPmjgVKs0YVl6EfIORX8ohvmfxi0wOQpvUBAjjSi8gDHfYmLeJ3BrUr tje/hIPCmDp+x/hRSzq4LmffV8IQe/JyXmDxIAVRD22itVZCNWuH2p6A4g1gu6ECq2GFOra5N7plf 5fCoE0tg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1snfAb-00000002ETW-1scr; Mon, 09 Sep 2024 14:15:09 +0000 Received: from mail-ed1-x52d.google.com ([2a00:1450:4864:20::52d]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1snent-000000028Wm-36qG for linux-arm-kernel@lists.infradead.org; Mon, 09 Sep 2024 13:51:43 +0000 Received: by mail-ed1-x52d.google.com with SMTP id 4fb4d7f45d1cf-5c2509f4143so471310a12.0 for ; Mon, 09 Sep 2024 06:51:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1725889900; x=1726494700; darn=lists.infradead.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=V74UlEO/iR2Z+cYu5ZNF8RMi5oBAw+IToxt2LjZmjGY=; b=PkNaXqLkxujlMbLcSnHpkNYsmCualUxbdABMvzuBR65VIQWqRMyjPy8/tiyw70Smzo 2OxfGAJXegIN77EAvp9uGg8EI8m9pKPkmIqXzcaFhQlU4W9jEKCLUtQk9GNIxjIx7tDZ PV3NyP1MTzaxuTyuQuZa93vneL0tI+zfQ+mcMBVti0wjCyhpAJVhe8kj8BkEgAX/5hxv dvzMD3Zb+LbbSRDsSjxJohqKZBE558Zk9B+9cVkxb51OTqm4IURNbh/B1Mweas3AkrNp VKnKlubcevLZqVmbYQ2eM2CmFBD+F+2TigLfDEUPaDk8Ia5rCQROnuNkm0rYxjPgGhGn 1fNg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1725889900; x=1726494700; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=V74UlEO/iR2Z+cYu5ZNF8RMi5oBAw+IToxt2LjZmjGY=; b=CsIHQbaSV9reYK6jBbpjJwnwd7CjxitS0b7iamIDwtmlh27bhmWwTzaY8Fq4m7FLOn 1C09K9r4dATCIt4W5dsa2id+oEX+ehQnqP8X+Ke0vIpLavwt0GsQQpdQLnW2AnhkxNW/ Njr3GRtPf55xt78/Nc2aBSXyXOA9yYZycQGR6BQ6ZlIIL26ya2M/b23YlXKO3GiGHvc6 5MHcnDHXa1/V+KBVC0VImrvSaiFi52ytVVUmB+lRYy/p0wF4OxcF0TSvsVULE2K7HJP5 o1spAbWcqWzZi993t22fwhA8Ee2Z3LgTW/SCu3nm/Kx2NYX/LhCR7DoL6oNE70T/BswQ tArw== X-Forwarded-Encrypted: i=1; AJvYcCUWiDuJdwAFeEK/70/5EwWxQIceKKHaR/yaV1p4eYVGkN+yCvzmfGLfHmWjqMZmBG3sz6HmZN54sTj/ymsTyCwc@lists.infradead.org X-Gm-Message-State: AOJu0YxQApi+iI6W1ZDfYmG0s//R3kA01+6ORNrmdIZ5nxjlqdHmpTO4 +HWExwAjxgqVeXQYEQsuvNdXJfmn3iZxgPvGZPDwTFYlonLw1ntFKsQxue225Eo= X-Google-Smtp-Source: AGHT+IEvFrbQZvkEd16b+cebKNNqLJEpYUuxolVRkSwJ8SAfHDa79KyoDYaIwBLAfAfowNG3uPOfjQ== X-Received: by 2002:a17:906:f5aa:b0:a8d:2624:1a83 with SMTP id a640c23a62f3a-a8d2624256emr211069766b.14.1725889898953; Mon, 09 Sep 2024 06:51:38 -0700 (PDT) Received: from [127.0.1.1] ([178.197.222.82]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-a8d25cf3ad6sm345344566b.148.2024.09.09.06.51.37 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 09 Sep 2024 06:51:38 -0700 (PDT) From: Krzysztof Kozlowski Date: Mon, 09 Sep 2024 15:51:12 +0200 Subject: [PATCH 01/17] regulator: da9052: Constify static data MIME-Version: 1.0 Message-Id: <20240909-regulator-const-v1-1-8934704a5787@linaro.org> References: <20240909-regulator-const-v1-0-8934704a5787@linaro.org> In-Reply-To: <20240909-regulator-const-v1-0-8934704a5787@linaro.org> To: Support Opensource , Liam Girdwood , Mark Brown , Matthias Brugger , AngeloGioacchino Del Regno , Bartosz Golaszewski Cc: linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org, linux-arm-msm@vger.kernel.org, Krzysztof Kozlowski X-Mailer: b4 0.14.1 X-Developer-Signature: v=1; a=openpgp-sha256; l=3897; i=krzysztof.kozlowski@linaro.org; h=from:subject:message-id; bh=8TsG7I4Aag1KJIfppBSqZ8uVGEQPJnXHOI9sdDJkZWs=; b=owEBbQKS/ZANAwAKAcE3ZuaGi4PXAcsmYgBm3v1ZDiVz4RaFZ9OBGUmyELamJcU43wcaBdMnp 7IbKy42NI+JAjMEAAEKAB0WIQTd0mIoPREbIztuuKjBN2bmhouD1wUCZt79WQAKCRDBN2bmhouD 1yUaD/4uEeY8qieO9UVWcfXUAM+yl+Ah/eISeRWtTgnULmCJznpSj1re/9hypLugcAre2+xitID Tq8ncG/lwdIQRCidg0yWXhmYTBM0IBnVwqPdTTS5aawbalrzDgmhH7kOl7hnmK3NwAjYipICwVc Yf1S5t0yj3dvSYPe8m4cScsFw8Yr1F1xjyMhMZefDWSgOwAUSlhI60QMpc33YtRegPIiWFTquuA bwzd3/+R94rpat8S/FDs0drkfSVcnGk2Ex9sYsd1gv5/koShUW2LT2su58Pxk74uJdEVNfF63CB i1q+bSTWMacll2wHjWYP2BupjluZtzu+6SHjjvn77ba1cexeY+yc3f4P0IGFhcU5IyrxaXGUhrj aTOaasOe3DZVrqd1B9iMU4B7FfCjA5QYSKNtTRqFEVhj19/BLtpp8IZj+lLCikhk82YTEynAF71 9oh66ez1QhjOsm6PiIee6uzFOMVQjdzOAzcMO1riGr2NltOGAgFULtIAVkZ7zP1rOUV5EYq8Qm2 Vdwqhs8uM8Q81U+AwEozboyxkthdl79nY6dwR2ANzIomtERLiQH3owdNeOjdXK7nlkbajN5TrRf Ott2t9N1PMbBZd1t6MISLvamkah9kJWWx7VCEEjtsC7VXLrMdaCBLyi9BlpEOczRz1Hmnqdr+I7 MqltipNYXK0CDcA== X-Developer-Key: i=krzysztof.kozlowski@linaro.org; a=openpgp; fpr=9BD07E0E0C51F8D59677B7541B93437D3B41629B X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240909_065141_862238_A434AB97 X-CRM114-Status: GOOD ( 15.84 ) 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 Driver does not modify static data with regulators description (struct da9052_regulator_info), so make it const for code safety. Signed-off-by: Krzysztof Kozlowski --- drivers/regulator/da9052-regulator.c | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/drivers/regulator/da9052-regulator.c b/drivers/regulator/da9052-regulator.c index ab6f5d61b173..fbebe538a648 100644 --- a/drivers/regulator/da9052-regulator.c +++ b/drivers/regulator/da9052-regulator.c @@ -67,11 +67,11 @@ struct da9052_regulator_info { struct da9052_regulator { struct da9052 *da9052; - struct da9052_regulator_info *info; + const struct da9052_regulator_info *info; struct regulator_dev *rdev; }; -static int verify_range(struct da9052_regulator_info *info, +static int verify_range(const struct da9052_regulator_info *info, int min_uV, int max_uV) { if (min_uV > info->max_uV || max_uV < info->min_uV) @@ -151,7 +151,7 @@ static int da9052_list_voltage(struct regulator_dev *rdev, unsigned int selector) { struct da9052_regulator *regulator = rdev_get_drvdata(rdev); - struct da9052_regulator_info *info = regulator->info; + const struct da9052_regulator_info *info = regulator->info; int id = rdev_get_id(rdev); int volt_uV; @@ -175,7 +175,7 @@ static int da9052_map_voltage(struct regulator_dev *rdev, int min_uV, int max_uV) { struct da9052_regulator *regulator = rdev_get_drvdata(rdev); - struct da9052_regulator_info *info = regulator->info; + const struct da9052_regulator_info *info = regulator->info; int id = rdev_get_id(rdev); int ret, sel; @@ -206,7 +206,7 @@ static int da9052_regulator_set_voltage_sel(struct regulator_dev *rdev, unsigned int selector) { struct da9052_regulator *regulator = rdev_get_drvdata(rdev); - struct da9052_regulator_info *info = regulator->info; + const struct da9052_regulator_info *info = regulator->info; int id = rdev_get_id(rdev); int ret; @@ -237,7 +237,7 @@ static int da9052_regulator_set_voltage_time_sel(struct regulator_dev *rdev, unsigned int new_sel) { struct da9052_regulator *regulator = rdev_get_drvdata(rdev); - struct da9052_regulator_info *info = regulator->info; + const struct da9052_regulator_info *info = regulator->info; int id = rdev_get_id(rdev); int ret = 0; @@ -327,7 +327,7 @@ static const struct regulator_ops da9052_ldo_ops = { .activate_bit = (abits),\ } -static struct da9052_regulator_info da9052_regulator_info[] = { +static const struct da9052_regulator_info da9052_regulator_info[] = { DA9052_DCDC(BUCK1, buck1, 25, 500, 2075, 6, 6, DA9052_SUPPLY_VBCOREGO), DA9052_DCDC(BUCK2, buck2, 25, 500, 2075, 6, 6, DA9052_SUPPLY_VBPROGO), DA9052_DCDC(BUCK3, buck3, 25, 950, 2525, 6, 6, DA9052_SUPPLY_VBMEMGO), @@ -344,7 +344,7 @@ static struct da9052_regulator_info da9052_regulator_info[] = { DA9052_LDO(LDO10, ldo10, 50, 1200, 3600, 6, 6, 0), }; -static struct da9052_regulator_info da9053_regulator_info[] = { +static const struct da9052_regulator_info da9053_regulator_info[] = { DA9052_DCDC(BUCK1, buck1, 25, 500, 2075, 6, 6, DA9052_SUPPLY_VBCOREGO), DA9052_DCDC(BUCK2, buck2, 25, 500, 2075, 6, 6, DA9052_SUPPLY_VBPROGO), DA9052_DCDC(BUCK3, buck3, 25, 950, 2525, 6, 6, DA9052_SUPPLY_VBMEMGO), @@ -361,10 +361,10 @@ static struct da9052_regulator_info da9053_regulator_info[] = { DA9052_LDO(LDO10, ldo10, 50, 1200, 3600, 6, 6, 0), }; -static inline struct da9052_regulator_info *find_regulator_info(u8 chip_id, - int id) +static inline const struct da9052_regulator_info *find_regulator_info(u8 chip_id, + int id) { - struct da9052_regulator_info *info; + const struct da9052_regulator_info *info; int i; switch (chip_id) { From patchwork Mon Sep 9 13:51:13 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Krzysztof Kozlowski X-Patchwork-Id: 13797161 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 833C1ECE579 for ; Mon, 9 Sep 2024 14:12:19 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Cc:To:In-Reply-To:References :Message-Id:Content-Transfer-Encoding:Content-Type:MIME-Version:Subject:Date: From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=gWUZynZie/tnte+8abYpr8R+Igo3OliRTpchdOYI/bM=; b=yUslfIPCEM7KBtV89ncV1jToQp syvN+poi4icMoWk44n421PJdXwMht8Mh7BHaf5lhcl6scaZ35Lw32aYeG4H3pdXq3FMMKa5MpnjJ5 /ycNOwAXgweZnw2WTY66H0/blkFo6nIELKGFQ9PWqkZrn1122lZHvwvHNl3XrpF8cNGhiDiQiWsXI F99fbX5faAHuF3H9SNt3g4nyyWNakZO8vaypiJ4HXuHXX/PjTI4MbXRxG37UGDCoHZqZOYvdRmr9O 7627yk43fTNjT78ZlO8YedyhgCBu5CCOW/sVaujQhydY5JHHq/bViDQO22HVxtbpXzeB9FEV2wtcb Ir+5YDcg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1snf7g-00000002Dr7-2YPv; Mon, 09 Sep 2024 14:12:08 +0000 Received: from mail-ej1-x635.google.com ([2a00:1450:4864:20::635]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1snenu-000000028X9-1wuJ for linux-arm-kernel@lists.infradead.org; Mon, 09 Sep 2024 13:51:44 +0000 Received: by mail-ej1-x635.google.com with SMTP id a640c23a62f3a-a8a7dddd2bdso18411766b.2 for ; Mon, 09 Sep 2024 06:51:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1725889901; x=1726494701; darn=lists.infradead.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=gWUZynZie/tnte+8abYpr8R+Igo3OliRTpchdOYI/bM=; b=Yn7krBNxDyzu0lSDhsAqAhn5cDdu0EcFgHLCbpWr4nj4QSOO2jl/LOIE24gJkZGgAD woJaMxuh8hCvm3hz1MtmC6lkOR3V/BglCDvsd5p6c2+XodB9/BberKc5c/6d7sXvRkNu HjNpGre4aMCG+6SDTe+NdDDy7Aan65zgY9Jy8S0k2j8n8c8MdC0/MRMCg2N7114U5Jq7 TpDxqtfE9MuS0evIPJwk62uhYz4ZSCK6gstym6NJK337NRd2gs+suF+/NK5Z72/Mr095 tseuctvCrHFT4zsWsPC9p9ewBWyz5Z18tZfV+/f8SZwNV5p8INN62+Sbn+Utu0yHzww4 uOcA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1725889901; x=1726494701; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=gWUZynZie/tnte+8abYpr8R+Igo3OliRTpchdOYI/bM=; b=LM6Lxdj+1j1Ivi0egVzMIAhLZNiMCzVyAjUCvi2JakEwhmWKvveQoNRVQs5V/C/R66 mWFFTAi+JRe7QGuX1Rb5SzUJR16gDVQtcl8iGtDhr7r83a2CscJE3yarfTAbgso5DQXL Ml+X5OPiekEJZ7LoYx/cgz3Btkv/F56UGlfaN7ob3Z6W6mwIrxJaYsHlxqX8H9+I+rqu 9eNhJv/aSUeIQ8U7MotEFZ10VTnftKi1fRGodAxDYamTM/u4mjyTfeEfPr2Ucsd6WJVS 9/YMrTNieVGEKAWcKgrjaom+wlIPJSR9+ZRgoNtroIIMWRMS8PCeTdyHA85hkYynLCwl nWQQ== X-Forwarded-Encrypted: i=1; AJvYcCXIdXu/I+qGWxPEPbqNuTDr2cPcYS2ZlorMu6zxkyMYAyU3+cYPWoPE51iGPRGBrsCnGOa7p/mvXm0Y78gEW8tW@lists.infradead.org X-Gm-Message-State: AOJu0YxffMumu4jShYC2hajLpZjexfcqDiIrbQObvCwC4HavK8GVFKnB amFtrjdslNg9QzUi3+amBCYaxoZ1+3FJVPBhukLOgVzRQoTqH8I6aRjY3W0xOwQ= X-Google-Smtp-Source: AGHT+IGolL3X79jf6IP489nGtxAGUdA8yh3dZboS2pdNZz9QxZiprwgkdAl5gVT7/E37l/eQxx6GtA== X-Received: by 2002:a17:907:da3:b0:a83:70d0:7a1e with SMTP id a640c23a62f3a-a8a888e61a0mr406825166b.9.1725889900964; Mon, 09 Sep 2024 06:51:40 -0700 (PDT) Received: from [127.0.1.1] ([178.197.222.82]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-a8d25cf3ad6sm345344566b.148.2024.09.09.06.51.39 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 09 Sep 2024 06:51:40 -0700 (PDT) From: Krzysztof Kozlowski Date: Mon, 09 Sep 2024 15:51:13 +0200 Subject: [PATCH 02/17] regulator: da9055: Constify static data MIME-Version: 1.0 Message-Id: <20240909-regulator-const-v1-2-8934704a5787@linaro.org> References: <20240909-regulator-const-v1-0-8934704a5787@linaro.org> In-Reply-To: <20240909-regulator-const-v1-0-8934704a5787@linaro.org> To: Support Opensource , Liam Girdwood , Mark Brown , Matthias Brugger , AngeloGioacchino Del Regno , Bartosz Golaszewski Cc: linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org, linux-arm-msm@vger.kernel.org, Krzysztof Kozlowski X-Mailer: b4 0.14.1 X-Developer-Signature: v=1; a=openpgp-sha256; l=5542; i=krzysztof.kozlowski@linaro.org; h=from:subject:message-id; bh=7T+l2SN6pqbE6hOx06iBBg4xZdBmuecLOUZCOIFvMyE=; b=owEBbQKS/ZANAwAKAcE3ZuaGi4PXAcsmYgBm3v1a58opF52+48fMopZc5Ie9MgwbFtabVspDx XEDU3SMO8GJAjMEAAEKAB0WIQTd0mIoPREbIztuuKjBN2bmhouD1wUCZt79WgAKCRDBN2bmhouD 10RTD/0R3aEMOqjsaXdiCVQWplC8EpgbLj8ZanFKI2VfbsehBl68HKT/D98YBx6czQKoVB2yrlW PYvASCaQUm5YWQWux7cw+yXpnbq7LVSD6eNjRVw/q6tmWdrstD+Qn7t4HN1ktZzo4oBK7rlvLMc x3mtMz9FRaTzTH5Nazadk42WBjKw7mxTr7QMxR442nCi5/HyqlGDYagpIJNG+XYLQbo1iVKmoDG 6Zu3wrt2pSFqWk18Hy3ShRYELnzjdFhiSB1RnGaByDwQxBdg+u445qBb0su71+1+Bmpl9rk/jkv 8hTlPMk4mSpkaGLWV2CNJ7MhjGvhJTL7pqhlkp43GHePiUHF+W6FVUjupqQueyG7j9xL7FNAv5I ZnioNWLnhS0coGeh1Bgp9zHoRR7yCcHX60En5L5lup9oBDNW6vF6HWQacApjh8sf8cz/QCGzE7x 9wfWe3KsjQaYpjDKD37c1cjI6nF4TMPL9LyQptdgS0aIV+OxuW29I3DaXtVANuU4FZtuM8iY1V1 Y8pmzsl+sjIGQoE9cOvo30Y6+9j/nBeVgPRRvzpfxAEnPQPCNBZJb43aa8IRZF95de7aeqSeppV rL2WZ13ht2jGqi8aKSJYLtaWv7WdHrP8TDes+0K/pPUhR8b7Rve8G/CRjwFQGxWWB1WKgA8ERYB BHYCyhf+ywSoirw== X-Developer-Key: i=krzysztof.kozlowski@linaro.org; a=openpgp; fpr=9BD07E0E0C51F8D59677B7541B93437D3B41629B X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240909_065142_609224_A195F5E9 X-CRM114-Status: GOOD ( 16.21 ) 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 Driver does not modify static data with regulators description (struct da9055_regulator_info), so make it const for code safety. Signed-off-by: Krzysztof Kozlowski --- drivers/regulator/da9055-regulator.c | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/drivers/regulator/da9055-regulator.c b/drivers/regulator/da9055-regulator.c index 352547c375bd..a0d3414aa79e 100644 --- a/drivers/regulator/da9055-regulator.c +++ b/drivers/regulator/da9055-regulator.c @@ -73,7 +73,7 @@ struct da9055_regulator_info { struct da9055_regulator { struct da9055 *da9055; - struct da9055_regulator_info *info; + const struct da9055_regulator_info *info; struct regulator_dev *rdev; enum gpio_select reg_rselect; }; @@ -81,7 +81,7 @@ struct da9055_regulator { static unsigned int da9055_buck_get_mode(struct regulator_dev *rdev) { struct da9055_regulator *regulator = rdev_get_drvdata(rdev); - struct da9055_regulator_info *info = regulator->info; + const struct da9055_regulator_info *info = regulator->info; int ret, mode = 0; ret = da9055_reg_read(regulator->da9055, info->mode.reg); @@ -107,7 +107,7 @@ static int da9055_buck_set_mode(struct regulator_dev *rdev, unsigned int mode) { struct da9055_regulator *regulator = rdev_get_drvdata(rdev); - struct da9055_regulator_info *info = regulator->info; + const struct da9055_regulator_info *info = regulator->info; int val = 0; switch (mode) { @@ -129,7 +129,7 @@ static int da9055_buck_set_mode(struct regulator_dev *rdev, static unsigned int da9055_ldo_get_mode(struct regulator_dev *rdev) { struct da9055_regulator *regulator = rdev_get_drvdata(rdev); - struct da9055_regulator_info *info = regulator->info; + const struct da9055_regulator_info *info = regulator->info; int ret; ret = da9055_reg_read(regulator->da9055, info->volt.reg_b); @@ -145,7 +145,7 @@ static unsigned int da9055_ldo_get_mode(struct regulator_dev *rdev) static int da9055_ldo_set_mode(struct regulator_dev *rdev, unsigned int mode) { struct da9055_regulator *regulator = rdev_get_drvdata(rdev); - struct da9055_regulator_info *info = regulator->info; + const struct da9055_regulator_info *info = regulator->info; struct da9055_volt_reg volt = info->volt; int val = 0; @@ -167,7 +167,7 @@ static int da9055_ldo_set_mode(struct regulator_dev *rdev, unsigned int mode) static int da9055_regulator_get_voltage_sel(struct regulator_dev *rdev) { struct da9055_regulator *regulator = rdev_get_drvdata(rdev); - struct da9055_regulator_info *info = regulator->info; + const struct da9055_regulator_info *info = regulator->info; struct da9055_volt_reg volt = info->volt; int ret, sel; @@ -199,7 +199,7 @@ static int da9055_regulator_set_voltage_sel(struct regulator_dev *rdev, unsigned int selector) { struct da9055_regulator *regulator = rdev_get_drvdata(rdev); - struct da9055_regulator_info *info = regulator->info; + const struct da9055_regulator_info *info = regulator->info; int ret; /* @@ -242,7 +242,7 @@ static int da9055_regulator_set_suspend_voltage(struct regulator_dev *rdev, int uV) { struct da9055_regulator *regulator = rdev_get_drvdata(rdev); - struct da9055_regulator_info *info = regulator->info; + const struct da9055_regulator_info *info = regulator->info; int ret; /* Select register set B for suspend voltage ramping. */ @@ -264,7 +264,7 @@ static int da9055_regulator_set_suspend_voltage(struct regulator_dev *rdev, static int da9055_suspend_enable(struct regulator_dev *rdev) { struct da9055_regulator *regulator = rdev_get_drvdata(rdev); - struct da9055_regulator_info *info = regulator->info; + const struct da9055_regulator_info *info = regulator->info; /* Select register set B for voltage ramping. */ if (regulator->reg_rselect == NO_GPIO) @@ -277,7 +277,7 @@ static int da9055_suspend_enable(struct regulator_dev *rdev) static int da9055_suspend_disable(struct regulator_dev *rdev) { struct da9055_regulator *regulator = rdev_get_drvdata(rdev); - struct da9055_regulator_info *info = regulator->info; + const struct da9055_regulator_info *info = regulator->info; /* Diselect register set B. */ if (regulator->reg_rselect == NO_GPIO) @@ -396,7 +396,7 @@ static const struct regulator_ops da9055_ldo_ops = { },\ } -static struct da9055_regulator_info da9055_regulator_info[] = { +static const struct da9055_regulator_info da9055_regulator_info[] = { DA9055_BUCK(BUCK1, 25, 725, 2075, 6, 9, 0xc, 2), DA9055_BUCK(BUCK2, 25, 925, 2500, 6, 0, 3, 0), DA9055_LDO(LDO1, 50, 900, 3300, 6, 2), @@ -417,7 +417,7 @@ static int da9055_gpio_init(struct device *dev, struct regulator_config *config, struct da9055_pdata *pdata, int id) { - struct da9055_regulator_info *info = regulator->info; + const struct da9055_regulator_info *info = regulator->info; struct gpio_desc *ren; struct gpio_desc *ena; struct gpio_desc *rsel; @@ -491,9 +491,9 @@ static irqreturn_t da9055_ldo5_6_oc_irq(int irq, void *data) return IRQ_HANDLED; } -static inline struct da9055_regulator_info *find_regulator_info(int id) +static inline const struct da9055_regulator_info *find_regulator_info(int id) { - struct da9055_regulator_info *info; + const struct da9055_regulator_info *info; int i; for (i = 0; i < ARRAY_SIZE(da9055_regulator_info); i++) { From patchwork Mon Sep 9 13:51:14 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Krzysztof Kozlowski X-Patchwork-Id: 13797113 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 94039ECE579 for ; Mon, 9 Sep 2024 13:55:24 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Cc:To:In-Reply-To:References :Message-Id:Content-Transfer-Encoding:Content-Type:MIME-Version:Subject:Date: From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=UF9bSlgTrHZXU2jrr9w6XSPWJzUj9rf6ysrOlqPBLlQ=; b=tOpADZqeoBmhN4D2VTzUvXBo8r HKqOkUhiAGWAJoj9p48IB4OUV0rXnCrelbK8IyiT/nR9Zpz+hoWPhSbxlo6hIBrlzkCPk+QIlcuX1 sVekeh90xQ1H6pUegtBykSTCBuM7lgx6XDgaWM8RUV0abH3QBoCEUBWzf5kqcR9++LaZDx1NrffoW 2Am72Hm4YqQyXlpIiBpNo/zHwGv1nb0jSoHEkNfHAP3Qi95/a3veUhUxrPauYmiZys6dkdENHiHd0 xYK6x8vaDhlf9i7NqHCL2/HLYjaHweTprHLuJiyMwF1dkO6Qborp1wZkTajdsw9s9VzrEuEBWIvhE 2XJiA3hw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1snerI-000000029fH-45rD; Mon, 09 Sep 2024 13:55:13 +0000 Received: from mail-ej1-x629.google.com ([2a00:1450:4864:20::629]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1snenw-000000028YZ-419H for linux-arm-kernel@lists.infradead.org; Mon, 09 Sep 2024 13:51:46 +0000 Received: by mail-ej1-x629.google.com with SMTP id a640c23a62f3a-a8d302b6b30so8519966b.0 for ; Mon, 09 Sep 2024 06:51:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1725889903; x=1726494703; darn=lists.infradead.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=UF9bSlgTrHZXU2jrr9w6XSPWJzUj9rf6ysrOlqPBLlQ=; b=lHCcRbtxSJBi+mZUpJsxo9mFP6EXRHJV9ApB08pBTDZ82E7860bfW02sWPOgSYbmF1 iyulh5BHNAhku1lIrzndGZe32iKvBJDxffJ0nL2fxt0/XLUS5LCNMTOJxHV0R1tO3ttL jTu17XFJXxwBBSG1Dp3Sx0WcosBPB8fz/QCs26KxXpfgvHXzDgmpnSzHJcWGtkKTB5Ph CPZHAiH6PCHu52WTgqrdK4P0nHQhGBbf68IeI+UHkrxIXn0cv8B6WoE+LozT9tz8Frsk kxM5ytXFVJTWQTfUVNLwUvoQcnEgckM43AjZmaW1a9phrwiEiTQW9+2qIEBL+q1q97fU cR/g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1725889903; x=1726494703; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=UF9bSlgTrHZXU2jrr9w6XSPWJzUj9rf6ysrOlqPBLlQ=; b=C9MWnYyjDg8ZT16MjOkMroAaGUa26hTjpnYB2I8AzbRPeDOxTnbDX8qieEk5NBymO5 jVyWOe40cvdPSHMHParl1+4vQrPsi//Z2HhMoyycrpZzgCAYcOEZtgMj68rkY4sl7oi1 x8/dfHNOtbaK/Nbh6iUFBFzMxnTMO2Vh0m6DvyXRvhd9JKFOBdFMUsSWy0ERtMt/M2q1 5p1UBFVgRJ5DCRWbgBsXW5QdbeNMc5CMjXv+n4qu6u7TuSjCZsEIdpia3SxyqOm1w+f1 qATHGwK1Us6etBEK5Gbe/ubf08YWlsFfmnkvnuR9ZUJnFR2f0pW0ZxDQNr37JBWBhJZ/ N9Cw== X-Forwarded-Encrypted: i=1; AJvYcCVVjsnFUMtYd+KSp45wO60Ju6dPIrPYz2iFlnM4Lx7J56+Hq5sOCSH8UErxdRQFT6ZJIHvj8/gNhpu8ZK5+9oq1@lists.infradead.org X-Gm-Message-State: AOJu0Yybiapis7fP8wR/hisIDEXW4WWhFbSLy+ComlHeInnq1DgkDRKD hsFekGGzg9lZS8QZcNwMUx4Ww1K87VXSPG9H6f4ORfadwfjtn1NEt/eIcoN/jwU= X-Google-Smtp-Source: AGHT+IGzPvI+dNamtmIacGvq6lHaBkBbNG8nqVfsI23RPlJzpDknyE6uAERdml0EtHCTzcwGG+S0Tw== X-Received: by 2002:a17:906:4789:b0:a7a:a3ad:6007 with SMTP id a640c23a62f3a-a8a888e03c9mr343909266b.8.1725889902504; Mon, 09 Sep 2024 06:51:42 -0700 (PDT) Received: from [127.0.1.1] ([178.197.222.82]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-a8d25cf3ad6sm345344566b.148.2024.09.09.06.51.41 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 09 Sep 2024 06:51:42 -0700 (PDT) From: Krzysztof Kozlowski Date: Mon, 09 Sep 2024 15:51:14 +0200 Subject: [PATCH 03/17] regulator: da9063: Constify static data MIME-Version: 1.0 Message-Id: <20240909-regulator-const-v1-3-8934704a5787@linaro.org> References: <20240909-regulator-const-v1-0-8934704a5787@linaro.org> In-Reply-To: <20240909-regulator-const-v1-0-8934704a5787@linaro.org> To: Support Opensource , Liam Girdwood , Mark Brown , Matthias Brugger , AngeloGioacchino Del Regno , Bartosz Golaszewski Cc: linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org, linux-arm-msm@vger.kernel.org, Krzysztof Kozlowski X-Mailer: b4 0.14.1 X-Developer-Signature: v=1; a=openpgp-sha256; l=911; i=krzysztof.kozlowski@linaro.org; h=from:subject:message-id; bh=cimxQ+TX+25hf08Y2OSBWqQRlO/c5kpOqNI/3js1eFk=; b=owEBbQKS/ZANAwAKAcE3ZuaGi4PXAcsmYgBm3v1aJDym6wmOtLH5Qt5LKDk2N02AojxWKhz4K 7VClE9YY1mJAjMEAAEKAB0WIQTd0mIoPREbIztuuKjBN2bmhouD1wUCZt79WgAKCRDBN2bmhouD 12+rEACRykGfztQAt5gbTMUTMyMn8xzuTgPdLneI0nYl5JLT+jE8VkvDxZUmTJ2z13t8uTC3sS6 D9bTzkZna1q7VwPTVYPz4XAqUSsY9/vStht6IJ8I2/V4LQgW4XoI9ZT4qF6g2jw8p7GmAd3yLVx sCxAXAcXG2wRZLDTJc+4eebjeJt5UiETDtn3kl7N0jPEnMUjtAKtDiyIvOKorktNw3zeNhoS5Qs BhmS+DVSniKZ91YA2Pkx1znNJW+jcDa5LZecJdiZN71cq/mLhvY8IocBaxs9fA1KLHOQXsXyEDc ZI6qtIb9uSSyuhUtFIlkUiCsmDucfrqqz4HD7fudjO7qs1hcqVPSEHt0oXIIHfJ8FznXbE/gAvl vvKdRnxXMS+kdFTdo/PvN8mw7sQZAM7JxrJ/v4/tKxz5sEyPLUfWIN8hMGb0wZbo+2+GioGiXYH h97DafFKcVZQaiDlk8Ad8YiT7OrxkuAb/FKyoDLaLyWUMYcjGle3LCDZCz1d0m8lO5qin6wUBHR 061ZU+JxWdGbU9cVoAJtaTlPfZQPaYxzhrMY8QqQQOLfZ8aAMN81CwMft0d4BDQvdH1r5T8334Z L94XDn9LI/rScybEhsQLmyWKku1AtA+JWCuJ/HOsXRm0mLo6PIDyGThxM39q2kJNo6bk1EzZ8Qc NsjeJtpj6cfgB5A== X-Developer-Key: i=krzysztof.kozlowski@linaro.org; a=openpgp; fpr=9BD07E0E0C51F8D59677B7541B93437D3B41629B X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240909_065145_085200_C68234AB X-CRM114-Status: GOOD ( 13.16 ) 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 Driver does not modify static data with device variant description (struct da9063_dev_model), so make it const for code safety. Signed-off-by: Krzysztof Kozlowski --- drivers/regulator/da9063-regulator.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/regulator/da9063-regulator.c b/drivers/regulator/da9063-regulator.c index 82bf321ae06f..4b5f1d6a4b3c 100644 --- a/drivers/regulator/da9063-regulator.c +++ b/drivers/regulator/da9063-regulator.c @@ -715,7 +715,7 @@ static const struct da9063_regulator_info da9063_regulator_info[] = { }; /* Link chip model with regulators info table */ -static struct da9063_dev_model regulators_models[] = { +static const struct da9063_dev_model regulators_models[] = { { .regulator_info = da9063_regulator_info, .n_regulators = ARRAY_SIZE(da9063_regulator_info), From patchwork Mon Sep 9 13:51:15 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Krzysztof Kozlowski X-Patchwork-Id: 13797114 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 B4E0DECE57A for ; Mon, 9 Sep 2024 13:56:22 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Cc:To:In-Reply-To:References :Message-Id:Content-Transfer-Encoding:Content-Type:MIME-Version:Subject:Date: From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=J5ubU/nIvmhUK+978Fu438bn7v+wIGW6OXK49tq6QXU=; b=B1ChHX75tophW8mEiV9g0R684V CDXARS3n3qH0EwxAuPeSNmnJCJ2+OgNi/gtGl5m3BJrWytZEERoEaeL7AeLHCKCNpOpZuUf9pYpjx wieenkkJSyV8B9thfN1k4LrIZz2MBP42xxoeNNPzU6unEQdUB7a8zDaxKfUpqZ/HRSm84DUYFs5yI d7McX45iRF41rk+A5jGrR9gyJIKKbPMkpF0LazFA2q7ZOv/+zlwDf1CkET27Twh2gargeVUx4AK+4 k6u2qIPxGcR2+DVrQYKLyyvdVkAccu6e/T32nwUgZaR10gAUKsdjwORu4ah5psptmvlRyPa9H0Dz/ UwFQ8jTw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1snesI-000000029vT-1ZRn; Mon, 09 Sep 2024 13:56:14 +0000 Received: from mail-ej1-x62a.google.com ([2a00:1450:4864:20::62a]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1snenx-000000028ZP-47Ru for linux-arm-kernel@lists.infradead.org; Mon, 09 Sep 2024 13:51:47 +0000 Received: by mail-ej1-x62a.google.com with SMTP id a640c23a62f3a-a8d302b6b30so8520466b.0 for ; Mon, 09 Sep 2024 06:51:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1725889904; x=1726494704; darn=lists.infradead.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=J5ubU/nIvmhUK+978Fu438bn7v+wIGW6OXK49tq6QXU=; b=zoNaJlO7r8DIUNIs8Vtsq83EHIk1slYL/0zn9CDxyGK2RjyTQ+w6aKWlYt4q4ZX0CK 5fgmSw0sbqlz5aqCUhPtL/tAYeqM/34nyomhFbEkJZrRGyaY1lLJ6YL1OcWBbRXLr+9+ REs2UUJ5ClD0ceCCAyqebjlhdilie3xKKZasJ5vwufJbeVKPAOU98ZnWcEkVDAifUt8E 0Nh003qN0lR4UtNWvLstcuBPKOI28n6anJSP9XkWkAloQYRbgDra+QTYzTxnlQrodUSZ 0SfHuPFw1x5J3LLPN/KMlxDHa+sWqC2E/0qqlcwu9jVVqKtF/OAFIFWetUqBGn8U4SJB 5CRg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1725889904; x=1726494704; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=J5ubU/nIvmhUK+978Fu438bn7v+wIGW6OXK49tq6QXU=; b=BtvKi1V8filAPXJma9gyEF+uqDG82jWGWN8cthU/m/M4J7QnNrG0mT8OjKBh4RxcTI eGvobGiCN+hCpIP8zzHYS82RKTE5aRHWbBasTSv4IOqbnO4BvpU23XPaIpbtW+2+8uMU c97wQXSpKIdVUI3vpMKVdH/EmGvdv7k/62JKx6SFvh5SbEwTZY3tK5krNkoi5tX/hvWI 2XRySCDyw3EdKTQoAUxKOmCoDQcgeNl3IDmMWuWS6fxYdWyFrY37rKwqWz/K8A3Pv16d G3hyXCVwQrP8KuQ9arH2ABAyg1dtLSOPH00LHGGBBZ45HCP3jItjysyuubgUf0LXSrqB Yiyw== X-Forwarded-Encrypted: i=1; AJvYcCX9RwDdfB6FMz+aqgqKYGwIXvQBcH1+J8KgLRngtFddRMmB6arwuKxX6ZW2a8xslIxEDosO4CvA0285OnPQSHLY@lists.infradead.org X-Gm-Message-State: AOJu0YzbyfIzUxJdQThSSxxxmE4LC1vv6DS2MJ2zOpW4sspl3Pr8us/+ wMDlA4wzRgsf3YlVGjuDQTr9AXdgH5bnBbGzclHtcZxP16TkGr4OhN6MQZ5r3fA= X-Google-Smtp-Source: AGHT+IEugSgsSV0xgb1AxjeRmN9gIBXYvzLHz3hHfeWqWgETWGq55T1TciET1HOvhecAnGFDnoDFNQ== X-Received: by 2002:a17:906:c151:b0:a86:a694:aaff with SMTP id a640c23a62f3a-a8a885c3502mr329789266b.1.1725889903950; Mon, 09 Sep 2024 06:51:43 -0700 (PDT) Received: from [127.0.1.1] ([178.197.222.82]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-a8d25cf3ad6sm345344566b.148.2024.09.09.06.51.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 09 Sep 2024 06:51:43 -0700 (PDT) From: Krzysztof Kozlowski Date: Mon, 09 Sep 2024 15:51:15 +0200 Subject: [PATCH 04/17] regulator: da9121: Constify static data MIME-Version: 1.0 Message-Id: <20240909-regulator-const-v1-4-8934704a5787@linaro.org> References: <20240909-regulator-const-v1-0-8934704a5787@linaro.org> In-Reply-To: <20240909-regulator-const-v1-0-8934704a5787@linaro.org> To: Support Opensource , Liam Girdwood , Mark Brown , Matthias Brugger , AngeloGioacchino Del Regno , Bartosz Golaszewski Cc: linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org, linux-arm-msm@vger.kernel.org, Krzysztof Kozlowski X-Mailer: b4 0.14.1 X-Developer-Signature: v=1; a=openpgp-sha256; l=3601; i=krzysztof.kozlowski@linaro.org; h=from:subject:message-id; bh=NpUoubZdNxPAP0/VQA+CguJJu4K+4PwUlJgiCI3BfEs=; b=owEBbQKS/ZANAwAKAcE3ZuaGi4PXAcsmYgBm3v1bGMGjRSX40m+jFUd3qXmQIrwJMipZzv7er WSu6zsXuOmJAjMEAAEKAB0WIQTd0mIoPREbIztuuKjBN2bmhouD1wUCZt79WwAKCRDBN2bmhouD 18ryD/wIt2dvPBpg6GfCuXTwI8ZHq/Xhw0UUKgiDvi6l0M1lAqmPdNe0fQPYFdpV7zloCImte9+ P1Rpg8oK5fB2xYfpH2YGpbqr1Uhp45D3NIXMWFiwAa7P73jVOxmn+pZE6+S75b0NBihnwBDjqv3 NL+/U8t1DkPGHOMx/S5pQEuto+kc7rPd1Cfw99rlH0l/lzWxFCcWQlABzlx1P4BLiiA0ao2ODqu b/ALGdnj/u5blpYURBGbHBgJ/eHqljdezVIzg9T1mrzgl5rOOrQIhrUWD4ipvwr5NEo/W0y4nsN luFsScVmEoJCcxj9Zm2tdwmc8QNWI7cZjM7r6NM6X/0vujLWQfb+C8O/RrZXkdMsRey99nU+XTZ siCy5IFha4lpKRaEUrjQ36PxSn2j6+NhxLSi98Ap2WmDA/tL4vEu+5aU8/Vik/zUhQVzQ56Y4kG JsRIM+M9H+zlrQqGWCgPeN+1Tr6T8r9aAmrQ6sqclP7XEYOZBglrDetgxW/lPldfEDwGHdDizXE cs6pOl6y6qIifPvAtZ0g2YecHTpN6UlRVS1nPSXvnVuF0kvICRhgHpvK3wfYnEHvv/fSEzP7qzF 2B8SBCizdJt1YFjLGsqVYGocM+c7PHZL+/nyoTU3nG99OO4KBmwJqaadqY8XKMT6J6IbL7aaDNx 6L2A2Di5T3Pdssg== X-Developer-Key: i=krzysztof.kozlowski@linaro.org; a=openpgp; fpr=9BD07E0E0C51F8D59677B7541B93437D3B41629B X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240909_065146_058662_CB91B4BE X-CRM114-Status: GOOD ( 13.88 ) 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 Driver does not modify static data with regulator description (struct da9121_range), so make it const for code safety. Signed-off-by: Krzysztof Kozlowski --- drivers/regulator/da9121-regulator.c | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/drivers/regulator/da9121-regulator.c b/drivers/regulator/da9121-regulator.c index 5524bd314f13..ef161eb0ca27 100644 --- a/drivers/regulator/da9121-regulator.c +++ b/drivers/regulator/da9121-regulator.c @@ -53,7 +53,7 @@ struct da9121_range { int reg_max; }; -static struct da9121_range da9121_10A_2phase_current = { +static const struct da9121_range da9121_10A_2phase_current = { .val_min = 7000000, .val_max = 20000000, .val_stp = 1000000, @@ -61,7 +61,7 @@ static struct da9121_range da9121_10A_2phase_current = { .reg_max = 14, }; -static struct da9121_range da9121_6A_2phase_current = { +static const struct da9121_range da9121_6A_2phase_current = { .val_min = 7000000, .val_max = 12000000, .val_stp = 1000000, @@ -69,7 +69,7 @@ static struct da9121_range da9121_6A_2phase_current = { .reg_max = 6, }; -static struct da9121_range da9121_5A_1phase_current = { +static const struct da9121_range da9121_5A_1phase_current = { .val_min = 3500000, .val_max = 10000000, .val_stp = 500000, @@ -77,7 +77,7 @@ static struct da9121_range da9121_5A_1phase_current = { .reg_max = 14, }; -static struct da9121_range da9121_3A_1phase_current = { +static const struct da9121_range da9121_3A_1phase_current = { .val_min = 3500000, .val_max = 6000000, .val_stp = 500000, @@ -85,7 +85,7 @@ static struct da9121_range da9121_3A_1phase_current = { .reg_max = 6, }; -static struct da9121_range da914x_40A_4phase_current = { +static const struct da9121_range da914x_40A_4phase_current = { .val_min = 26000000, .val_max = 78000000, .val_stp = 4000000, @@ -93,7 +93,7 @@ static struct da9121_range da914x_40A_4phase_current = { .reg_max = 14, }; -static struct da9121_range da914x_20A_2phase_current = { +static const struct da9121_range da914x_20A_2phase_current = { .val_min = 13000000, .val_max = 39000000, .val_stp = 2000000, @@ -104,7 +104,7 @@ static struct da9121_range da914x_20A_2phase_current = { struct da9121_variant_info { int num_bucks; int num_phases; - struct da9121_range *current_range; + const struct da9121_range *current_range; }; static const struct da9121_variant_info variant_parameters[] = { @@ -188,7 +188,7 @@ static int da9121_get_current_limit(struct regulator_dev *rdev) { struct da9121 *chip = rdev_get_drvdata(rdev); int id = rdev_get_id(rdev); - struct da9121_range *range = + const struct da9121_range *range = variant_parameters[chip->variant_id].current_range; unsigned int val = 0; int ret = 0; @@ -219,7 +219,7 @@ static int da9121_ceiling_selector(struct regulator_dev *rdev, unsigned int *selector) { struct da9121 *chip = rdev_get_drvdata(rdev); - struct da9121_range *range = + const struct da9121_range *range = variant_parameters[chip->variant_id].current_range; unsigned int level; unsigned int i = 0; @@ -259,7 +259,7 @@ static int da9121_set_current_limit(struct regulator_dev *rdev, { struct da9121 *chip = rdev_get_drvdata(rdev); int id = rdev_get_id(rdev); - struct da9121_range *range = + const struct da9121_range *range = variant_parameters[chip->variant_id].current_range; unsigned int sel = 0; int ret = 0; From patchwork Mon Sep 9 13:51:16 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Krzysztof Kozlowski X-Patchwork-Id: 13797132 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 ABD46ECE57A for ; Mon, 9 Sep 2024 13:57:26 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Cc:To:In-Reply-To:References :Message-Id:Content-Transfer-Encoding:Content-Type:MIME-Version:Subject:Date: From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=ebiwwBtqKdnptnl4wd8GBFDK3ZgfnRMWFyATVPqygk8=; b=2PB3/jjo4v7kevzOL2BAfo09PO FRTyEhIOk7iaOyCQ9pDd7CuAOYwXSn2OXVkRFDoJBKOS6YYPgKRyfTN6Cj4a1JOKdzG/w1IkFkJL6 /6L+A8VylRhw0shUQDcyyLA/UPFUYN2loJSVZPXyuHMeIBTyGJniMkWpV4D7P/uaZDQbhtWnis0h9 RvkT8MjO9oS625yC7DdyJN6uSqzWf6aKSPtbMhVBfaSRV8ecKTbOZR3Tjxf19mw4xe0dibVuVEM5o c7VTYmealuSVOYPQiJgc4K+i8jJa1HFu723QQkQwlkuE+OviT6AOB/NievT2OFKCfT/sa52YYOQtD 6IeqEqXA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1snetH-00000002AEl-48Vo; Mon, 09 Sep 2024 13:57:16 +0000 Received: from mail-ej1-x631.google.com ([2a00:1450:4864:20::631]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1snenz-000000028bN-3XSd for linux-arm-kernel@lists.infradead.org; Mon, 09 Sep 2024 13:51:49 +0000 Received: by mail-ej1-x631.google.com with SMTP id a640c23a62f3a-a8d1a00e0d0so8614066b.3 for ; Mon, 09 Sep 2024 06:51:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1725889906; x=1726494706; darn=lists.infradead.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=ebiwwBtqKdnptnl4wd8GBFDK3ZgfnRMWFyATVPqygk8=; b=srtHJoPlUTp37GGE8P44Gcl0ThgycR9uk2zrRSsvvNRzA+rjaritbULa2VsrToDoxq UW5YkctN9wvQiukmLUdWY8J7xwtbxJQTUqaX2kU+9lu6bzucFtBqU94VFmWtaVQFT3Oi gNJSvsqdLvKqHQ9VawvdoFpeBHMIA2lTD2fUxmv0INJ9KJDxZAhWV6fJzUuU3soZrJoR VcHfYx4zxW3sxx3xJSmrl7ABjzYzLzWafW5gYLGW7Cyp5fFoWWDpSYVYs3jEqNn2wwXj J6WtqW+58yL0YHBPc88tUu22HHzk70xR8PiHFAnzwLSzgedKKYr/PHz7tE7ejVTNsyda D5FA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1725889906; x=1726494706; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=ebiwwBtqKdnptnl4wd8GBFDK3ZgfnRMWFyATVPqygk8=; b=tkeyNjtS/82ieNOsetLDNKQmLAAVu6c0wPx1BQhwgoPtn6qaFwSCXEs5OBVNkz6C+q OA2YCwTeEKjm4yaFXX/ThsCQkSFJvonZLk6OA0sKaJTG3a2a8cz82FHdWDrWNUVmBnVf oMLioP5gMlumB0u3fcebYFbEhN0DfUSATsm5qo4VLDO+bmj5wHCbN8ZP8qsSihe8AmtZ OuR5HbAM8nF6KKMVENxodsepa++jS1sjpibqqvlJ9IfRQejOEPUjhl+mgbcLuzAht27H 2S+MiAcjdjjjrRIe4msznkhQLGggqEovP/Bwa2AjbQxHBMC23Y/2N/F91UzrkSqGkzt0 h3fw== X-Forwarded-Encrypted: i=1; AJvYcCVnG/Br3uSHF5z46Iq+VBOOGS017GIeJ4j88Hc1x/HxuGUXInHtEmdY37isxQ54OXXKsbXSiyNKhXdK2JdGuIKC@lists.infradead.org X-Gm-Message-State: AOJu0Yz6ZiUx1lAXOYrOmqBsOEjddjpiMWLrFZiYvajOwbW6WQ18kqt9 flXTxSeZaWoBsRefmyEne1SQtp88E1hPHcDnayw1zfOWeVXGpNyK4C4jWs3+inA= X-Google-Smtp-Source: AGHT+IHitMS1cWRj6WUaeP05stoqvUkgN1+30cQ8Qjo2wMMatVr+SQ+ogFBaSLtp79Pcj8lputkU3w== X-Received: by 2002:a17:907:3da7:b0:a8a:81ec:f731 with SMTP id a640c23a62f3a-a8a885c3265mr378363266b.2.1725889905496; Mon, 09 Sep 2024 06:51:45 -0700 (PDT) Received: from [127.0.1.1] ([178.197.222.82]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-a8d25cf3ad6sm345344566b.148.2024.09.09.06.51.44 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 09 Sep 2024 06:51:45 -0700 (PDT) From: Krzysztof Kozlowski Date: Mon, 09 Sep 2024 15:51:16 +0200 Subject: [PATCH 05/17] regulator: da9211: Constify static data MIME-Version: 1.0 Message-Id: <20240909-regulator-const-v1-5-8934704a5787@linaro.org> References: <20240909-regulator-const-v1-0-8934704a5787@linaro.org> In-Reply-To: <20240909-regulator-const-v1-0-8934704a5787@linaro.org> To: Support Opensource , Liam Girdwood , Mark Brown , Matthias Brugger , AngeloGioacchino Del Regno , Bartosz Golaszewski Cc: linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org, linux-arm-msm@vger.kernel.org, Krzysztof Kozlowski X-Mailer: b4 0.14.1 X-Developer-Signature: v=1; a=openpgp-sha256; l=819; i=krzysztof.kozlowski@linaro.org; h=from:subject:message-id; bh=qvFB37UNy0FXUjxrG9GIJ3EDRLNkuyXGb5mp950Q39M=; b=owEBbQKS/ZANAwAKAcE3ZuaGi4PXAcsmYgBm3v1cXH5mO890K3vAeJUuv0AtSmRWejCS85Vei fX3f8LzbhCJAjMEAAEKAB0WIQTd0mIoPREbIztuuKjBN2bmhouD1wUCZt79XAAKCRDBN2bmhouD 11ChD/4yh9ctCFV0lMqYOZv20i4KdgYa2NLHUN4pjlhvUeE7bNRx3gvPpT3oVHy6TYPDGYd5xo3 qjMOhlaWM98n4j3kvYr2n4bj+STEKZbYNUGMiSvU/lGDNdaGlcMDA41KdZS2+dtZPIXiYXTXoy4 /XrGKA5vm9X/3c1vlsz1D4SnBOFXPARuDCy0e0zAa21CsIe3ymWRvgkWPPJSDNewvsrYGT/+n8p luKgHx2DD/MLwnhTHKNCVJ4ZoGW/Ze2TO4/2MVkHu8KoXY0Oza+VL2cjhcDxfrQJiuegsVR7pjE pYOLDyEJ/13cTDHX4CEjygyGVrVPolQOJuG0LDOd75YSZMTpsNLxb7A5o+/pkKzT6+23qHWSOsF F9ELpIwY6vQyXC8KxYXtgaePWfY9pJIWkXfYEX7+OM9U2yu0Tf/DYoYCpd8RLqyI0YChNH73f/Y 7GM5HG1jaUjTcqDnKB1AK14fBS9qyMZOSiAtykpZEWGBAuV5jhBKo7APsx0Qf3XkXQWgRx07qyy +xlJz1udRGESQ79PA8s7uWN6tyGr+pVk/qfIhnSQYt4c3K4hcFFBXoiHwbNVRvaVU65qpe8uL64 nwtioO7ua6RiqxYui6Yc/8tCc9hGvBoC+DgR8RYhkAsvp5qYbsP0GYjBvYtKMeNqtXkGMc3hUe1 MI4gi9DFb78nIkw== X-Developer-Key: i=krzysztof.kozlowski@linaro.org; a=openpgp; fpr=9BD07E0E0C51F8D59677B7541B93437D3B41629B X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240909_065147_921589_9666F1BB X-CRM114-Status: GOOD ( 12.70 ) 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 Driver does not modify static data with regulator description (struct regulator_desc), so make it const for code safety. Signed-off-by: Krzysztof Kozlowski --- drivers/regulator/da9211-regulator.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/regulator/da9211-regulator.c b/drivers/regulator/da9211-regulator.c index d8b39ea3de0e..d4f14d7ea8cf 100644 --- a/drivers/regulator/da9211-regulator.c +++ b/drivers/regulator/da9211-regulator.c @@ -264,7 +264,7 @@ static const struct regulator_ops da9211_buck_ops = { .of_map_mode = da9211_map_buck_mode,\ } -static struct regulator_desc da9211_regulators[] = { +static const struct regulator_desc da9211_regulators[] = { DA9211_BUCK(BUCKA), DA9211_BUCK(BUCKB), }; From patchwork Mon Sep 9 13:51:17 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Krzysztof Kozlowski X-Patchwork-Id: 13797133 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 04EBBECE57A for ; Mon, 9 Sep 2024 13:58:39 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Cc:To:In-Reply-To:References :Message-Id:Content-Transfer-Encoding:Content-Type:MIME-Version:Subject:Date: From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=FzRjkUKpUqQXpsK4/eDUhuJEBuZIqvcSWctdz6VolTM=; b=bGLE6rB8pH7A6nWuMdv5LkP8Bv KSx9j/vxO9prUzsdXiUDrnJNOc2ib/xocCnHu2YJrzvcSKcIP/VvUGxMCz+dkSTpOF7GB4E+cSFiA 3P0ZlRzB51aZww4e2hqT8+j1SPMODBkjrTPEnUR5Jk09/k0SOFThyrYL2QbacemLYCAWbDlSJEKpg hW5Opns3VeWGRtMuBDR9RmNCZAqKAMS8nD6zwBT0Ad9lIIqwPxy/XaUbcJYorcMTlQXF9TwAKZQ8u ChbzkCYkMfWehWydp2qqBTya7edJace/ITydycORSGLKNRY80gnSSqeBWodccZ4YONTR+pMH9jd16 gq9S61vg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sneuR-00000002AaA-3HTK; Mon, 09 Sep 2024 13:58:27 +0000 Received: from mail-wm1-x330.google.com ([2a00:1450:4864:20::330]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1sneo0-000000028bd-2t4k for linux-arm-kernel@lists.infradead.org; Mon, 09 Sep 2024 13:51:50 +0000 Received: by mail-wm1-x330.google.com with SMTP id 5b1f17b1804b1-42cb6eebfa1so1494655e9.0 for ; Mon, 09 Sep 2024 06:51:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1725889907; x=1726494707; darn=lists.infradead.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=FzRjkUKpUqQXpsK4/eDUhuJEBuZIqvcSWctdz6VolTM=; b=mm5WAxilpCRX4BRZKantzh+YdXIlFXMgwkWklj7bD60KF8w8qNUiIbKgK53AKovC0G xAcA4wc8DY/BxR5Z79YAmiFussd1wvlwZ/AzOA4/URViHMBwnf3pr1QrwMHNqXh6mJvp GleCVOhVB0nidQTVcjcgpAGIr1yvdbowgEc6Wu1UOUUn6m8QrkgDQ1NThE/P7ci7bozR 5izhHNWFz8qbK0KOQ+6IuSKlRcFHqJFpGS5LCBCMSxdJ3cCYD5LSPbeBZqwcmSbZgn4R SmonYPqR1cUM0V7TIdeUjyhCiEZstUNTJPT/tv7tI2QCJ5/hxZ2bIiDVca3cW4e0V7NM T0EQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1725889907; x=1726494707; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=FzRjkUKpUqQXpsK4/eDUhuJEBuZIqvcSWctdz6VolTM=; b=HVqhjgqrYzwjUeTtAKcvNg7ny9umBCRTNAE2BkYVf97F+pJqEBSTyUf8FCG5ajfxpV cwdshXhkP97BB6gqANuWNiFlsfmWQRZGuT8b8zinWOOuyqzbMNm5qa/KWLUI011B9BqY QIkDg5OMEORQRO2cCI9iQPuD7gXTKSqq1ovCZPojK9sY1oldaZo5lV9TeKzxTG95D7VV Ul9v9JKfxw0+JDVRGXEE6DZsH2Hbehyt0q3nnwgSsdnhpIxId/7Nhkq+Tt2ovJ+E9UuT aZfQIp1V/cZU2iEKabjCimG7ReOh1O1jFCtmBzF2JsCnMD7PFz6mwEDhUR/8mGp7IY5u SGVA== X-Forwarded-Encrypted: i=1; AJvYcCXf0UqLLTMGHOx8oRGUPAomaG86McTq8K9xFYYL3QGNbqFiqcWpL2udyGyYj+7cKiUvLoGcpbWiP9GbvvUHHtIO@lists.infradead.org X-Gm-Message-State: AOJu0YwAwiKVoyB8nQjrR/gaCCxk3jfHnQEeeWQ95AVxRk6132cKQJo4 1AosJ+hA18cpFx4/+/mbiMhbG5QmSIJAMNmxeVkua4Mivnu3xpEYfGFYKsIFGok= X-Google-Smtp-Source: AGHT+IG784y6TviUcaC0Sy4/IOqmsR+O7VMUlzzzng9cVnZEltHKULUPHrwBEN/dEMaMq7ZQr9+LCw== X-Received: by 2002:a5d:6484:0:b0:374:cd3e:7d7a with SMTP id ffacd0b85a97d-378895c38c4mr3364134f8f.2.1725889906747; Mon, 09 Sep 2024 06:51:46 -0700 (PDT) Received: from [127.0.1.1] ([178.197.222.82]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-a8d25cf3ad6sm345344566b.148.2024.09.09.06.51.45 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 09 Sep 2024 06:51:46 -0700 (PDT) From: Krzysztof Kozlowski Date: Mon, 09 Sep 2024 15:51:17 +0200 Subject: [PATCH 06/17] regulator: hi6421: Constify static data MIME-Version: 1.0 Message-Id: <20240909-regulator-const-v1-6-8934704a5787@linaro.org> References: <20240909-regulator-const-v1-0-8934704a5787@linaro.org> In-Reply-To: <20240909-regulator-const-v1-0-8934704a5787@linaro.org> To: Support Opensource , Liam Girdwood , Mark Brown , Matthias Brugger , AngeloGioacchino Del Regno , Bartosz Golaszewski Cc: linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org, linux-arm-msm@vger.kernel.org, Krzysztof Kozlowski X-Mailer: b4 0.14.1 X-Developer-Signature: v=1; a=openpgp-sha256; l=3081; i=krzysztof.kozlowski@linaro.org; h=from:subject:message-id; bh=j2zwQ1BCa3xviw33TQ1yU9leknMd45i2193Hd7keRfQ=; b=owEBbQKS/ZANAwAKAcE3ZuaGi4PXAcsmYgBm3v1dar5m8pWkgX0YQ41g0FmZeSQHS5Ldzu5oS VY/Jxr8BWyJAjMEAAEKAB0WIQTd0mIoPREbIztuuKjBN2bmhouD1wUCZt79XQAKCRDBN2bmhouD 196TD/9RCl439qn314C+1T07HG8J93zopFOVXqjRy5Chbs5rO9u7m7CWkTeYHrZRX11Lsv/pD8I 92sYpTkK7vooauJ0uvcp3EMdJb5DiMrjs6ZmG+mXxH6XVliP1laV5MM0KiyDQeQoxAPO9tqmen3 yL4kC7BbpHsME4uSggz2G7SUJ/oHzaJ70GDRgB/BYnqnNvqJbP0KMsLHyhg3AxgRRw2mNawPdHe kwMomDZN92uAzVczA1Ynpj7p74RF9KBVIZvAlIl1efcitCaJUMOj3gEYTwRfA0jWDBKMAiCYdyE 1JNU01he7Duw2eMYTuSdroWOk81VkunYCpFrGvuSxFvttiFIAuwhPZhVks4dAfOtRlLbqdZ1qsE emRlIThRFUeb+glNUU7QLIG6JXpXtd6lGIEGK1SktsF7A3zQgo1M6ukdkioa5k7PxK8kZk+FszD /PSqRFLSiLqTZVz66TJNUcNs+hSOo3gzi6GBco5mW02vsquNRXrREUBVUseeCvWtI8v9lPwwIIN zbD3lqgTWX025GXQhLUk9I56pMObo+qAux80yYS2enK5o5hc9EJjf7SC8kMWhO6BmmMDYyoViuw wMWN4XPk2B1WZtQb3TGYlMlGotK1q6KnFPgSzICh+WNwhXYyOorLxMRRaJl/YA2eTuoxfKpiIt9 xHhe5ucd9x/ZU6Q== X-Developer-Key: i=krzysztof.kozlowski@linaro.org; a=openpgp; fpr=9BD07E0E0C51F8D59677B7541B93437D3B41629B X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240909_065148_827941_30A8E97D X-CRM114-Status: GOOD ( 13.71 ) 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 Driver does not modify static data with regulator description (struct hi6421_regulator_info), so make it const for code safety. Signed-off-by: Krzysztof Kozlowski --- drivers/regulator/hi6421-regulator.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/drivers/regulator/hi6421-regulator.c b/drivers/regulator/hi6421-regulator.c index 82e9e364d4d4..69d24728d6a4 100644 --- a/drivers/regulator/hi6421-regulator.c +++ b/drivers/regulator/hi6421-regulator.c @@ -303,7 +303,7 @@ static const struct regulator_ops hi6421_buck345_ops; } /* HI6421 regulator information */ -static struct hi6421_regulator_info +static const struct hi6421_regulator_info hi6421_regulator_info[HI6421_NUM_REGULATORS] = { HI6421_LDO(LDO0, hi6421_vout0, ldo_0_voltages, 0x20, 0x07, 0x20, 0x10, 10000, 0x20, 8000), @@ -384,7 +384,7 @@ static int hi6421_regulator_enable(struct regulator_dev *rdev) static unsigned int hi6421_regulator_ldo_get_mode(struct regulator_dev *rdev) { - struct hi6421_regulator_info *info; + const struct hi6421_regulator_info *info; unsigned int reg_val; info = container_of(rdev->desc, struct hi6421_regulator_info, desc); @@ -397,7 +397,7 @@ static unsigned int hi6421_regulator_ldo_get_mode(struct regulator_dev *rdev) static unsigned int hi6421_regulator_buck_get_mode(struct regulator_dev *rdev) { - struct hi6421_regulator_info *info; + const struct hi6421_regulator_info *info; unsigned int reg_val; info = container_of(rdev->desc, struct hi6421_regulator_info, desc); @@ -411,7 +411,7 @@ static unsigned int hi6421_regulator_buck_get_mode(struct regulator_dev *rdev) static int hi6421_regulator_ldo_set_mode(struct regulator_dev *rdev, unsigned int mode) { - struct hi6421_regulator_info *info; + const struct hi6421_regulator_info *info; unsigned int new_mode; info = container_of(rdev->desc, struct hi6421_regulator_info, desc); @@ -436,7 +436,7 @@ static int hi6421_regulator_ldo_set_mode(struct regulator_dev *rdev, static int hi6421_regulator_buck_set_mode(struct regulator_dev *rdev, unsigned int mode) { - struct hi6421_regulator_info *info; + const struct hi6421_regulator_info *info; unsigned int new_mode; info = container_of(rdev->desc, struct hi6421_regulator_info, desc); @@ -462,7 +462,7 @@ static unsigned int hi6421_regulator_ldo_get_optimum_mode(struct regulator_dev *rdev, int input_uV, int output_uV, int load_uA) { - struct hi6421_regulator_info *info; + const struct hi6421_regulator_info *info; info = container_of(rdev->desc, struct hi6421_regulator_info, desc); @@ -539,7 +539,7 @@ static int hi6421_regulator_probe(struct platform_device *pdev) { struct hi6421_pmic *pmic = dev_get_drvdata(pdev->dev.parent); struct hi6421_regulator_pdata *pdata; - struct hi6421_regulator_info *info; + const struct hi6421_regulator_info *info; struct regulator_config config = { }; struct regulator_dev *rdev; int i; From patchwork Mon Sep 9 13:51:18 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Krzysztof Kozlowski X-Patchwork-Id: 13797138 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 6073DECE57A for ; Mon, 9 Sep 2024 14:00:51 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Cc:To:In-Reply-To:References :Message-Id:Content-Transfer-Encoding:Content-Type:MIME-Version:Subject:Date: From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=FndzdmkQ1TyGddm5J1kGgfQG5PZMqaxnpW3JAkHAkvA=; b=DFIckCnnmAeo+XIY8KAGRAvTeo Kn4z0r1203/GDqxnThndHjE1rEdJG/BXI69pcBoDsBrlwFMZX84Ht2SGomhfILqcU9OEiG1XDi+oM w0Cl7DDo+FWdhVfu45j+w1D5yPE6Y3Zzi7Ku8ISk+i9Ec8MSH0xY6WtuwHbMQLoGfbhQLxYlmqPG1 fdTXMEleHuqTEkQsjI8/EtVCiAO3o3od4g6KbVBmc9HYv6jy82ZxjFQ/crc0w0fwF/WUxxRo3fCyD Jh5M+xLH02Y0Wdd24gKtC0SP2zIgjShC4fWXAg1ktZxeepfHInQSjgV/6iwo2Hd+wIwLTcZgP2Xp8 bhljMw7Q==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1snewX-00000002BGR-0mnB; Mon, 09 Sep 2024 14:00:37 +0000 Received: from desiato.infradead.org ([2001:8b0:10b:1:d65d:64ff:fe57:4e05]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1sneo7-000000028gU-0yBN for linux-arm-kernel@bombadil.infradead.org; Mon, 09 Sep 2024 13:51:55 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=desiato.20200630; h=Cc:To:In-Reply-To:References: Message-Id:Content-Transfer-Encoding:Content-Type:MIME-Version:Subject:Date: From:Sender:Reply-To:Content-ID:Content-Description; bh=FndzdmkQ1TyGddm5J1kGgfQG5PZMqaxnpW3JAkHAkvA=; b=TnnwyRYiJDZEmsBrRhtIxsLDUd S7WKOealuGVPY4FA8MbmxFVzDVPflbOzMh0zjK8ASDKLSJYvLB3tlpTVyzAe0cpkAMw+avKgY7A40 NCGT5IbgmSFqw71r7EV0/HSiiC3he4QdCOe74fR4ydE3Bei5tMyWwk4LRTT7ELZGR17xH0OYTeFMS 7YODTxBmIl1tnlUapm4lcaWIlEzTlkDySViLjY0YXGOAjx71eIsUQvNOHLjHCk5eC5dS2ED7CpgOv ytZQPUvkCvZnAawFU0r2i8rZ4XK2rNh0roAevwHof0reH6tXBVJ0BoT4/iIEFSV6V/hN1YR08dQzR EpjHk3uA==; Received: from mail-ed1-x531.google.com ([2a00:1450:4864:20::531]) by desiato.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1sneo3-00000000ReM-3yZf for linux-arm-kernel@lists.infradead.org; Mon, 09 Sep 2024 13:51:53 +0000 Received: by mail-ed1-x531.google.com with SMTP id 4fb4d7f45d1cf-5c26fd60b7bso387056a12.1 for ; Mon, 09 Sep 2024 06:51:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1725889908; x=1726494708; darn=lists.infradead.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=FndzdmkQ1TyGddm5J1kGgfQG5PZMqaxnpW3JAkHAkvA=; b=aIKsaI+iIClWRc1XoeAyA7/et+bCE8XAz6znhxCss5QjfgUYFHSDn9fQ34JDdNdk+U eJVPZAJrUlhE1D4xyDaglS/LYg2WnNDk7SqHmJg5jRqH2bH5xTY6Zak4X6X/uBV9b16r nJSE7lHvdMZGOUo+jyi2IhN932g49yYwOdCNPKq6AVVjCPBrnBcMyg6OTt0pqFHirlI0 4i/ptfvSfIZnmIt9QyJQQKgnbRep2CMvDxO5uVrgcF/FEycxLyqzf8578q+2m/oFS8fm ctLPyj424Fmhx9rD+6Cocryj1T7ES/ubsYrW7ej0KF2aFe71jJtVNIUivJg1cxN0vQgq TtBg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1725889908; x=1726494708; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=FndzdmkQ1TyGddm5J1kGgfQG5PZMqaxnpW3JAkHAkvA=; b=f0kVkJvbs63qBcJZ23U2uaxowgP2aHsyGmNQtHyEUTfldC5kYRoBRmfE23LL3EvFtb 551xyR1BwutNbEVYPQrWeIGxQsPGGE0HpDcAUL9K3MasSgQzA2wheLI7nSaeu+Z/EfLB W3dHHz8NLHMrYa+BPOz5S5OvMnta18bcaA4AbCAyPUe4T66eR6hSnHWyVvJVdAcpk3M2 2lcjeKVFa+KofnuPIEPgI9u1U6rmxbdY6fju0557AfgPLKnYQsv7nC+3tPf7FA3MpNWK 7CQ+vfzytgfT2XitJ8StfZ+UDIjv5tDDGcQt8a+Asny8sB4s4m6mAZ2GAx4PmREE1G0p 4e2g== X-Forwarded-Encrypted: i=1; AJvYcCVAV71VJkp+Y5ajOIvwyhESg76vdnfGykK7ipJTZJbi8nlVADtwQawSngL75arJ7Zz6ceSt+c7ePDFo7tVxsrHx@lists.infradead.org X-Gm-Message-State: AOJu0Yx1KYK7NLyTEZdmhdkPn/poD56v0k7q71WflWjfMaZRKupGVPyk RZ9Olzkbqqb6RD9oNSt8j0xashhcVQmakhlkqmTHf/KJjbbglu48LdIp4ZJrHckRCYQCVLL8lyg R X-Google-Smtp-Source: AGHT+IFey0kfUyFLxagH6WYQeneAlVLduFYs1cyOv+swLVtBUWQ2bTPbM+NQhOdNSq4TWZKivO7V+g== X-Received: by 2002:a17:907:3f87:b0:a8d:2624:1a85 with SMTP id a640c23a62f3a-a8d26242590mr191552266b.12.1725889908199; Mon, 09 Sep 2024 06:51:48 -0700 (PDT) Received: from [127.0.1.1] ([178.197.222.82]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-a8d25cf3ad6sm345344566b.148.2024.09.09.06.51.46 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 09 Sep 2024 06:51:47 -0700 (PDT) From: Krzysztof Kozlowski Date: Mon, 09 Sep 2024 15:51:18 +0200 Subject: [PATCH 07/17] regulator: hi6421v600: Constify static data MIME-Version: 1.0 Message-Id: <20240909-regulator-const-v1-7-8934704a5787@linaro.org> References: <20240909-regulator-const-v1-0-8934704a5787@linaro.org> In-Reply-To: <20240909-regulator-const-v1-0-8934704a5787@linaro.org> To: Support Opensource , Liam Girdwood , Mark Brown , Matthias Brugger , AngeloGioacchino Del Regno , Bartosz Golaszewski Cc: linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org, linux-arm-msm@vger.kernel.org, Krzysztof Kozlowski X-Mailer: b4 0.14.1 X-Developer-Signature: v=1; a=openpgp-sha256; l=2313; i=krzysztof.kozlowski@linaro.org; h=from:subject:message-id; bh=aQxdvJysaJsMuCiXGmuPsUG5zXaAXydDbTeDR80ECyI=; b=owEBbQKS/ZANAwAKAcE3ZuaGi4PXAcsmYgBm3v1eEV9BEYMcFSBw7lfXCzYrANegqqdP0KgLr wLORiBbAs+JAjMEAAEKAB0WIQTd0mIoPREbIztuuKjBN2bmhouD1wUCZt79XgAKCRDBN2bmhouD 1/NGEACM/+upk2qItNXTCceOePEuc0yrqvApHPovnARhqgTaI4wjCEJjM3WbPMEs2it8jbbZY3R GWgKaMlU0NZCMQLdzbK6xCPCY0HAUlP5hXV7Z67Ga6wVt96WZRE3i3UvH5aLubbrFfPdsAdZWxc 9A4DfZDmLK+ex/r4s9ef8DAk2U49qbgi17CR/BLEP0SVqJqNLTiyiLRGcPq24oKifYOQFnpxhAS KtLzPTPMLJFV5UQhgfwbPRBI28xbaJAlPyzqxW98B5cTUSz6Aln73tTlcSF620UGIUyFoKwRury BOep0BgcFjCQdaJJwn+Dq8kp4Eazcf9knQFU9TPu2T7Kwz9aRVGTXA2myWRdgBlJzhjcQWK+mOp j+9qAJ5Kbl+Y1Oy8grzj5aSPTbuo5b1Z79AqfRmD3QFOucMRzqU/OcOtIfVHUUQghwLE+j/asq9 Few4VKtyywvJ0AcvBTNWRK3PrJvu4yNZqkIzoqNSeMV6WYl5ZPKLEu9A+O+R1cILiAE10eaE/Jc inkY3yW1Ccyj1xQxAf+DLVEKSbkpTOSmdlaos8Eh6zLj+JZjsB8Z7LNUgzCvaDqtwC8hRw3H7z5 QLC2PSX21usUhZ+r+2B9ey/R10vItMc/Uwhxzhhkrb0vhzGWcObfrkEyjxtbYij4VEE+YX6NFud nxDwTMTP+ayKivA== X-Developer-Key: i=krzysztof.kozlowski@linaro.org; a=openpgp; fpr=9BD07E0E0C51F8D59677B7541B93437D3B41629B X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240909_145152_093387_3147D2C6 X-CRM114-Status: GOOD ( 14.89 ) 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 Driver does not modify static data with regulator description (struct hi6421_spmi_reg_info), so make it const for code safety. Signed-off-by: Krzysztof Kozlowski --- drivers/regulator/hi6421v600-regulator.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/drivers/regulator/hi6421v600-regulator.c b/drivers/regulator/hi6421v600-regulator.c index 4e10daa1e689..e5f6fbfc9016 100644 --- a/drivers/regulator/hi6421v600-regulator.c +++ b/drivers/regulator/hi6421v600-regulator.c @@ -118,7 +118,7 @@ static int hi6421_spmi_regulator_enable(struct regulator_dev *rdev) static unsigned int hi6421_spmi_regulator_get_mode(struct regulator_dev *rdev) { - struct hi6421_spmi_reg_info *sreg; + const struct hi6421_spmi_reg_info *sreg; unsigned int reg_val; sreg = container_of(rdev->desc, struct hi6421_spmi_reg_info, desc); @@ -133,7 +133,7 @@ static unsigned int hi6421_spmi_regulator_get_mode(struct regulator_dev *rdev) static int hi6421_spmi_regulator_set_mode(struct regulator_dev *rdev, unsigned int mode) { - struct hi6421_spmi_reg_info *sreg; + const struct hi6421_spmi_reg_info *sreg; unsigned int val; sreg = container_of(rdev->desc, struct hi6421_spmi_reg_info, desc); @@ -160,7 +160,7 @@ hi6421_spmi_regulator_get_optimum_mode(struct regulator_dev *rdev, int input_uV, int output_uV, int load_uA) { - struct hi6421_spmi_reg_info *sreg; + const struct hi6421_spmi_reg_info *sreg; sreg = container_of(rdev->desc, struct hi6421_spmi_reg_info, desc); @@ -195,7 +195,7 @@ enum hi6421_spmi_regulator_id { hi6421v600_ldo34, }; -static struct hi6421_spmi_reg_info regulator_info[] = { +static const struct hi6421_spmi_reg_info regulator_info[] = { HI6421V600_LDO(ldo3, range_1v5_to_2v0, 0x16, 0x01, 0x51, 20000, 120, @@ -235,7 +235,7 @@ static int hi6421_spmi_regulator_probe(struct platform_device *pdev) struct device *pmic_dev = pdev->dev.parent; struct regulator_config config = { }; struct hi6421_spmi_reg_priv *priv; - struct hi6421_spmi_reg_info *info; + const struct hi6421_spmi_reg_info *info; struct device *dev = &pdev->dev; struct regmap *regmap; struct regulator_dev *rdev; From patchwork Mon Sep 9 13:51:19 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Krzysztof Kozlowski X-Patchwork-Id: 13797153 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 6B538ECE57A for ; Mon, 9 Sep 2024 14:07:58 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Cc:To:In-Reply-To:References :Message-Id:Content-Transfer-Encoding:Content-Type:MIME-Version:Subject:Date: From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=G1O1uIOK/bGt5Fhn73NS6TTBd8QYB0uOT+v/12vxEjw=; b=oIvvl0gMt1V4zZIn7wXZBCCNaI c1WFFnWYJF0n9wK1BDXsEHNL20KwjknYp5EONOJD53d1pyaCy7b59R/EGzcNoCjsH1ZsUKySXr5O+ uN0PriHTK8UbNUFvVdDu/jlgxFxPtFKf0eB/XTPo0brkThGsDyHHW+O9rn2dEh78nqYJ12LtSY72b 6I1Wa5wjkP7e8XuKtboI4DThruhpL4MNCQoFSSQxLRbQob+eKc61BbihC9CCaIDYH9HaQ/u/eLYiI WbBPD/g9F4OfCheiWo4dZIxjyB5vz3G24xY5xQiNLOcTMxC5qehORR5B0OSEuLyUN73oUbLmjnbIe YiBpjU6g==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1snf3T-00000002Csh-1azU; Mon, 09 Sep 2024 14:07:47 +0000 Received: from mail-wm1-x32a.google.com ([2a00:1450:4864:20::32a]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1sneoE-000000028mT-1e1U for linux-arm-kernel@lists.infradead.org; Mon, 09 Sep 2024 13:52:04 +0000 Received: by mail-wm1-x32a.google.com with SMTP id 5b1f17b1804b1-42cb198f23fso2612475e9.1 for ; Mon, 09 Sep 2024 06:52:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1725889921; x=1726494721; darn=lists.infradead.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=G1O1uIOK/bGt5Fhn73NS6TTBd8QYB0uOT+v/12vxEjw=; b=QjuWK6EGG+KK02Vjnj7ATDG8JNRSZ+dl4z2dtlAkogn6XTTf2t4yiQHx7uzPFctkrS F2rC+CYBlbDCOpn951AXAxDDZBA5pWxKu/HjhhpBJh419dSCc8dnDuRrCC48IKS2QeL+ q9NY5SIYrpOCuCJv/MOr6mhvABMS30g1sw7S7/Zz1D37udKiSdxw4Qu1AhKnbMqlXaxu UwtbANLfonEWcGuEWuHGyLYo1PqOQ03Yt0pRrTk6tYqSosmPtmiMpe+ghlxgBG8vPuY2 Wv8+j9M8e+D/2vzohws/8BP/nNjgK9HKloy8+fUytBnWfT5tWGIMEFgKcVG4oHRpTHuF 60iw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1725889921; x=1726494721; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=G1O1uIOK/bGt5Fhn73NS6TTBd8QYB0uOT+v/12vxEjw=; b=oRAsa9BAbysKrzf4HKVs58ezWYfbPv+X9X3j2e1MwzwN9xfNxYGLQE3n1/Vcymu5uV 0EvHHQW5LASlAYtlZvnnj3hP9xg+/gj5J2BZiazC3MAff9wrk1/LRCJlEly24TOAe8Ul udzMHZ6Udr+G00bpywwzWdUy0iGbTXpKehqs9dBmLW5adY3U23HlG5fxLcckykdCN0jb TgdpxMMU/kjK7EdrAMcnYdRilzXjHPU9zchppSCyEdM0vuojz/gTyn38xDh9UjJ1P7af VDdF5czn5FZDCtoOFExV2xMIWKeemaaa+bXMpL59vFAS+lTr3DDFQ5RV4RlsOxvNNgRo 4xtw== X-Forwarded-Encrypted: i=1; AJvYcCWvTcQFLTwAd3oz188JU6G1dzMH55v3H0layqHk9q8i4fn5SKBRXCWv6uSeXKa62YMFGZaewj4gEeYSzhlxKAuD@lists.infradead.org X-Gm-Message-State: AOJu0Yz92qs+zwFeq1brq9tKZMAtbBQ5CMeUxhw3jDQRlvhJJYg7IpEx VbNec/BklJHnP8FC2rzv7tu+4XokUaahwTiPwGyICI8831bxJdUKtr/ZwaoOpWnYrGwY7HHwqHz M X-Google-Smtp-Source: AGHT+IHF9qEIEL7aBOQecIEY8snSJmeWruEEkmGazQ3LXdnM7BSgPBuUwn/lQUqBri+myGdOHukvlQ== X-Received: by 2002:a17:906:f5aa:b0:a8d:2624:1a83 with SMTP id a640c23a62f3a-a8d2624256emr211094566b.14.1725889909620; Mon, 09 Sep 2024 06:51:49 -0700 (PDT) Received: from [127.0.1.1] ([178.197.222.82]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-a8d25cf3ad6sm345344566b.148.2024.09.09.06.51.48 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 09 Sep 2024 06:51:49 -0700 (PDT) From: Krzysztof Kozlowski Date: Mon, 09 Sep 2024 15:51:19 +0200 Subject: [PATCH 08/17] regulator: tps65023: Constify static data MIME-Version: 1.0 Message-Id: <20240909-regulator-const-v1-8-8934704a5787@linaro.org> References: <20240909-regulator-const-v1-0-8934704a5787@linaro.org> In-Reply-To: <20240909-regulator-const-v1-0-8934704a5787@linaro.org> To: Support Opensource , Liam Girdwood , Mark Brown , Matthias Brugger , AngeloGioacchino Del Regno , Bartosz Golaszewski Cc: linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org, linux-arm-msm@vger.kernel.org, Krzysztof Kozlowski X-Mailer: b4 0.14.1 X-Developer-Signature: v=1; a=openpgp-sha256; l=1273; i=krzysztof.kozlowski@linaro.org; h=from:subject:message-id; bh=jNymqsckfanJHx8PSWuZFbKm3ihIGGZwBaMEOB5ZiE4=; b=owEBbQKS/ZANAwAKAcE3ZuaGi4PXAcsmYgBm3v1frgG8hVoi2NhgvfRQHtO4lcCjJkU+gw/QJ a+Co9CrL8+JAjMEAAEKAB0WIQTd0mIoPREbIztuuKjBN2bmhouD1wUCZt79XwAKCRDBN2bmhouD 16V+D/wIO0j0Z5ZUo4S3NVrBCrwGJwjcNjLMFw1+a6IDku9xFAt7zKjtyZ8CjKRUx5N47SBwAUd XRFalrY9n51RWZN+zZdJZGWegfZwJH8ii+Vo1LcgMN7EXNFQ+GAx8rj8BL9UhPMkbPjXKfTBDos zt/o/ZfRrRb/1WfdTmgMqM1Hxy+yrzi2QeBtr/zUp7nQVs2qWNdJZJscoexW3/Wgy0jCw3XaRGw D0qK1K/ByJAmToUC/X9VNvBvNwnPjjSKvJE+YwhGH3jRqhKdB0h9WnigXlMpZSDZtvam+ADLQnZ uyTLjQEt8qy/6r6X+oFC7qFKD4Q2r93Od6yBXge7eqYgLNr+A/0gj6v8FZnt8/mPEiEeOuGqI72 VGuMSMFXxUPQyWxHvzNm9VCdrJOF5Oh2LdfMOV5+o9B4kynH0b3LCLw3wwt7dpHAaJO/94xJcTs 5Z1L+GsPo0NqHx6zQ2WxviPQFrrTdXT1OyY+uXDQsQlG0SrV5w0/PFa+tpfXWt0mQ6xNFnq/8WH h+5uoRK5ESWAfHL6ZH/vBlKthPGBLgWTLh/eQ5jY2zgS+sKy/FF/0Ow7eNGn8UISr/+MB6BaFu7 9MmfvCT98N2LNuX/IvslzkUrBlcfQ/ezRhYqU+boAGpkg/I57y1+yfKlgTexnJOsWkyq4R9PTxg 28X/ar9rqEWZJTg== X-Developer-Key: i=krzysztof.kozlowski@linaro.org; a=openpgp; fpr=9BD07E0E0C51F8D59677B7541B93437D3B41629B X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240909_065202_661045_54E32E20 X-CRM114-Status: GOOD ( 12.00 ) 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 Driver does not modify static data with regulator description (struct tps_driver_data), so make it const for code safety. Signed-off-by: Krzysztof Kozlowski --- drivers/regulator/tps65023-regulator.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/regulator/tps65023-regulator.c b/drivers/regulator/tps65023-regulator.c index d5757fd9a65b..3334b5b7d907 100644 --- a/drivers/regulator/tps65023-regulator.c +++ b/drivers/regulator/tps65023-regulator.c @@ -242,17 +242,17 @@ static const struct regulator_desc tps65023_regulators[] = { TPS65023_REGULATOR_LDO(2, TPS65023_LDO2_VSEL_table, 0x70), }; -static struct tps_driver_data tps65020_drv_data = { +static const struct tps_driver_data tps65020_drv_data = { .desc = tps65020_regulators, .core_regulator = TPS65023_DCDC_3, }; -static struct tps_driver_data tps65021_drv_data = { +static const struct tps_driver_data tps65021_drv_data = { .desc = tps65021_regulators, .core_regulator = TPS65023_DCDC_3, }; -static struct tps_driver_data tps65023_drv_data = { +static const struct tps_driver_data tps65023_drv_data = { .desc = tps65023_regulators, .core_regulator = TPS65023_DCDC_1, }; From patchwork Mon Sep 9 13:51:20 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Krzysztof Kozlowski X-Patchwork-Id: 13797134 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 F1A13ECE579 for ; Mon, 9 Sep 2024 13:59:36 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Cc:To:In-Reply-To:References :Message-Id:Content-Transfer-Encoding:Content-Type:MIME-Version:Subject:Date: From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=e4nMk71Ror4dDuFejQdNMVkNcSGmGkDbOfs0S0Gk4o4=; b=1D02AQotXXLEpDW0wTa391YnU1 4gHm4CFh2Q++dyu+7JA36J+/L2leuzR5oASA1I71oNjLJBE8S4XyKdkr5zuDo/WZAkEsaW1c7QF3c VaLuhD8/43PdY2xD7dX0IQHYu5sY6uy+4xN2r4M4edkq3Ac51x53OBKbAL+HCITCtmQsNgGT4rjF8 0AZE4Rm0tZM7bKcQX56B6elTwd8UCWhyM9L6VHX+z5Tf/8nnx926JK/4b/DCBjeNrD2uiWN8D5zho z432lZ2iIFZe3N1iAiQFgr1qB9OgungMXXJKMes1RoV6GV7x3JOovnGH3V1b2+zzrR4SXQbWSyadr 5XqUArVw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1snevQ-00000002Ao8-1sVb; Mon, 09 Sep 2024 13:59:28 +0000 Received: from mail-ej1-x62a.google.com ([2a00:1450:4864:20::62a]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1sneo4-000000028el-2fRf for linux-arm-kernel@lists.infradead.org; Mon, 09 Sep 2024 13:51:54 +0000 Received: by mail-ej1-x62a.google.com with SMTP id a640c23a62f3a-a8a765f980dso26499166b.1 for ; Mon, 09 Sep 2024 06:51:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1725889911; x=1726494711; darn=lists.infradead.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=e4nMk71Ror4dDuFejQdNMVkNcSGmGkDbOfs0S0Gk4o4=; b=gblslyPPfVCEinXV26L2f+MgtYZ9fHje6XMVk5dCOFz5l/b4Gvjbt08ZYo3NDA+Pm5 uh2soqEob4Ugh9CCdYSdlTq5xTaSJpeDnCWUAa6niSelfgC0txZ9K7WnQ3Asp+s4ybrH 2BKplQIERgMrVyyozVoACC7hVTU1M8xh+HetCw8FuQgPIgmN3XeTe3kU1kb87EWBnOcC s3Pwd4/ZrwJm0VMwVug6cvxx8V76Qh09fpRVbKgnLPD0gh6ExF4w87ZAhl1bXwmNCqs/ 49KYLANW3y9nSgd0rnXMcM5X+QTWiYBGb5v6asL3plza3wJGGbQMUhQrVts3GDtLyvdU IvBQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1725889911; x=1726494711; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=e4nMk71Ror4dDuFejQdNMVkNcSGmGkDbOfs0S0Gk4o4=; b=bbhaKMs5sUzVWnAe0Kaq4Tfh45FKH6HLREzfPEUu8Ky3j3iy9GuWteUtR1Po19gBN3 r3mhl7eerw5xu7AcGem9BRjG2/lnBss+YuXXDVVrBg3VZb2menu/ZSWOHmjG+Dllvrzn FiI9VNX6QuKAIZYjxr0UFHJP7XkuJSDO+JxRXO4OkQxcWzdwsjy+Fnv01l7VvBEKmMx2 SLTRnpvu2jhAm5gP6yGvJ3sUqWk2/rFK1j8Ss1xslRC3f/8EBbukFASqISSHrOU3JsXj 8fcBb+mf7u9UZsQEcZLKvltt6BTUf5CtxGkSu1IGZqoNJMdOngLIg6VEPyjy5UFIF2yr K/ZQ== X-Forwarded-Encrypted: i=1; AJvYcCXg/30s676r8w7xd/shH3lEiJLMgHGt+TsGdKwMzBSjcH/Gjn2h2eFWqcKtEyahJGPpSv0qmSw+wRbIIQ7IfUvN@lists.infradead.org X-Gm-Message-State: AOJu0YxvhLAZ4fKPUFCNJgy6lont17xYly7piBDa9lBJU9YHq2oe4xVb xW0upOA3p2lxc8vIWxECUk+7SdV3XZGbEYDkWNVQI0LqjT/plffCkKP2mcyAXlM= X-Google-Smtp-Source: AGHT+IF2PjCN56jaALnPx3R93ZXhQvgFBd1aE1EAodWyw/lW7I8GsseYFB7PzSZqIjBvJb78EvrSWg== X-Received: by 2002:a17:907:3da7:b0:a8a:81ec:f731 with SMTP id a640c23a62f3a-a8a885c3265mr378374066b.2.1725889911134; Mon, 09 Sep 2024 06:51:51 -0700 (PDT) Received: from [127.0.1.1] ([178.197.222.82]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-a8d25cf3ad6sm345344566b.148.2024.09.09.06.51.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 09 Sep 2024 06:51:50 -0700 (PDT) From: Krzysztof Kozlowski Date: Mon, 09 Sep 2024 15:51:20 +0200 Subject: [PATCH 09/17] regulator: max77826: Drop unused 'rdesc' in 'struct max77826_regulator_info' MIME-Version: 1.0 Message-Id: <20240909-regulator-const-v1-9-8934704a5787@linaro.org> References: <20240909-regulator-const-v1-0-8934704a5787@linaro.org> In-Reply-To: <20240909-regulator-const-v1-0-8934704a5787@linaro.org> To: Support Opensource , Liam Girdwood , Mark Brown , Matthias Brugger , AngeloGioacchino Del Regno , Bartosz Golaszewski Cc: linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org, linux-arm-msm@vger.kernel.org, Krzysztof Kozlowski X-Mailer: b4 0.14.1 X-Developer-Signature: v=1; a=openpgp-sha256; l=991; i=krzysztof.kozlowski@linaro.org; h=from:subject:message-id; bh=rxHbd8ZN2Gnll5CmN6olaVIKBgECJTgaQrtvW4I7hxI=; b=owEBbQKS/ZANAwAKAcE3ZuaGi4PXAcsmYgBm3v1gk6LT/h4VMebCtZMbJoCRkBZvx8KAMANRf n9s9srNC/uJAjMEAAEKAB0WIQTd0mIoPREbIztuuKjBN2bmhouD1wUCZt79YAAKCRDBN2bmhouD 161kD/9Lp6g4Ua2xpAlNHKFc2J5G5EkSOmL9wRmeRWCqsIzq5Ao0p02ZQ/8kTCNSxibJ8bPQuIK m64QJ0LFlP7nWIYw91ctKvfqnOy9UrHRju3r8U7TXRUYNFab/vQ3BrceR6gpzcLhFXvfTX5En9+ JRGMtRd5J5AiGl5VBp5TIig09DqDdVkFCEpKDBn9zj49laVzNo+V3xue8dnGynTAxW9z2buAKmw gMI3QvQEEk3fqKFNxGFJExDUoC6NHK5qBENhj4+JjHPbYN+gS0KSxwYT3EfTxhE6ufKfpoQzaOX 2bvZ9kMCCaaayjeO4s/J0YlxHCdjAnFy0iTRQ3Q+lWkWbCoYT8KKOU54FAEfvqVZl1M1lCQ6OeG lg/enr2QZKSc3XG6+Qld8the0DM7gOehFJyT02OTsv7Q4Mk93qun+f38yHQOuxZxJCcBmIZCRDr 1udf/OsmXR9Gl0qG/QEslImmSd2+1Kw1McycPnPgPWMGc9hhQtxycEKTzCqDDS/+Pq8rgBZ23em Ck/jxoX3WTakTQHwWJBUqXjZzFeBhpEWY+yGphtd7kJMlyHZoHCbUfloX27j8SAas98RNlyQxpM Tt5GlM0LkHrEzEyWqRpdSva0G/5/lYGNTKtPDYZWm+xvCXgM4jEa5Zx8VCwN0F7GpxQwPiL9omy hTqm9UKegqYPonQ== X-Developer-Key: i=krzysztof.kozlowski@linaro.org; a=openpgp; fpr=9BD07E0E0C51F8D59677B7541B93437D3B41629B X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240909_065152_714619_31281238 X-CRM114-Status: GOOD ( 12.85 ) 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 The max77826_regulator_info.rdesc is assigned once and never used again. Signed-off-by: Krzysztof Kozlowski --- drivers/regulator/max77826-regulator.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/drivers/regulator/max77826-regulator.c b/drivers/regulator/max77826-regulator.c index 5590cdf615b7..4b656a694108 100644 --- a/drivers/regulator/max77826-regulator.c +++ b/drivers/regulator/max77826-regulator.c @@ -153,7 +153,6 @@ enum max77826_regulators { struct max77826_regulator_info { struct regmap *regmap; - struct regulator_desc *rdesc; }; static const struct regmap_config max77826_regmap_config = { @@ -246,7 +245,6 @@ static int max77826_i2c_probe(struct i2c_client *client) if (!info) return -ENOMEM; - info->rdesc = max77826_regulators_desc; regmap = devm_regmap_init_i2c(client, &max77826_regmap_config); if (IS_ERR(regmap)) { dev_err(dev, "Failed to allocate regmap!\n"); From patchwork Mon Sep 9 13:51: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: 13797144 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 93E5AECE57A for ; Mon, 9 Sep 2024 14:01:53 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Cc:To:In-Reply-To:References :Message-Id:Content-Transfer-Encoding:Content-Type:MIME-Version:Subject:Date: From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=44T3QUDlrtSOShQgg80wGa+L2spfOTUwB+D2KVKSm5A=; b=B+VEym5ckBD+riahY6IMMhtMIa yA+9CeiEO7YD/EjbkTae4DkaMxmt+eFYg03AgnHt7NKHx3wFpKHEL6pnG9IU8Uj97L9OVjAntDSun CNChnWphZirHYH2pQ5o5acWQUZb/jnKgw+FjlG5Q8sW3NvmCNkBJcVD86rgyIi+OxvOuhdQs5/pOf u8KK07mNN95FhORqLnXvKSdDSxQEByk6L24EgVrYWJyPYMQq5LDEkajyhtd7Jb5cZlIBK/DLeK6qW h3vkQeCIe08enRExKMwQy9oSTjhB12BHoMCDI/dLfxU3zVi7EA4787h1pBIRjfpcHPDRT/3HZQKGw D/uLO3zA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1snexY-00000002Bf2-18IO; Mon, 09 Sep 2024 14:01:40 +0000 Received: from mail-ej1-x632.google.com ([2a00:1450:4864:20::632]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1sneo6-000000028g2-1j0b for linux-arm-kernel@lists.infradead.org; Mon, 09 Sep 2024 13:51:55 +0000 Received: by mail-ej1-x632.google.com with SMTP id a640c23a62f3a-a8a913874b8so24325566b.2 for ; Mon, 09 Sep 2024 06:51:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1725889913; x=1726494713; darn=lists.infradead.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=44T3QUDlrtSOShQgg80wGa+L2spfOTUwB+D2KVKSm5A=; b=SZ8yi/sgkUYoxLTfg1PFRYSXiUjh7jgIbfx8+KK07WhGVViI1b30iMJuAto+AiB/jR VuesFJF4yAF5Lhr02orOAuiXHWqmQpNfLx9bXE6aLqUZ36XOEfqMbUzEyTvVvcundmGN XxOc0IIulmo48yVJWlxwwf3QtC7f3lWOepxQnBZ9zEDV/BHHaObohflA6Ftc+81fIi5Q QlMEX82PjA1S4q1LLwjExHp9S3MpIUEQ+iQRxd6GbOK+1IF7JXIQA/qm7U+kUvCYJhNh QxVsO3CAEH/wnZ1LINSse/uWnbFWwDz/5YMKHehY8AYSlbvyySNaQHR3oBWBwBouAx6H myAQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1725889913; x=1726494713; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=44T3QUDlrtSOShQgg80wGa+L2spfOTUwB+D2KVKSm5A=; b=w8iY/u/SGtk3TJQ6yilNU6LJK3RAs61n+3Iklz5bBNEgmNVtb+32ia1FzsMFkbnC/3 IeU0qL5QfhEljsXKn8nVfyeRwd9Uf0j5PzBdqAmlUPuXnTHv4hQBI3gOxseNom6b1GH7 XydPKwdBtLdOamBk1YvXsbZ/MZIfhP0+BT+m56WOnmnQ/GZGHeCK65hIhk918UTid9N3 K7CDNrqVolu7Ta/OPwBdVKIN8nTBMFsf+qPrR9Wg3V31UPQGYXyP2UaYbKUwN7sIkNQ9 0gSArRczzmCqztVXYOal+yy07Lli/e0eGhOQvSUNj24k5hsMgMUxUmESu+9x+g4bfsGO 8cJQ== X-Forwarded-Encrypted: i=1; AJvYcCUGDP+Gtu1Lhgq3FGplElb4KexDyIPcrr9h+3U6jn9ZjK3kRjnHUQUPDnW84U/3/FLnplBwrQO+OJIYJ51diNQV@lists.infradead.org X-Gm-Message-State: AOJu0YyJYtl85Ycl1KIYIBcCmXXdR1fnso/xoqv8q41DlThRUXqUIGNk mC2DQxxSU4I9Ch6RWpVl3x0+340ui78hGyCvID+gZgn/wE9PpuFdCl3DMiVBubY= X-Google-Smtp-Source: AGHT+IGk9hZB0pHua/chSXERPAQ5CN/NBt3Z65k1DtKhjg05ctc2/lMYUaXmWILfKfO+QjhqrWN6NA== X-Received: by 2002:a17:907:7f24:b0:a8d:2624:1a81 with SMTP id a640c23a62f3a-a8d262425b1mr217028666b.12.1725889912561; Mon, 09 Sep 2024 06:51:52 -0700 (PDT) Received: from [127.0.1.1] ([178.197.222.82]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-a8d25cf3ad6sm345344566b.148.2024.09.09.06.51.51 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 09 Sep 2024 06:51:52 -0700 (PDT) From: Krzysztof Kozlowski Date: Mon, 09 Sep 2024 15:51:21 +0200 Subject: [PATCH 10/17] regulator: max77826: Constify static data MIME-Version: 1.0 Message-Id: <20240909-regulator-const-v1-10-8934704a5787@linaro.org> References: <20240909-regulator-const-v1-0-8934704a5787@linaro.org> In-Reply-To: <20240909-regulator-const-v1-0-8934704a5787@linaro.org> To: Support Opensource , Liam Girdwood , Mark Brown , Matthias Brugger , AngeloGioacchino Del Regno , Bartosz Golaszewski Cc: linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org, linux-arm-msm@vger.kernel.org, Krzysztof Kozlowski X-Mailer: b4 0.14.1 X-Developer-Signature: v=1; a=openpgp-sha256; l=890; i=krzysztof.kozlowski@linaro.org; h=from:subject:message-id; bh=795en8GaERiwJn6rOfhvPyay4QNcnSep7UjxTkcJ3Mc=; b=owEBbQKS/ZANAwAKAcE3ZuaGi4PXAcsmYgBm3v1hg8AgiknaqdgK+QeL6eWRxLilY4eGOB9I7 VzqfGreegyJAjMEAAEKAB0WIQTd0mIoPREbIztuuKjBN2bmhouD1wUCZt79YQAKCRDBN2bmhouD 14XnD/4oSkc1OBYURG8FgVQJOiazLpoxduGRxjx7OGJtTLWiqLTszBmdOLY4L9bw/jZtrnwGiem UMtSHu2H3c4kCyG4oYsD+TWiP2xIa+fey3CAghooYlxJ1kgI/mAEL0UlGpA7byTHEjNPhrIyC/T lA1XLi2juHLKbC5/oP0WoLbgC70kGC9fqGOjfh3vrrMKhdIKlX5FHAYtDJ1/8RtTx7j023w5lSV RAlGBJgndI/7dx61sFHF0DL+TJEala5Jpyger5lPv7njuQc3gPajk248CejWqWC8pH/eiEqgtyO URIftNm8SfINoOR0YD3oDdfRmj2/l5vsymPjloXDOFvj2LF/1yPZ6JK3evtL49z6O2z6s8eeJXS Zi2tdu0vA32j4A6pDEXTm0i5bD5qIVQldM86sMTaqgCB9RHU+qfQ1AytvB3TQzdMhHxI4tJ8OMw bFRL7zbMZNGwyYXJaxjQA3wiOU7pBOR61M3QOwjOJG1Uv2c87S0uepNcJ+okq+CfyXUsSNSNbYQ aKgvis/E5bOVarcjmnES6UZqvirYOIHfNUo+HN130bcwEGOY80BZ1rUiYLk4wZSv7JTDDTijoqH EU4nwqNhX3QBsv0K0G669sjpLHX0fovxwLYrxg1hgUPGH3TMmU9KNmlTYoK8TXGlk6vMPJ2pz3C pGegNyy+hIMcnyw== X-Developer-Key: i=krzysztof.kozlowski@linaro.org; a=openpgp; fpr=9BD07E0E0C51F8D59677B7541B93437D3B41629B X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240909_065154_514897_D8FA5CE5 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 Driver does not modify static data with regulator description (struct regulator_desc), so make it const for code safety. Signed-off-by: Krzysztof Kozlowski --- drivers/regulator/max77826-regulator.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/regulator/max77826-regulator.c b/drivers/regulator/max77826-regulator.c index 4b656a694108..310bc8ee7af8 100644 --- a/drivers/regulator/max77826-regulator.c +++ b/drivers/regulator/max77826-regulator.c @@ -186,7 +186,7 @@ static const struct regulator_ops max77826_buck_ops = { .set_voltage_time_sel = max77826_set_voltage_time_sel, }; -static struct regulator_desc max77826_regulators_desc[] = { +static const struct regulator_desc max77826_regulators_desc[] = { MAX77826_LDO(1, NMOS), MAX77826_LDO(2, NMOS), MAX77826_LDO(3, NMOS), From patchwork Mon Sep 9 13:51: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: 13797145 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 5B429ECE579 for ; Mon, 9 Sep 2024 14:02:56 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Cc:To:In-Reply-To:References :Message-Id:Content-Transfer-Encoding:Content-Type:MIME-Version:Subject:Date: From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=2Ca+bwI9Pu7F3YUoAaUsqSsRV8VpFvNoCThNciak41Q=; b=wSA+1h8OyWppjGvpCJC4fKXF4j q6V8LuHC4PKaiFlzCBvsWPuBujBPefo+icUL5I088LLVfe3yCzI/F3OD3WfNIGAlbiyLt9a8Lh2Fj g9DX3lbZf5eXTp0t4+TZa+ZJMfI6kMcl90dGQHklVdSQwCgH7h46PoxEf1JL0/gTdEcwJTOfqCjZk 3lrj4ZR4I6frOr//XH72uCjLK0FsmE0HFZxoNPCPTC2kE/nx1NWJPgfFaQiml3zhx8YqV6JR0joF/ P8lZOnNYv2WT2zQ1tDbp0T3RO0lggsKM8/Wa9o6oIPn2fA5lBMuLRjMMxefDgNoNLc9GfwlYSnBXy lqMBoqEg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sneyY-00000002Byf-1hFc; Mon, 09 Sep 2024 14:02:42 +0000 Received: from desiato.infradead.org ([2001:8b0:10b:1:d65d:64ff:fe57:4e05]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1sneoB-000000028kW-1wpf for linux-arm-kernel@bombadil.infradead.org; Mon, 09 Sep 2024 13:51:59 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=desiato.20200630; h=Cc:To:In-Reply-To:References: Message-Id:Content-Transfer-Encoding:Content-Type:MIME-Version:Subject:Date: From:Sender:Reply-To:Content-ID:Content-Description; bh=2Ca+bwI9Pu7F3YUoAaUsqSsRV8VpFvNoCThNciak41Q=; b=VjC/OwnYssyvFfWQyoZHBbuiYD HiWQqRo77OnhgzSrx3N2DOxfxbTOuzaxwrJriD26UmBDJHLIExjcwErUR3Gl36x+++esKr7ctR4wf K+oCpeO9KNeb1FgQfRQXQmIlLmStovFyIphsOvsA1GAtRoWebbsqLNEuSLZJhimszSmpFrmTK9v14 irRUNEJld9dl2Gk4dyqDaQRzbfECkdojk06T+JRihizKxQrwRYxLHnLMpKkYF4sjHc5o/ENKTQ7CB 6/AS1Gjq98wohxzH89Sk3uG9MtwOZygz4kFoY+zHI//EzpgS+YKue3qa14GqSD8QxZsBUZR8rjAG4 T1ls2TaA==; Received: from mail-wm1-x32a.google.com ([2a00:1450:4864:20::32a]) by desiato.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1sneo8-00000000Ree-1sPD for linux-arm-kernel@lists.infradead.org; Mon, 09 Sep 2024 13:51:58 +0000 Received: by mail-wm1-x32a.google.com with SMTP id 5b1f17b1804b1-42cb198f23fso2612075e9.1 for ; Mon, 09 Sep 2024 06:51:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1725889914; x=1726494714; darn=lists.infradead.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=2Ca+bwI9Pu7F3YUoAaUsqSsRV8VpFvNoCThNciak41Q=; b=StCt5cXjmNoG1x66ABoUGefZ/XcKjqSZiWxSPAyQ/yB/lw/X9rKVPMWG+CyI1XGcZg tTUzc17SELTjXUZaoKp7RorvPPTwNNFIbDWV5b6pfbJAAlw5BJjjmDzoM7lCcOfET7nq GhyN0ajWo1baEEcdFYeY6fgrTfemUWoz5HAi5uofE5wm09ccPvaSCNoWAPj5HpSWTDim OJ1Zok/gGQSKHuSnF+D5K/F8SuzZK3MV1FO4wX3o/OradXCi5YzYeU3OhFjSHnxcnpGS I4YtMmHcrJiT+e85bgw4VqWLBoQUcWRdgrwoiWlz0H7wf3S/7937mSsEB4DftSbV4ulz HjUA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1725889914; x=1726494714; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=2Ca+bwI9Pu7F3YUoAaUsqSsRV8VpFvNoCThNciak41Q=; b=f6K+z6uAtljxmrD/RiN6+T6jWILEH7kfsf8Q5pFTSuBjNTP/6UIHBHEP3FbMRHruhZ Kv7ZvF1RKLH7l5qrq/2q1gHIAEZ5v6/K7pBPjSYPhzTAEO3W528IhesAh+4MUijHbrtG mpVWUuT9p0VMiSJXz8MjpJEunw+QNnzddKnomJo7t+0dUEVqEHfNtDESLl0Y0dziIW3z uUt4bNkLPXxR9hCa0AkoPhqi0lkV3x9761L9A0GnUPdSNbBrwjHeAHzABl3YUD4vxt+H F9AfSTvQmtsoYyWC226aLel3/j+vOH9sJ8UjBhjR/CQp8Cc0CPMZd0keC8twv9qRfjhL Iuog== X-Forwarded-Encrypted: i=1; AJvYcCUO9kmNrBq8dluv46kFMViGKru+//Z5dn2mTqwWFgo+BceLU/H2WjgA4+GmgOUcLpTTAhB/P4v8YYbu1/tkN/mx@lists.infradead.org X-Gm-Message-State: AOJu0YxoWFU6kO5hPYpV3wraqeDtoH0xMpaJyzOhU25ldvXie3y6y00A GpSnLlmTObKfN64c9T8czIxAwyxCpkjGRidfYKQknOPl8ZZT9/y5MX75xGZhypI= X-Google-Smtp-Source: AGHT+IHwSOk/fpUD97Xcan+P+CIOyJe34rmyJqYvmDhNziRzvW/wcrZnoC+6JMIT/uTXpLghlRozEQ== X-Received: by 2002:a05:6000:18a5:b0:378:955f:d242 with SMTP id ffacd0b85a97d-378955fd30emr2248356f8f.12.1725889913898; Mon, 09 Sep 2024 06:51:53 -0700 (PDT) Received: from [127.0.1.1] ([178.197.222.82]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-a8d25cf3ad6sm345344566b.148.2024.09.09.06.51.52 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 09 Sep 2024 06:51:53 -0700 (PDT) From: Krzysztof Kozlowski Date: Mon, 09 Sep 2024 15:51:22 +0200 Subject: [PATCH 11/17] regulator: mtk-dvfsrc: Constify static data MIME-Version: 1.0 Message-Id: <20240909-regulator-const-v1-11-8934704a5787@linaro.org> References: <20240909-regulator-const-v1-0-8934704a5787@linaro.org> In-Reply-To: <20240909-regulator-const-v1-0-8934704a5787@linaro.org> To: Support Opensource , Liam Girdwood , Mark Brown , Matthias Brugger , AngeloGioacchino Del Regno , Bartosz Golaszewski Cc: linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org, linux-arm-msm@vger.kernel.org, Krzysztof Kozlowski X-Mailer: b4 0.14.1 X-Developer-Signature: v=1; a=openpgp-sha256; l=2139; i=krzysztof.kozlowski@linaro.org; h=from:subject:message-id; bh=zfZGJPZ+7n/u+R7h1aiFdsdkEzudbMyrWwt0mCMNVy8=; b=owEBbQKS/ZANAwAKAcE3ZuaGi4PXAcsmYgBm3v1iyrWzON70Cq7VuXn8aYsCpNlvo+gCyF8zr /RcPqSw97WJAjMEAAEKAB0WIQTd0mIoPREbIztuuKjBN2bmhouD1wUCZt79YgAKCRDBN2bmhouD 1yTND/9Kx2lZ3eCZZI46T755Vu5pa+AVNHwPIjhtgawTn9QLWZU4dx/nKarepxpIrJmJoAiNmef l9zUCIQ7tTRLh08J5eaODQJjDqqHS9iKGibJ1szkjME/jAk8tK2AuujylmN7rFF6OnjGZRy1hIX +MEkXzQnCsG3sWC79oLxmePYDAS9w79DyLnc+Y2VG416EUBy0sWemV843d/iP/ImkgfSQ8Z+rF0 NqNl+VSGgnBY0WeVjDR5J/LugNaoWcKIOo9oL0JPMMyqLCIbAyXKnZNOKH1RgJohboAaKvvRWcj pvqFAWqbP+cDOVyuibuNXPW57C0G9xz0AdR5CEvDaxMCzVsog/Mp3P+IPNH0DsLfNaLxMcub5pO 7uG43TuDc8R7IV6+0Kwgq6NsaOT+kBsDFBWodE0Kh2TzOv2uZ2COlbSO4fhWQ4xD+D4oOwxNtVa tkUbOckx0oRsGIXgLDv4DqJxJrzypzsLm12PnHbgKcTSps9z5zMpn193f6UCX6fJO9G6V5/GbFg sqWqNLxaDkdNgDua3Pl4lXKyL+90l4ssXiY9uwL788ThSvGGxE4eazeXMUmZ54lNbDvsDYJVzVj ozpmtPHcblf+kCN45ItBbo+Di94pYfYELDshUwux8NWiV61d+WNWYfAV21pMl+w6F26s8fo25Qh ymgij+ek/OQx8QQ== X-Developer-Key: i=krzysztof.kozlowski@linaro.org; a=openpgp; fpr=9BD07E0E0C51F8D59677B7541B93437D3B41629B X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240909_145156_624296_A5298457 X-CRM114-Status: GOOD ( 15.28 ) 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 Driver does not modify static data with regulator description (struct regulator_desc), so make it const for code safety. Signed-off-by: Krzysztof Kozlowski --- Have in mind that to compile this code, you need pending (off-tree) patches, which I applied. --- drivers/regulator/mtk-dvfsrc-regulator.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/drivers/regulator/mtk-dvfsrc-regulator.c b/drivers/regulator/mtk-dvfsrc-regulator.c index 9bf4163221f1..f5662c569464 100644 --- a/drivers/regulator/mtk-dvfsrc-regulator.c +++ b/drivers/regulator/mtk-dvfsrc-regulator.c @@ -19,7 +19,7 @@ enum dvfsrc_regulator_id { }; struct dvfsrc_regulator_pdata { - struct regulator_desc *descs; + const struct regulator_desc *descs; u32 size; }; @@ -107,7 +107,7 @@ static const unsigned int mt6873_voltages[] = { 725000, }; -static struct regulator_desc mt6873_regulators[] = { +static const struct regulator_desc mt6873_regulators[] = { MTK_DVFSRC_VREG("dvfsrc-vcore", VCORE, mt6873_voltages), MTK_DVFSRC_VREG("dvfsrc-vscp", VSCP, mt6873_voltages), }; @@ -122,7 +122,7 @@ static const unsigned int mt8183_voltages[] = { 800000, }; -static struct regulator_desc mt8183_regulators[] = { +static const struct regulator_desc mt8183_regulators[] = { MTK_DVFSRC_VREG("dvfsrc-vcore", VCORE, mt8183_voltages), }; @@ -138,7 +138,7 @@ static const unsigned int mt8195_voltages[] = { 750000, }; -static struct regulator_desc mt8195_regulators[] = { +static const struct regulator_desc mt8195_regulators[] = { MTK_DVFSRC_VREG("dvfsrc-vcore", VCORE, mt8195_voltages), MTK_DVFSRC_VREG("dvfsrc-vscp", VSCP, mt8195_voltages), }; @@ -159,7 +159,7 @@ static int dvfsrc_vcore_regulator_probe(struct platform_device *pdev) return -EINVAL; for (i = 0; i < pdata->size; i++) { - struct regulator_desc *vrdesc = &pdata->descs[i]; + const struct regulator_desc *vrdesc = &pdata->descs[i]; struct regulator_dev *rdev; rdev = devm_regulator_register(&pdev->dev, vrdesc, &config); From patchwork Mon Sep 9 13:51:23 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Krzysztof Kozlowski X-Patchwork-Id: 13797146 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 BA970ECE57A for ; Mon, 9 Sep 2024 14:04:58 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Cc:To:In-Reply-To:References :Message-Id:Content-Transfer-Encoding:Content-Type:MIME-Version:Subject:Date: From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=yX0ieRX3qt7UlOSEcKeb4ov5m9CKVjYZ6v64GoSji2o=; b=30aD/1TiacAXMamSWAexiwsUDc pKVLg0HNxoeonUZobPaM++66DhV+U2lfOQViQ25JAI+n01xEgxkH9x3fEh6ijvwIUZ5R2LRiroKl/ pGXc4dKLvSCoLqK6kd/LOmHLnAOhx0ufrPUocgtv7ZmsBzSfCtlpWN5LdOXzp7vbRczO7niu4lHfI O8Ql25TfIwDlbfStjuEwrInn8i5GtO6RnG+KXRCly+K8zfRUjqe5e3oPkJYD+h2Q9tuoSj8CMyFfe tFK5hZttNhgBJ9AGBWwuGzIsZb7vKx0dVd89Umgn8xoz0B9RrWXR1fC898Hy6KYEIZS2TQksQ/dxZ DGXUXlzw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1snf0X-00000002CPQ-2YxK; Mon, 09 Sep 2024 14:04:45 +0000 Received: from mail-ej1-x633.google.com ([2a00:1450:4864:20::633]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1sneo9-000000028hp-1lgG for linux-arm-kernel@lists.infradead.org; Mon, 09 Sep 2024 13:52:00 +0000 Received: by mail-ej1-x633.google.com with SMTP id a640c23a62f3a-a8a7dddd2c3so30093566b.3 for ; Mon, 09 Sep 2024 06:51:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1725889915; x=1726494715; darn=lists.infradead.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=yX0ieRX3qt7UlOSEcKeb4ov5m9CKVjYZ6v64GoSji2o=; b=JS2FMpPU0vCjzJRajiZHgzPEvKoF1qCWx6vqBTxO7oAMuF0EcZ5Jl8CkVUxDJ3j4df iFcgLOHDxYVz9FbCbspzBh1o80YFpWRay2+B4RAfbMCtq8AXcZ0Fh8B2emkPjWNjIL6I VA+VbVLq7PB80LCZCy5bIuHNZmrWDwGxWlcrrrzZmOgn44I/50E+Pi25tL6kR9egfGdX OMp6P9+iSfVjNFubnQfxoY2+nWG6EWDbcaR1UKI9YUAR6Ezajf/uOy7UQreNg8PlGVED KsueY76tdWjJc/40+4QXCLMuOJ6CeWh3cbAI3qMmU9NPqwrWCI+Vyax7NG8yERTSRyNT xVJA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1725889915; x=1726494715; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=yX0ieRX3qt7UlOSEcKeb4ov5m9CKVjYZ6v64GoSji2o=; b=lj0rzJZ+2y2n3EoANPj1O9GV6FYnZHxLbWaP7vG5eL9aNcsHV5ZNpRM2iodtPQQzAT oDB/H0vFWfdu+58tb4K41FHRcCwEYKwooWHIQHu7xyL3DCHMXdOKuz5LKksPho4YvC7g Fw9H2Gb8bxfz2BbYIEL76eii3/3+TrUB2y4u/c8Roi80ZnpOjCTnK4sTGUv8oicZlszD tUEWX1ZiG3FzIvd9A/rDLj5iRjdtXwFh9eNTxQQp/WMF1duCpc9k4WQUobS4gZoVuHBM eX5XzX80zZXzVrPMBYk+8MCjLshChpQHS0GNB2a1eR8CoPR8AOGEtn0oyR5f/KpOxuhR Od4Q== X-Forwarded-Encrypted: i=1; AJvYcCV1SqUSFqv3EwsXI4YhpaD/zlEushpXSefb7wndQnL9lUKT+OCchcJGPnArfHJ3qtsPSbsHgXlvh+iUGxAY4Kqh@lists.infradead.org X-Gm-Message-State: AOJu0YyW5C8U+rtOMgubOlpjxflQYDNKJ87YkNYvS/eNILKDd9gqDyk3 XrH1lTQqoMjyGm6vo9faH/O+SatQDI/+GzhdNZMAvC+oEpDSuBUmgzfv1o6Q/bShrIrWPCrm7OQ R X-Google-Smtp-Source: AGHT+IHCG4aOhWEoDHhp4VlM/hSRsuN52yWkPHfFAEGYdvVImYzvsFpKRpyVze8PsPQZpSmUk8de4A== X-Received: by 2002:a17:907:7212:b0:a80:ed7e:8468 with SMTP id a640c23a62f3a-a8a882725e1mr381160866b.0.1725889915394; Mon, 09 Sep 2024 06:51:55 -0700 (PDT) Received: from [127.0.1.1] ([178.197.222.82]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-a8d25cf3ad6sm345344566b.148.2024.09.09.06.51.54 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 09 Sep 2024 06:51:54 -0700 (PDT) From: Krzysztof Kozlowski Date: Mon, 09 Sep 2024 15:51:23 +0200 Subject: [PATCH 12/17] regulator: pcap: Constify static data MIME-Version: 1.0 Message-Id: <20240909-regulator-const-v1-12-8934704a5787@linaro.org> References: <20240909-regulator-const-v1-0-8934704a5787@linaro.org> In-Reply-To: <20240909-regulator-const-v1-0-8934704a5787@linaro.org> To: Support Opensource , Liam Girdwood , Mark Brown , Matthias Brugger , AngeloGioacchino Del Regno , Bartosz Golaszewski Cc: linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org, linux-arm-msm@vger.kernel.org, Krzysztof Kozlowski X-Mailer: b4 0.14.1 X-Developer-Signature: v=1; a=openpgp-sha256; l=2714; i=krzysztof.kozlowski@linaro.org; h=from:subject:message-id; bh=MS4Vn8NDElkbWDEAQWJiCHTN4oDL8ETlvc4aO5xEqXE=; b=owEBbQKS/ZANAwAKAcE3ZuaGi4PXAcsmYgBm3v1ipR0PFario11XiOMREeg6br4HZqWH6heoy GID0BAwI3aJAjMEAAEKAB0WIQTd0mIoPREbIztuuKjBN2bmhouD1wUCZt79YgAKCRDBN2bmhouD 1+kjD/4yE+PIP+59j+gU/cUsfasMKH6r1asR/aM3IqmfKNUATk6MFUoNDDqUNZZnvEQ2gXzj2kL ThFAHRQoOCDMk/5me0Qil5BYYCS7NVWojWcIA/GVUsB90Zc4bYWmSZxs4UijN3cVkqmqT4ddIHK tBcOZmJ9sibK9TVjWT5DjKslzyWfB1WjU2v0w42c6pFD5D4OOdrXMHg1EhcEgb+DsObz20hKhTD JH+rPF33xMlY6zwl0/fcmgxM4uQv2+yLuyhGKg9OFDdcYtXICXhc3Uk7+Uky79VqwLP9hnoyGll Ps0YHrHaeFLkVFErLkBvJtfe8C0+z0LvhmyM8Hwu8OICUSQ1SImwdzggxP/8aIGVSmYCTIxUhmM fEgimd1EJZxM9199uNr2fXFFSw7+2jgiOoVcYC18cQieDZU6mkhTkysZeY7YcVrzF49oNuYSONr GIDEw65D1QWqcpSwx7HEXOwfROB8RgQgoo2D41EYaE1hrqLob34BEAhOqAVZhAWAfUiOYhMkz3O ENspkvf9K2h/6v13cIsrsKnUqjA0C49v0h5EG375HB3awPv3EBQHxCN3ZeDcSWT8qoMJ646n+qC aPfIJZXhcERGnaRZVS6MtRl5WezHcyJ71zGeqitfhtptvvt9rfqHlRQ+fLDtqjjy03WFiT05ZGr a4zrHL0vlDmpXiA== X-Developer-Key: i=krzysztof.kozlowski@linaro.org; a=openpgp; fpr=9BD07E0E0C51F8D59677B7541B93437D3B41629B X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240909_065157_605036_25988C75 X-CRM114-Status: GOOD ( 13.54 ) 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 Driver does not modify static data with regulator description (struct pcap_regulator), so make it const for code safety. Signed-off-by: Krzysztof Kozlowski --- drivers/regulator/pcap-regulator.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/drivers/regulator/pcap-regulator.c b/drivers/regulator/pcap-regulator.c index 319a88412154..441c9344aef7 100644 --- a/drivers/regulator/pcap-regulator.c +++ b/drivers/regulator/pcap-regulator.c @@ -105,7 +105,7 @@ struct pcap_regulator { .lowpwr = _lowpwr, \ } -static struct pcap_regulator vreg_table[] = { +static const struct pcap_regulator vreg_table[] = { VREG_INFO(V1, PCAP_REG_VREG1, 1, 2, 18, 0), VREG_INFO(V2, PCAP_REG_VREG1, 5, 6, 19, 22), VREG_INFO(V3, PCAP_REG_VREG1, 7, 8, 20, 23), @@ -141,7 +141,7 @@ static struct pcap_regulator vreg_table[] = { static int pcap_regulator_set_voltage_sel(struct regulator_dev *rdev, unsigned selector) { - struct pcap_regulator *vreg = &vreg_table[rdev_get_id(rdev)]; + const struct pcap_regulator *vreg = &vreg_table[rdev_get_id(rdev)]; void *pcap = rdev_get_drvdata(rdev); /* the regulator doesn't support voltage switching */ @@ -155,7 +155,7 @@ static int pcap_regulator_set_voltage_sel(struct regulator_dev *rdev, static int pcap_regulator_get_voltage_sel(struct regulator_dev *rdev) { - struct pcap_regulator *vreg = &vreg_table[rdev_get_id(rdev)]; + const struct pcap_regulator *vreg = &vreg_table[rdev_get_id(rdev)]; void *pcap = rdev_get_drvdata(rdev); u32 tmp; @@ -169,7 +169,7 @@ static int pcap_regulator_get_voltage_sel(struct regulator_dev *rdev) static int pcap_regulator_enable(struct regulator_dev *rdev) { - struct pcap_regulator *vreg = &vreg_table[rdev_get_id(rdev)]; + const struct pcap_regulator *vreg = &vreg_table[rdev_get_id(rdev)]; void *pcap = rdev_get_drvdata(rdev); if (vreg->en == NA) @@ -180,7 +180,7 @@ static int pcap_regulator_enable(struct regulator_dev *rdev) static int pcap_regulator_disable(struct regulator_dev *rdev) { - struct pcap_regulator *vreg = &vreg_table[rdev_get_id(rdev)]; + const struct pcap_regulator *vreg = &vreg_table[rdev_get_id(rdev)]; void *pcap = rdev_get_drvdata(rdev); if (vreg->en == NA) @@ -191,7 +191,7 @@ static int pcap_regulator_disable(struct regulator_dev *rdev) static int pcap_regulator_is_enabled(struct regulator_dev *rdev) { - struct pcap_regulator *vreg = &vreg_table[rdev_get_id(rdev)]; + const struct pcap_regulator *vreg = &vreg_table[rdev_get_id(rdev)]; void *pcap = rdev_get_drvdata(rdev); u32 tmp; From patchwork Mon Sep 9 13:51:24 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Krzysztof Kozlowski X-Patchwork-Id: 13797147 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 E9F7BECE579 for ; Mon, 9 Sep 2024 14:05:56 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Cc:To:In-Reply-To:References :Message-Id:Content-Transfer-Encoding:Content-Type:MIME-Version:Subject:Date: From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=AYJy8WgMUAn0VEuaq5aXmaoEnUqoMBjQF+74z8dXbcI=; b=FWshvg/Ude36N/rw2Bb0vEf9c1 9m/lMPPvEbJHi6zanLMoPsiFcVnDDG4IiJ+34Fm7PVX7DHyWToGjqC+7Ga3lRcTJeojx7GRLcEGBL zzbQ/2/I0378/1d04tJL9l0SHZ7TUui3/OeY9fO6nn8cRHVc4ghpj74xZymgKNYTZC0PuJJc5nky8 66bBBqXnf1yvmoLC9QN+SGwBbcDxhl8Ve1AvnUcveiktkMOEUZyJdo9n/ed9lkehc5xg8qr2Go5Vl s+OIjvGsn3FC4l76P61PZe9+al3n57QObMZuIyfXN8amAoYYJvWPD8G/3xClNgcynAsoidP7TUxFs VT9g35Xw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1snf1W-00000002CcI-0NRI; Mon, 09 Sep 2024 14:05:46 +0000 Received: from mail-ej1-x636.google.com ([2a00:1450:4864:20::636]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1sneoA-000000028ji-402X for linux-arm-kernel@lists.infradead.org; Mon, 09 Sep 2024 13:52:01 +0000 Received: by mail-ej1-x636.google.com with SMTP id a640c23a62f3a-a8a7dddd2bdso18419966b.2 for ; Mon, 09 Sep 2024 06:51:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1725889917; x=1726494717; darn=lists.infradead.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=AYJy8WgMUAn0VEuaq5aXmaoEnUqoMBjQF+74z8dXbcI=; b=IsOn+8pYQQm1qM1EwNFPkcuKKQhqvKA4gWTBxzvBNKS49dWzqshanuI5WM9jw1ndLJ xEGqt7BXMNxNIEdWo5pIjpZjfwM+QAz7VlJBXyNupVmU/uQpfZZGsM2LVnbcJQaylpmd 9VqD0Z+vJLlM162Plfnhy0ISGAXwR9IpWcbt6ntZtYfKlX29J5tQhvEU9V5MZxT/Dea8 2XeMEN4k9bkWiDcJ320M0exOqV4MAGUPCzhfYGg9BZDwi3fA7QmL/C3LvIbTjXEbHxPo PRI7j5xqfsDrDdXFeDpWkas0ZAD11zV4NfY6L2VDZPbeIDsSdiNhBOv90SP4fVqViKy0 JCiA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1725889917; x=1726494717; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=AYJy8WgMUAn0VEuaq5aXmaoEnUqoMBjQF+74z8dXbcI=; b=RLW1R8LNIaPhbbuzrdzwzHLgtAjCpNVdo1h5tLZCdBE7/D1PgzohI9aoaJ3WzvlJto OH/TfRdHA4wj5JsRgMBCI57zdXV7G2LXIE+X7dXI0saIEYQU3m1MrX4iIO59yTpG1sSb Fh6FOpjtUY2rQdBglKxeROpn7iQVqRTDjxbyaY0B7XNrofvq9ZNJFl6iHWxitmgaa24S 00CR1cdIl9i01ag381+txo1NXC1aR3xDoEfxjS9UCkS5Bo3rhc90MUxT85pn7u3Slah7 GrAL5uMue68vghtgbDaaPCmh5tSCERWfi3gzzG5GKaOAazb1wDv8bQxmp8K4qAXi2KY0 /rLQ== X-Forwarded-Encrypted: i=1; AJvYcCVTW2+If8EOdfBhcyj6F3jCoRhpRCIZvSSIe5n8olpCg0fOiNDwt7OEzxTonP7Jfhp+1s0L44DROaQvYWGlnIBe@lists.infradead.org X-Gm-Message-State: AOJu0YzKguhG03VDi8LGDsrbAH2m6LI1MlTOPITLwi4Q2E7bNr59IZuv Dqm5CjlwXNOcDlh06mhsBPj3pgKhCx6rIl/ITPA/tbRlXh955A96jbOxt9HRwpw= X-Google-Smtp-Source: AGHT+IGzfXZ15lM7AABSl1WEEBoTSjYJRhQxhU3CuhHvNSnGY43koVrWg9eO+EQ6ZFAnE+Rywyd0Lw== X-Received: by 2002:a17:907:da3:b0:a83:70d0:7a1e with SMTP id a640c23a62f3a-a8a888e61a0mr406855066b.9.1725889916851; Mon, 09 Sep 2024 06:51:56 -0700 (PDT) Received: from [127.0.1.1] ([178.197.222.82]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-a8d25cf3ad6sm345344566b.148.2024.09.09.06.51.55 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 09 Sep 2024 06:51:56 -0700 (PDT) From: Krzysztof Kozlowski Date: Mon, 09 Sep 2024 15:51:24 +0200 Subject: [PATCH 13/17] regulator: pfuze100: Constify static data MIME-Version: 1.0 Message-Id: <20240909-regulator-const-v1-13-8934704a5787@linaro.org> References: <20240909-regulator-const-v1-0-8934704a5787@linaro.org> In-Reply-To: <20240909-regulator-const-v1-0-8934704a5787@linaro.org> To: Support Opensource , Liam Girdwood , Mark Brown , Matthias Brugger , AngeloGioacchino Del Regno , Bartosz Golaszewski Cc: linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org, linux-arm-msm@vger.kernel.org, Krzysztof Kozlowski X-Mailer: b4 0.14.1 X-Developer-Signature: v=1; a=openpgp-sha256; l=2916; i=krzysztof.kozlowski@linaro.org; h=from:subject:message-id; bh=HRKyZjGM94NkFQ6StvG56VA5RTKeFKEABwUAsw2nTr0=; b=owEBbQKS/ZANAwAKAcE3ZuaGi4PXAcsmYgBm3v1j85Ng6PdTzeDBq/rz5MGVUOdHrew/KeKhR UAfJ5DrtbyJAjMEAAEKAB0WIQTd0mIoPREbIztuuKjBN2bmhouD1wUCZt79YwAKCRDBN2bmhouD 1yq9D/9tEjTOPlkRyFze0AvTYAD9mQWQGKm7MqyAuFjex4vzWptpuDisJx4iUpkQGmRhr25LLQX oXu120pBSWEDyQFmdFWxvR1i6Xjdl9p8ssy7QiCXyXw9LWTDUxT2v26LV5QzupmqthvQ0mEH6ae Kk7gQmRAnIMnVliMEojJJ2KkwvVrye1X+xfnycZobF2ebIi82li/lQ5fDcEyLsm/g89FKLP723D en12o+9U4G6pVLlxeXMDXfxXojQtJzrkujgF6AMsRsuxZs6e6bZJck4wyPC1M2lbdFN7/Y9l4Wp xAIahb3R59XqJ1OMcHNHo897iLmXClURj3Q0ENgymMYfRcVdaqyUTRDal3wXBcfMdfAEwb6d47+ miiThY7QV7kjifx3aZGRwEX6JnwRkw+BZqtTuTw90GwNDsSCEZI6DuHZWWvBPRYiPYqEBWBiTzL yrtKPWp0HEb138JnN1PW505GszshVpkyNd8ghcmPCrmrhOk9HZsVdBd5cU9CY2mv6xEwW+n6loy 51xKnNZ/RYG+mu5B8VhF623N1mZPISanAnuYhEjXfbZI28dSOs75HHcrdVbfxcbjLsbJ0uPq/rj 3p7t129yZIjYUXz4cGYDgLPis2PpWCshGD0TdTvKAqo3F/xR1Yw41HJD0E14ZzKfHxyBYo/1osg UG/PHCWPadpT4/w== X-Developer-Key: i=krzysztof.kozlowski@linaro.org; a=openpgp; fpr=9BD07E0E0C51F8D59677B7541B93437D3B41629B X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240909_065159_592753_706B2F14 X-CRM114-Status: GOOD ( 14.64 ) 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 Driver does not modify static data with regulator description (struct pfuze_regulator), so make it const for code safety. Signed-off-by: Krzysztof Kozlowski --- drivers/regulator/pfuze100-regulator.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/drivers/regulator/pfuze100-regulator.c b/drivers/regulator/pfuze100-regulator.c index 7c04870442d3..7d56c22b5e40 100644 --- a/drivers/regulator/pfuze100-regulator.c +++ b/drivers/regulator/pfuze100-regulator.c @@ -76,7 +76,7 @@ struct pfuze_chip { struct device *dev; struct pfuze_regulator regulator_descs[PFUZE100_MAX_REGULATOR]; struct regulator_dev *regulators[PFUZE100_MAX_REGULATOR]; - struct pfuze_regulator *pfuze_regulators; + const struct pfuze_regulator *pfuze_regulators; }; static const int pfuze100_swbst[] = { @@ -367,7 +367,7 @@ static const struct regulator_ops pfuze3000_sw_regulator_ops = { } /* PFUZE100 */ -static struct pfuze_regulator pfuze100_regulators[] = { +static const struct pfuze_regulator pfuze100_regulators[] = { PFUZE100_SW_REG(PFUZE100, SW1AB, PFUZE100_SW1ABVOL, 300000, 1875000, 25000), PFUZE100_SW_REG(PFUZE100, SW1C, PFUZE100_SW1CVOL, 300000, 1875000, 25000), PFUZE100_SW_REG(PFUZE100, SW2, PFUZE100_SW2VOL, 400000, 1975000, 25000), @@ -386,7 +386,7 @@ static struct pfuze_regulator pfuze100_regulators[] = { PFUZE100_COIN_REG(PFUZE100, COIN, PFUZE100_COINVOL, 0x7, pfuze100_coin), }; -static struct pfuze_regulator pfuze200_regulators[] = { +static const struct pfuze_regulator pfuze200_regulators[] = { PFUZE100_SW_REG(PFUZE200, SW1AB, PFUZE100_SW1ABVOL, 300000, 1875000, 25000), PFUZE100_SW_REG(PFUZE200, SW2, PFUZE100_SW2VOL, 400000, 1975000, 25000), PFUZE100_SW_REG(PFUZE200, SW3A, PFUZE100_SW3AVOL, 400000, 1975000, 25000), @@ -403,7 +403,7 @@ static struct pfuze_regulator pfuze200_regulators[] = { PFUZE100_COIN_REG(PFUZE200, COIN, PFUZE100_COINVOL, 0x7, pfuze100_coin), }; -static struct pfuze_regulator pfuze3000_regulators[] = { +static const struct pfuze_regulator pfuze3000_regulators[] = { PFUZE3000_SW_REG(PFUZE3000, SW1A, PFUZE100_SW1ABVOL, 0x1f, pfuze3000_sw1a), PFUZE100_SW_REG(PFUZE3000, SW1B, PFUZE100_SW1CVOL, 700000, 1475000, 25000), PFUZE3000_SW_REG(PFUZE3000, SW2, PFUZE100_SW2VOL, 0x7, pfuze3000_sw2lo), @@ -419,7 +419,7 @@ static struct pfuze_regulator pfuze3000_regulators[] = { PFUZE100_VGEN_REG(PFUZE3000, VLDO4, PFUZE100_VGEN6VOL, 1800000, 3300000, 100000), }; -static struct pfuze_regulator pfuze3001_regulators[] = { +static const struct pfuze_regulator pfuze3001_regulators[] = { PFUZE3000_SW_REG(PFUZE3001, SW1, PFUZE100_SW1ABVOL, 0x1f, pfuze3000_sw1a), PFUZE3000_SW_REG(PFUZE3001, SW2, PFUZE100_SW2VOL, 0x7, pfuze3000_sw2lo), PFUZE3000_SW3_REG(PFUZE3001, SW3, PFUZE100_SW3AVOL, 900000, 1650000, 50000), From patchwork Mon Sep 9 13:51:25 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Krzysztof Kozlowski X-Patchwork-Id: 13797152 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 97221ECE579 for ; Mon, 9 Sep 2024 14:06:57 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Cc:To:In-Reply-To:References :Message-Id:Content-Transfer-Encoding:Content-Type:MIME-Version:Subject:Date: From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=go5+dPyR/CU/+h6S38uOSI6svsd8/ygd6Agr2YKEpkk=; b=W63Z65C7GALyuSkJ2RkADHGRA9 zXcFcJebymQuWTZOgdRCo03hA6sMg+nO8IbLR6XruES28piEXeWoPpSMkAwP7o0Li3f08Q+/k6LNO HSvzPNeIqkDjMQ+3dmF7i4Em0OmlEK8lvbNNTrAyiRA3ewGCAGAw/i+tBssLc/eaRjolzZki7WJmz k0hoa0SUzTmn6Z4C02iNj9J6jbDBOVO7pdA4dXybjiBqNhM72niv7A3E6YKnQ5kxRI3x8L5icl9Ed BaVOlIZhkLaGR0aI3XgeZc0NDXw29QntWfb5GHvL1qSEuyX/T2VTyooTirn+wf2BmuOnzTAw2DZzi mcquHklw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1snf2U-00000002Cjv-1Pba; Mon, 09 Sep 2024 14:06:46 +0000 Received: from mail-ed1-f44.google.com ([209.85.208.44]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1sneoD-000000028lO-0CRh for linux-arm-kernel@lists.infradead.org; Mon, 09 Sep 2024 13:52:02 +0000 Received: by mail-ed1-f44.google.com with SMTP id 4fb4d7f45d1cf-5c243ef5322so847128a12.3 for ; Mon, 09 Sep 2024 06:52:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1725889919; x=1726494719; darn=lists.infradead.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=go5+dPyR/CU/+h6S38uOSI6svsd8/ygd6Agr2YKEpkk=; b=o4zqincT+AT8sVQ5tMPNI4YU00DtQ3DRtti/Xz9KzUWR7zkLGHR9ANhdpmvx++PIq6 U5ZjP/OFffN3vFT+L/jiAwEMtAWFNWOVnISEXGpAWGF0hYPXgUxMdfirtZKul8cGkhGr QdOap3FWXlUls9+REl7noTWxEQgnvu2Gzy95Dk6WkZ0l1sMKYvSaLHL+xqC8s/ZLF34h 9J9IdkmkFCdKpfuAmUKDQCkifgMegNhK8isSOkekSxFP6ixl2vWRMmAdllPk+l1DYajS 6Sx8dIbTvGhxuPmXm3Z5kjGaGHOlnP/jcL5mAZ6T3UDDF+cUziSkV2Xkve2ihX4FnU1j VBWQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1725889919; x=1726494719; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=go5+dPyR/CU/+h6S38uOSI6svsd8/ygd6Agr2YKEpkk=; b=ik3U2rhU4GlJmHfny/8Je2arr5TdkIQ7OnhwTb5dBUnfZP8gMe/datAujkEceiezTU z8gG9X6cEZvBJSgMZHBTwXJ1B+vv3uY4F0nIq7tZKlfByAApbXESqmcL9PcSQkhyeOzS zI7YE7lX0dDBky1BXYbFtQQxXr+tUdOtl4CDYK2q63V1vEB5odbj3yBtdct5u+mzV/f1 gIvAAK+tBBwv/n0Rj4meB/UTrvxbHMuXkcyBBC+F2cHVJnB8yH+cLQSUGSDWoHHV+Lfa OnJuNEvsVOhKNWZhYMIEwJuikb4r2UALNgVPidiNJa4Feq2eFs7kQ1VLTjvjhTAReP6W 9Mdw== X-Forwarded-Encrypted: i=1; AJvYcCVqVG7+PRb4/WV8DSHdCpxqPJF7CoZ7EwcCgYvkpnakIU0ZTyp7tteMs4+Zw8D9nHMzSEIX0rvbpnw4mHG0Uka5@lists.infradead.org X-Gm-Message-State: AOJu0YwsXx6QxutSPLy8FjbKOuuwH2Y19Cw+wXwJgPdpoKnYgK0gkI2l xIRKdNbvfPJJKFuUrvfPtxCIp7TsQj0oR6aQsBJU5AdaL4filhvf828AEUF2nwk= X-Google-Smtp-Source: AGHT+IGy1tiHdaQw1EmLxWCIRZx0QTX7/qecRmbSfYliJR+FY+WlBher2f7vPLzcYnQtkfCEQty3qw== X-Received: by 2002:a17:907:daa:b0:a86:83b1:5d94 with SMTP id a640c23a62f3a-a8a885fa928mr395447566b.3.1725889918257; Mon, 09 Sep 2024 06:51:58 -0700 (PDT) Received: from [127.0.1.1] ([178.197.222.82]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-a8d25cf3ad6sm345344566b.148.2024.09.09.06.51.57 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 09 Sep 2024 06:51:57 -0700 (PDT) From: Krzysztof Kozlowski Date: Mon, 09 Sep 2024 15:51:25 +0200 Subject: [PATCH 14/17] regulator: qcom-refgen: Constify static data MIME-Version: 1.0 Message-Id: <20240909-regulator-const-v1-14-8934704a5787@linaro.org> References: <20240909-regulator-const-v1-0-8934704a5787@linaro.org> In-Reply-To: <20240909-regulator-const-v1-0-8934704a5787@linaro.org> To: Support Opensource , Liam Girdwood , Mark Brown , Matthias Brugger , AngeloGioacchino Del Regno , Bartosz Golaszewski Cc: linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org, linux-arm-msm@vger.kernel.org, Krzysztof Kozlowski X-Mailer: b4 0.14.1 X-Developer-Signature: v=1; a=openpgp-sha256; l=1177; i=krzysztof.kozlowski@linaro.org; h=from:subject:message-id; bh=KcmtvuFpgJTQr+NrBtSfkFBmPuXrmTaJALoNQh34mgc=; b=owEBbQKS/ZANAwAKAcE3ZuaGi4PXAcsmYgBm3v1khpb7WzxyunM5lYXMazdM4ujdBKnR1uNAG IJMqHk63k6JAjMEAAEKAB0WIQTd0mIoPREbIztuuKjBN2bmhouD1wUCZt79ZAAKCRDBN2bmhouD 1xTvD/9iDwh1+cEyfWNjyNGqc4y9wqU0ZzDeg3tyTbYWtWgBrDXX4gYRWsD0etQouIuhs83FC5m 7m67B+n4Q7QjrfQUtSTkfGWvYGHjLQ/RooOdXrg4+dfjO6myAtqeTeaHlNZu74tr0xVQMocpWC2 CpBT9Ek9UtovGtrVKAqsQhsSbMXSek1w7kB/u3fnRe6Z7N13lKr8XjBaqaaRPsqfS032KXyQ3uv Le3dFP+wqoLN+CqPjM6LMPx8iRceIuX1rSb1CpJgJaf+zLVAVMi5ZitneFTPpWjFHEWw9i2ZxX1 atam2jSgTHB3NgxVpjBoaayFmWv6Rwq5uBmrYvXVpKSK92NHqDmd0hxrq3G3Xl8bF1hpCDtkqVi QhNR3/DD87VK4Jt/7pPG4f1RYHZhNl9qJ2jEqQwLFVfK+GqI1xLCRsl5TY3i6dWXHHqV0KTOtw6 lJn32B6vGS9haLMgSBewc356tSJEBwE6QpycGFI+ENmABZSJvasyHqXQL563bHFyQvHOhCNjsaD R1We9KqaUZJALCSELvgzu0qBevYrx9Yw5VqdwW4id3C4UjPXdVOzId9mlYN2laxcb1+RkTbyEIr yENminEQ5sFMNejQBF6CUF8SBl08MgdL43RBCT7XKPzK4MbNt9K8Uwgn6NVVVrICJgXS0rscTtM y/G9xuQdIzo4sZQ== X-Developer-Key: i=krzysztof.kozlowski@linaro.org; a=openpgp; fpr=9BD07E0E0C51F8D59677B7541B93437D3B41629B X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240909_065201_157083_B66B4C99 X-CRM114-Status: GOOD ( 13.48 ) 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 Driver does not modify static data with regulator description (struct regulator_desc), so make it const for code safety. Signed-off-by: Krzysztof Kozlowski --- drivers/regulator/qcom-refgen-regulator.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/regulator/qcom-refgen-regulator.c b/drivers/regulator/qcom-refgen-regulator.c index 063e12c08e75..cfa72ce85bc8 100644 --- a/drivers/regulator/qcom-refgen-regulator.c +++ b/drivers/regulator/qcom-refgen-regulator.c @@ -62,7 +62,7 @@ static int qcom_sdm845_refgen_is_enabled(struct regulator_dev *rdev) return 1; } -static struct regulator_desc sdm845_refgen_desc = { +static const struct regulator_desc sdm845_refgen_desc = { .enable_time = 5, .name = "refgen", .owner = THIS_MODULE, @@ -74,7 +74,7 @@ static struct regulator_desc sdm845_refgen_desc = { }, }; -static struct regulator_desc sm8250_refgen_desc = { +static const struct regulator_desc sm8250_refgen_desc = { .enable_reg = REFGEN_REG_PWRDWN_CTRL5, .enable_mask = REFGEN_PWRDWN_CTRL5_MASK, .enable_val = REFGEN_PWRDWN_CTRL5_ENABLE, From patchwork Mon Sep 9 13:51:26 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Krzysztof Kozlowski X-Patchwork-Id: 13797154 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 1E778ECE57A for ; Mon, 9 Sep 2024 14:08:59 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Cc:To:In-Reply-To:References :Message-Id:Content-Transfer-Encoding:Content-Type:MIME-Version:Subject:Date: From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=5Qz5yF8W3jl1pLAFz+0oNTHhctIS0pggkjmDEQxrtgU=; b=zDTx6FU0h7FsW0279hGX8ryMp3 Ejizx2dEIK0STbIRgaTaKbkWulCyDgGtV/683uPwoZC2fEJ+Evd0hbr63pUCSIvSg61Qoa6Q7ww4w oGLyeHWjypVAyM9um04l3Yea59iEWp/qMuLhz5Knsr/M4uVwrSzczx/0Xgay47tDciP2gJfzTievZ Vjsor2x8enTtzG91rFxS2OW9jqU6iop2FkHylUaDYSrVhfJKmbC1hH0QxgJWuthR3nHAePjxI+MoM +ZbDXC9sNtcYua2tySGpjIvOVEnEv2w9oI/tOc6VNMYrcH3u1k9wAWIWFzR/TGxQxnu7dd5Mds81i lhEVgSAw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1snf4R-00000002D2u-1LAP; Mon, 09 Sep 2024 14:08:47 +0000 Received: from mail-ej1-x629.google.com ([2a00:1450:4864:20::629]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1sneoD-000000028lu-3H4R for linux-arm-kernel@lists.infradead.org; Mon, 09 Sep 2024 13:52:04 +0000 Received: by mail-ej1-x629.google.com with SMTP id a640c23a62f3a-a8d14fa17daso24052966b.0 for ; Mon, 09 Sep 2024 06:52:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1725889920; x=1726494720; darn=lists.infradead.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=5Qz5yF8W3jl1pLAFz+0oNTHhctIS0pggkjmDEQxrtgU=; b=e/R5WrPOLFEJHGEn4ttp7JygmxpwBMBL4eE4HZGYOzTTDbx+bbK51VGe7NyfKaagu9 wovIWw71FjF1yX317GSBZ2ZcZ3x8Nan/okYp/uMepeXSvRM0/TwpLXdD5LArJHAvaUTS OVe8k/ScE4KK6TBd8aO0e8t5WSncEkuC0um+ZVcw3RK65MaoQfxLhd/Odsczd0Z1sWaz ozJ2hB6WMJdciSgu0c9FvfrAYy8Mg5XbxMg+/IOs0Bbey2RPDKZqninS38tszoTwlb97 XrTUpWd28L7nECqLwmuX5PXKjjeIzAK1Gg3GN+GGx7UhKVeYf4NMAIIcII/g0TCW1X3O Yyzg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1725889920; x=1726494720; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=5Qz5yF8W3jl1pLAFz+0oNTHhctIS0pggkjmDEQxrtgU=; b=o7AeFWPAjfBHf1DXeN4BKOni1bMO/Gh/fU5l2XalPpmsnX4JMcTEQ5eL4KK/uQY7/U 9Br24AyfDLvpukvWk05tKkQDMequ+ZBt7GthrW8EJkE3kJllgKzuaT7sr7kRUsG+cIKO m6z33gLN+BFSXJuqAG4E/sdmjpXWuqnrLZoyFO/HB+F0Q9iUzscj5gqFNNmDa5AS4MFG kqqdjXhPyPg0siV4F01DG1LlgeodWDKTAzmiKPSF3l8V3nIGH/HaXQDf3nrimzQBip4U btmVP3uymxYupZU5Q5UDIYO2sNIErFVrFRpAap8DeVbCQXC09AQe9UBvY7IJ3F0jAQBC omZw== X-Forwarded-Encrypted: i=1; AJvYcCVH+QbAKb7nBSbuNscYoK1bdgA/2M6UG7eRkhbYVZFLEDHt7RRFyGrPJO0LOVXkDHUL+OaC1D2+ZvovD2t8dDzn@lists.infradead.org X-Gm-Message-State: AOJu0YwZl5ZXsEPK9qhtyES56fDSrgx63501hZUigOuii2ffdwLi1SeI alBeIlhxVdf97iqbQT9OjQ6pHAy/Xa2Gr0CoqAtbNszUffUVfyRInDw5O64H6Zs= X-Google-Smtp-Source: AGHT+IHSuAevAtPCygtpKBvr/DQWy/NsHdMyERpLS/rDXi0gGwd6VC/KF5cHqYfeuGYHkbx6t4QX+w== X-Received: by 2002:a17:907:3f9b:b0:a8d:2623:dd19 with SMTP id a640c23a62f3a-a8d2623e2b7mr190904166b.14.1725889920059; Mon, 09 Sep 2024 06:52:00 -0700 (PDT) Received: from [127.0.1.1] ([178.197.222.82]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-a8d25cf3ad6sm345344566b.148.2024.09.09.06.51.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 09 Sep 2024 06:51:59 -0700 (PDT) From: Krzysztof Kozlowski Date: Mon, 09 Sep 2024 15:51:26 +0200 Subject: [PATCH 15/17] regulator: hi6421v530: Drop unused 'eco_microamp' MIME-Version: 1.0 Message-Id: <20240909-regulator-const-v1-15-8934704a5787@linaro.org> References: <20240909-regulator-const-v1-0-8934704a5787@linaro.org> In-Reply-To: <20240909-regulator-const-v1-0-8934704a5787@linaro.org> To: Support Opensource , Liam Girdwood , Mark Brown , Matthias Brugger , AngeloGioacchino Del Regno , Bartosz Golaszewski Cc: linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org, linux-arm-msm@vger.kernel.org, Krzysztof Kozlowski X-Mailer: b4 0.14.1 X-Developer-Signature: v=1; a=openpgp-sha256; l=2350; i=krzysztof.kozlowski@linaro.org; h=from:subject:message-id; bh=30I+hQDkibrC4fpctSIcG7hdlAaMTfnXmLnvdZibnpU=; b=kA0DAAoBwTdm5oaLg9cByyZiAGbe/WWgVe4Femx5zZkMkuSdYYU3T+Lo1v/39prjIzLzFC2Rk okCMwQAAQoAHRYhBN3SYig9ERsjO264qME3ZuaGi4PXBQJm3v1lAAoJEME3ZuaGi4PXrZ4P/jA0 sscxqGelVqRBLU11Sgi+WZRl0920k7u9YS+qTqrF3B/ixnO5gkeFkh4TidRddSqKEWj+bKpdvWa A985jl1aSp2A42gfSWC7SYcXBpCgXKPR3E5di6RpAUS2Msj8yuwD7dJudEhah6wq+pYlfCNcI3t gdcDxs6cY8+kbdmCsRWXDs8X6PqojXuAlNlKPH9FrQolgKicOVgYfXvyQQrBFRcCrrFHgpPyhZT QMQ4Y+Vcxj5WAg057JH9m2BMVVmcUppJSaBoc1Yz1EN3ZNTm/OZY9lDFywruf24uW6wlZHz22NX RmmZIeW1AUBK7ZpSDY1/R74lzoVOH4CDNVotkjknx06o7Tme2QRHyUQdhghK73hGa4ojfkfM8sT QJ5FWuKNPfujqXIuKg8+xL2slkkJ+UJXYHL1SsIbNzNaulZXEXiO+TAJzDcChJskzf4NE/BRG9G jRPXYkMladjtkLEgp0jvX8Jg88lqSaM5XodDAyrrr/qjRcWLaFpKb4NIG8dViOlRndyg6o+pT0o kZWiKXuuzuoTtzqisFHhoSOsmDWPwmBHu2SSsFqQ0oG8eOsi3v+jwn46ji9DwGcvQu79QkLAOFq 32/amHyTfCBs9oqbF7lZOKOeBYNkW88NZysVNbLHkW52ifnuyjykX+2B4b/QR4BpGZTi4B2bPRP fQWF8 X-Developer-Key: i=krzysztof.kozlowski@linaro.org; a=openpgp; fpr=9BD07E0E0C51F8D59677B7541B93437D3B41629B X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240909_065201_931983_D3DE10CA X-CRM114-Status: GOOD ( 13.84 ) 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 The hi6421v530_regulator_info.eco_microamp is assigned once and never used again. Signed-off-by: Krzysztof Kozlowski --- drivers/regulator/hi6421v530-regulator.c | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) diff --git a/drivers/regulator/hi6421v530-regulator.c b/drivers/regulator/hi6421v530-regulator.c index 23924ff0c7b2..a9c6c077f50d 100644 --- a/drivers/regulator/hi6421v530-regulator.c +++ b/drivers/regulator/hi6421v530-regulator.c @@ -21,12 +21,10 @@ * struct hi6421v530_regulator_info - hi6421v530 regulator information * @desc: regulator description * @mode_mask: ECO mode bitmask of LDOs; for BUCKs, this masks sleep - * @eco_microamp: eco mode load upper limit (in uA), valid for LDOs only */ struct hi6421v530_regulator_info { struct regulator_desc rdesc; u8 mode_mask; - u32 eco_microamp; }; /* HI6421v530 regulators */ @@ -68,10 +66,9 @@ static const struct regulator_ops hi6421v530_ldo_ops; * emask - enable mask * odelay - off/on delay time in uS * ecomask - eco mode mask - * ecoamp - eco mode load uppler limit in uA */ #define HI6421V530_LDO(_ID, v_table, vreg, vmask, ereg, emask, \ - odelay, ecomask, ecoamp) { \ + odelay, ecomask) { \ .rdesc = { \ .name = #_ID, \ .of_match = of_match_ptr(#_ID), \ @@ -90,22 +87,21 @@ static const struct regulator_ops hi6421v530_ldo_ops; .off_on_delay = odelay, \ }, \ .mode_mask = ecomask, \ - .eco_microamp = ecoamp, \ } /* HI6421V530 regulator information */ static struct hi6421v530_regulator_info hi6421v530_regulator_info[] = { HI6421V530_LDO(LDO3, ldo_3_voltages, 0x061, 0xf, 0x060, 0x2, - 20000, 0x6, 8000), + 20000, 0x6), HI6421V530_LDO(LDO9, ldo_9_11_voltages, 0x06b, 0x7, 0x06a, 0x2, - 40000, 0x6, 8000), + 40000, 0x6), HI6421V530_LDO(LDO11, ldo_9_11_voltages, 0x06f, 0x7, 0x06e, 0x2, - 40000, 0x6, 8000), + 40000, 0x6), HI6421V530_LDO(LDO15, ldo_15_16_voltages, 0x077, 0x7, 0x076, 0x2, - 40000, 0x6, 8000), + 40000, 0x6), HI6421V530_LDO(LDO16, ldo_15_16_voltages, 0x079, 0x7, 0x078, 0x2, - 40000, 0x6, 8000), + 40000, 0x6), }; static unsigned int hi6421v530_regulator_ldo_get_mode( From patchwork Mon Sep 9 13:51:27 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Krzysztof Kozlowski X-Patchwork-Id: 13797155 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 7C95CECE57A for ; Mon, 9 Sep 2024 14:09:59 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Cc:To:In-Reply-To:References :Message-Id:Content-Transfer-Encoding:Content-Type:MIME-Version:Subject:Date: From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=HEAviafQzNR7Z9t5hpM5VZEKV85C26CtMxeL00PENiQ=; b=w70FCsNqocpKLUyqrwlEpkjNqw nBNOPtKWHloBk8dvUXDyY/6UrlLeekt/bdLlIrOS/AVJk6KXNimOLeksYXe8BHeUB7VBG1wFl1rDF uN27aPcHrbA4ECy/1SX6FV0D6gUPZl8lIY2E6VMs4GlfSCLUT2sxJU2rw/Ul8kjdcBfR6/YewC4yO hb3Nhns/LLwLlsqthQna8f+8Mmi73FdvsM81kBBUp+nLCWgcqqj3stKS1vC3XUsiw4/IdI5PrPvXs zHE0vPkKwgem2R9YBJaVRv+IBW1vFzRhAb1B+ZrFJJacCMbT224XoTGQlYxAGdVwEEmCBU/3Bdx0m PezCgO/A==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1snf5Q-00000002DKH-2lvR; Mon, 09 Sep 2024 14:09:48 +0000 Received: from mail-ej1-x62c.google.com ([2a00:1450:4864:20::62c]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1sneoF-000000028nI-16IU for linux-arm-kernel@lists.infradead.org; Mon, 09 Sep 2024 13:52:05 +0000 Received: by mail-ej1-x62c.google.com with SMTP id a640c23a62f3a-a8d14fa17daso24054466b.0 for ; Mon, 09 Sep 2024 06:52:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1725889921; x=1726494721; darn=lists.infradead.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=HEAviafQzNR7Z9t5hpM5VZEKV85C26CtMxeL00PENiQ=; b=umz3a2BuKOn7ZCejY4QATVctQB7TStZtXNJFSbMPKG+hVDpUy+Xi77Nj+O8NJ+CQov JbfsuSlbHNbHkW/z768MRV5ssv2VgslmWBbICDxzMupkQUUBUyIqbNYjzOpFk1EKd7qt RM2kvtfq6l/WK9DjJKd2YI9A/qZD3Zr1Jw6k/O0Ko8VZsXFiMGlSDc7/LeBZLbk/2+NJ IbOpc7EnjkyKcT0Kc/yaP91RRTsCcPQJFYFZ2rnMzvCoyDtQbrgeICrH3yEFJVGALL8a WYN6jwJDdFSKfEX4XyWRp79UuxJ6NHjXO6W7TPcr8DOVIJDSlXyyHdYk/esrFkqpvPiB BjZw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1725889921; x=1726494721; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=HEAviafQzNR7Z9t5hpM5VZEKV85C26CtMxeL00PENiQ=; b=l0ucLOd0F/Pt+PW3q+YOVzKb7KQA1NX6VzuPvq+jN5xB1qsj/SReDpAuBdMqdcCCHH zm8vDFS8ONGpzG6z4mz2496XwjLEHfXcFeUmHevfePwBZtzH7WqsTzRVVrCvJiyG97Hx LWMcAdHuxkyNS458aJnNfK+nbUP1/OtTbpXrxAM7SCjYhkSWD7pEI6OrlfoFgB/rx2o0 PocgD/fx3QQ8XCZarUJrgfag3IXU1UeCPDlkalokjuCioArkoqRzLuChgS7+9TQzX2F6 F2/DD1ocm6WYE27IzWMU4hq0U/4RxnG5OKnXqDa2uygghcczjUQqJr0WIsF1o+zsyKm8 KhKQ== X-Forwarded-Encrypted: i=1; AJvYcCXImdQ3VZpnYT6frr/9pi6EhEhRSElPOw/t3uUR4RzQtK+k0TewWI/hNjhyMN9YbFgkkpgN/pE9pzN8s+K7Jndh@lists.infradead.org X-Gm-Message-State: AOJu0YzkO1+WAqCrerXvAmwKkcNdz0cyCME5H6OzSRqVFCn5tvoSTEWU SVt8v3n3QDk5J7d4Np5K53DIu/g5gfJHF2J6+vgm5jw6V3y2KLKwsg6II2NEPz0= X-Google-Smtp-Source: AGHT+IGUrqfpjeRf1rMAe7mjAkRWErGkoP/w4iRCRemp+gCnfBdE5Yx7pYFApwpFKe1jn6l3HlkbcA== X-Received: by 2002:a17:907:3d8b:b0:a80:a193:a509 with SMTP id a640c23a62f3a-a8a885bdde7mr356155466b.2.1725889921408; Mon, 09 Sep 2024 06:52:01 -0700 (PDT) Received: from [127.0.1.1] ([178.197.222.82]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-a8d25cf3ad6sm345344566b.148.2024.09.09.06.52.00 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 09 Sep 2024 06:52:00 -0700 (PDT) From: Krzysztof Kozlowski Date: Mon, 09 Sep 2024 15:51:27 +0200 Subject: [PATCH 16/17] regulator: hi6421v530: Use container_of and constify static data MIME-Version: 1.0 Message-Id: <20240909-regulator-const-v1-16-8934704a5787@linaro.org> References: <20240909-regulator-const-v1-0-8934704a5787@linaro.org> In-Reply-To: <20240909-regulator-const-v1-0-8934704a5787@linaro.org> To: Support Opensource , Liam Girdwood , Mark Brown , Matthias Brugger , AngeloGioacchino Del Regno , Bartosz Golaszewski Cc: linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org, linux-arm-msm@vger.kernel.org, Krzysztof Kozlowski X-Mailer: b4 0.14.1 X-Developer-Signature: v=1; a=openpgp-sha256; l=2454; i=krzysztof.kozlowski@linaro.org; h=from:subject:message-id; bh=QfpMH8xpX7M5v1cNMdTuKAFwaOO0ijMMMrIuqJNJ7Fc=; b=owEBbQKS/ZANAwAKAcE3ZuaGi4PXAcsmYgBm3v1mbrrIu6Do6kppOFM21iGEOSQnx+wr6TRGX MTTtX77+QKJAjMEAAEKAB0WIQTd0mIoPREbIztuuKjBN2bmhouD1wUCZt79ZgAKCRDBN2bmhouD 17PsD/49SlTRgOuT9opobBE999Eo0XMLtC18q26ggdv3vW/9xY53TZacc1sfclw2LWcHUPAzpMk v2yz16QkZK0z0MiqCpwIM3z7/b4Idk/YJQxNscRM645bKHaNxlYeBVQgXRpX/rgPYKwne7RRCzS 2G8wCmaSA7KTQ4OK0I/VX1B1w1PVLAdlTp1DajYRjpFMQyCbeGMx1dw2pHFCVEZnGklOtB+JXZw F24rxvpdFzaZTvbSrR8OA3Qr0AbdGSNsvBjJxWxMKNmeXehb9q4X7PeP6NMEWyZuZahJhIwjPuK 4GjDbix7naxDG3LRLFvXQVBTd3tTtlrmarGiqUrWr48TKoOIiXQ9+3DhtiZbU0jen/scVfhLIXN JLmEHol/WBUI0ziNAnJcMtWHmUDZeQZgehGHviTxSEQvRoCRJi8cR8jVrPFXBOeWXUp5+cELP7+ e9OPitc1nA9XIsdv9Is1SNjUSSH8fQGeNLDqzfSNPLkGqGDi8HE/QlkfwsNJ27ITARLbditccpc 3OaBBhaAb6Ejc/HnYwA1EcFNkR+iwRN8RBLJqsGC7GVr9tfTtG1CZDKj8B9TfcLpEpCBvVTcmUd wa85RJKRg3BgCuNk3/bEnS44Ywg8avfJ5Q66Hu84715P6hvPDUVsjB8PJSrlaN477J5Bxa2URNo S2rXdeUiFplSo8w== X-Developer-Key: i=krzysztof.kozlowski@linaro.org; a=openpgp; fpr=9BD07E0E0C51F8D59677B7541B93437D3B41629B X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240909_065203_349976_350F310D X-CRM114-Status: GOOD ( 16.17 ) 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 Switch from rdev_get_drvdata() to container_of(), so the static 'struct hi6421v530_regulator_info' holding 'struct regulator_desc' can be made const for code safety. Signed-off-by: Krzysztof Kozlowski --- [RFT]: Not tested, only built. --- drivers/regulator/hi6421v530-regulator.c | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/drivers/regulator/hi6421v530-regulator.c b/drivers/regulator/hi6421v530-regulator.c index a9c6c077f50d..b3ebd1624814 100644 --- a/drivers/regulator/hi6421v530-regulator.c +++ b/drivers/regulator/hi6421v530-regulator.c @@ -91,7 +91,7 @@ static const struct regulator_ops hi6421v530_ldo_ops; /* HI6421V530 regulator information */ -static struct hi6421v530_regulator_info hi6421v530_regulator_info[] = { +static const struct hi6421v530_regulator_info hi6421v530_regulator_info[] = { HI6421V530_LDO(LDO3, ldo_3_voltages, 0x061, 0xf, 0x060, 0x2, 20000, 0x6), HI6421V530_LDO(LDO9, ldo_9_11_voltages, 0x06b, 0x7, 0x06a, 0x2, @@ -107,10 +107,10 @@ static struct hi6421v530_regulator_info hi6421v530_regulator_info[] = { static unsigned int hi6421v530_regulator_ldo_get_mode( struct regulator_dev *rdev) { - struct hi6421v530_regulator_info *info; + const struct hi6421v530_regulator_info *info; unsigned int reg_val; - info = rdev_get_drvdata(rdev); + info = container_of(rdev->desc, struct hi6421v530_regulator_info, rdesc); regmap_read(rdev->regmap, rdev->desc->enable_reg, ®_val); if (reg_val & (info->mode_mask)) @@ -122,10 +122,10 @@ static unsigned int hi6421v530_regulator_ldo_get_mode( static int hi6421v530_regulator_ldo_set_mode(struct regulator_dev *rdev, unsigned int mode) { - struct hi6421v530_regulator_info *info; + const struct hi6421v530_regulator_info *info; unsigned int new_mode; - info = rdev_get_drvdata(rdev); + info = container_of(rdev->desc, struct hi6421v530_regulator_info, rdesc); switch (mode) { case REGULATOR_MODE_NORMAL: new_mode = 0; @@ -172,7 +172,6 @@ static int hi6421v530_regulator_probe(struct platform_device *pdev) for (i = 0; i < ARRAY_SIZE(hi6421v530_regulator_info); i++) { config.dev = pdev->dev.parent; config.regmap = pmic->regmap; - config.driver_data = &hi6421v530_regulator_info[i]; rdev = devm_regulator_register(&pdev->dev, &hi6421v530_regulator_info[i].rdesc, From patchwork Mon Sep 9 13:51:28 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Krzysztof Kozlowski X-Patchwork-Id: 13797156 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 C950FECE57A for ; Mon, 9 Sep 2024 14:11:01 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Cc:To:In-Reply-To:References :Message-Id:Content-Transfer-Encoding:Content-Type:MIME-Version:Subject:Date: From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=D4QKaI+3WBHRSwPufs3rtV0LI1aQyhehd6Wi2dpHTGg=; b=LV9RwNUNuMiUxAy0PFhcLmb1xL xI8NlqNkQ08hdqRcXkJr09bqjfl4MJ+tWuyYS9IFNm+omXR0dgo9uXQMl9rw+oWKol3XobJfXPTfu GJqT/I9to74rEaahKjMzJMbazsV/KiLlQ+FbzAqCZxW0skB2ULs42a60I5h/kVN9d7/93l+0/wy9C RzB92+xjLj5FtkVsmc+Pr1m98FTbjtIXPig9+qsdyBjBKiO0CaF1UG8aRpeAOfvCxGv9xYVnAXn8G i1hSvUDV0v0XcAp5rBBykaHeTgxx94+pDn22qxIT663P9PIQpN1HcTjwqVTQW27iouzKUhFdZQPd1 Mcj8f4Mg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1snf6Q-00000002DVl-0mit; Mon, 09 Sep 2024 14:10:50 +0000 Received: from mail-ej1-x629.google.com ([2a00:1450:4864:20::629]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1sneoG-000000028oo-1rrs for linux-arm-kernel@lists.infradead.org; Mon, 09 Sep 2024 13:52:06 +0000 Received: by mail-ej1-x629.google.com with SMTP id a640c23a62f3a-a8a7dddd2bdso18420466b.2 for ; Mon, 09 Sep 2024 06:52:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1725889923; x=1726494723; darn=lists.infradead.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=D4QKaI+3WBHRSwPufs3rtV0LI1aQyhehd6Wi2dpHTGg=; b=E6Gc0HYE+M0Z/ogTlilNZFiLHwVllkWPnr6pjsOeQbkpT0MRcIGhYwG7G+z0Z4IYEX uAmBRlP+sYDCqMSkMRRwcO1Mh3wRPZQ/vuQsVuG2ILRz+jmqOpEXZMaqciBELVwjdfIa 7jTmy+TPVlu3VSmO3jvZcFlnwVFyrbVZcYC2AwDVkNBujuhVx619pGQxlr1KoyWXY/0z 0yzg+BC+Xbfl1Ns89oMTDipBY56a1HR1FVzsH4/Nd5g/ZFU8Mc7uPms/wDwDO5n29/hx YUioFlj4qp2dTC6lOTJwwSlcKD3aGIbrn02QnKNr5DbZ+LgCE+3D+aCgkNNZpfelySrc bd+g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1725889923; x=1726494723; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=D4QKaI+3WBHRSwPufs3rtV0LI1aQyhehd6Wi2dpHTGg=; b=hKMfmmZhXS6854yvRZgLAxn5wbA9s4sGHrrXH4PHdloar5WY24/4rHL6nf0LKzE7pu QULPUP+jljnwr5/0icaO8ph7dmObVL/HaPHGltojDIV/AjZWGA8J48eoNi1vKU4BUv6z n4KS7+AD9fXPxJV0LvHOtnMe0FCSQol5gXy4qVbFym1vClH7DPac4N8FrBG04zunBL/m V0RyoMxzj2Vh64CImmLItQpSbMxdqmDrl0dmaZlBo1Yzen5RYXJT0/Mqnens2tvJt7kW 0/sHOiClD2yzmmG0ou4AFfqhXdVw+6zgRNbqVJzV6x+VbklcxQ0qpGTg3x+KzyyarJ2e gk8w== X-Forwarded-Encrypted: i=1; AJvYcCXRmhxMNbEDnPpQycjRnDSxHrGNRwWF4ktOUGZF28pmVXR0cLCuroXgC7QS/lRoXqnubvuRow/+a7OSAbiEj4jA@lists.infradead.org X-Gm-Message-State: AOJu0Yx2keaEOyLlDEFfKX7wTd5bcjiOH+9nValz5PFdWuE5PoRiusrG ek/g6iCDzW+PrCwouB/6iEmBy8gcqgi6MNEHVGFPql5pWh0PYqCuD2w+7nWB4rI= X-Google-Smtp-Source: AGHT+IFkB5FwZ6RP2VpeDYDu58V07W5VhL+BMyppWhQzRBjqI5M81sTuW26HDIwx4LByUJ7TdWVeBw== X-Received: by 2002:a17:907:608a:b0:a8a:7189:2106 with SMTP id a640c23a62f3a-a8a88803359mr291596666b.6.1725889922892; Mon, 09 Sep 2024 06:52:02 -0700 (PDT) Received: from [127.0.1.1] ([178.197.222.82]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-a8d25cf3ad6sm345344566b.148.2024.09.09.06.52.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 09 Sep 2024 06:52:02 -0700 (PDT) From: Krzysztof Kozlowski Date: Mon, 09 Sep 2024 15:51:28 +0200 Subject: [PATCH 17/17] regulator: max77650: Use container_of and constify static data MIME-Version: 1.0 Message-Id: <20240909-regulator-const-v1-17-8934704a5787@linaro.org> References: <20240909-regulator-const-v1-0-8934704a5787@linaro.org> In-Reply-To: <20240909-regulator-const-v1-0-8934704a5787@linaro.org> To: Support Opensource , Liam Girdwood , Mark Brown , Matthias Brugger , AngeloGioacchino Del Regno , Bartosz Golaszewski Cc: linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org, linux-arm-msm@vger.kernel.org, Krzysztof Kozlowski X-Mailer: b4 0.14.1 X-Developer-Signature: v=1; a=openpgp-sha256; l=5091; i=krzysztof.kozlowski@linaro.org; h=from:subject:message-id; bh=pT3vklV3r+mZAGNAtUkG8vU9TQS654l0/1TCGybfK8Q=; b=owEBbQKS/ZANAwAKAcE3ZuaGi4PXAcsmYgBm3v1nXIJdWNbRtDH6jLRbfKirVbrDR9hrPibYD A0gRNKrWKKJAjMEAAEKAB0WIQTd0mIoPREbIztuuKjBN2bmhouD1wUCZt79ZwAKCRDBN2bmhouD 14qVEACRgLsVdWDXrS20GsTp4A3Ag89uPdX4Lm1yhjam8q9PHA1EcqEd03qyD9++DH9J+ze5ujx c9LiuV8Y4yAXbrIxGmNWOpx5u/7JoGvGjwsAKmG4P+E5hnO96bKsupFq0ZONfubtSA7efMP65qw xfW4XKiQcPq3KaXujdFdgnhdkG8ultcDksYS2ZU/MB3hiiFytZi6dddp7Mfzx7BEHgs7yF4s9m8 yoigsGsbquv2hbcCDnb1ytwDxR+un6SE33cXwUfo5pNBXAW92nmpQbtbWykifj6vIMjV6CmbraR 52C5s+4gdyII3bdtf4HvUTcz66Asm+/9ihcxYClBn5HiA6lUefRTJjN5zqznTDK0L3zPULYVR2h WbLPZiHzj8UDkLW4aGaclTo/gCX5gAgyzDPphNHbsFx185jVuudPHcW7xU1b+9qMguFXzZIwSlp 5tmlv7aRCC/dGhe1JG9DX3G6ICnQW968kLzlnqDcw6EEHsON1+e8XB/FzHZM2TpHLPTUcRdr5D/ 1o0NHLpdQEnvyS5eZKbx08DylInn6xnZ9QbOZ4sYmBITYGcD8Ou4rdHa/lZHhBW1+E0C4QUP16t fLQaiHp2fnlt+GpZXPFrbgCuNfgB6MoliRVSldN2+bWRS5k1sbw8oTaQWBmbqNuZRtcbE5JSIsL 1RjfoAwiIZmG/ZA== X-Developer-Key: i=krzysztof.kozlowski@linaro.org; a=openpgp; fpr=9BD07E0E0C51F8D59677B7541B93437D3B41629B X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240909_065204_604209_3258DF86 X-CRM114-Status: GOOD ( 16.56 ) 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 Switch from rdev_get_drvdata() to container_of(), so the static 'struct max77650_regulator_desc' holding 'struct regulator_desc' can be made const for code safety. Signed-off-by: Krzysztof Kozlowski --- [RFT]: Not tested, only built. --- drivers/regulator/max77650-regulator.c | 31 ++++++++++++++----------------- 1 file changed, 14 insertions(+), 17 deletions(-) diff --git a/drivers/regulator/max77650-regulator.c b/drivers/regulator/max77650-regulator.c index 94abfbb2bc1e..7368f54f046d 100644 --- a/drivers/regulator/max77650-regulator.c +++ b/drivers/regulator/max77650-regulator.c @@ -43,8 +43,6 @@ struct max77650_regulator_desc { unsigned int regB; }; -static struct max77650_regulator_desc max77651_SBB1_desc; - static const unsigned int max77651_sbb1_volt_range_sel[] = { 0x0, 0x1, 0x2, 0x3 }; @@ -66,11 +64,11 @@ static const unsigned int max77650_current_limit_table[] = { static int max77650_regulator_is_enabled(struct regulator_dev *rdev) { - struct max77650_regulator_desc *rdesc; + const struct max77650_regulator_desc *rdesc; struct regmap *map; int val, rv, en; - rdesc = rdev_get_drvdata(rdev); + rdesc = container_of(rdev->desc, struct max77650_regulator_desc, desc); map = rdev_get_regmap(rdev); rv = regmap_read(map, rdesc->regB, &val); @@ -84,10 +82,10 @@ static int max77650_regulator_is_enabled(struct regulator_dev *rdev) static int max77650_regulator_enable(struct regulator_dev *rdev) { - struct max77650_regulator_desc *rdesc; + const struct max77650_regulator_desc *rdesc; struct regmap *map; - rdesc = rdev_get_drvdata(rdev); + rdesc = container_of(rdev->desc, struct max77650_regulator_desc, desc); map = rdev_get_regmap(rdev); return regmap_update_bits(map, rdesc->regB, @@ -97,10 +95,10 @@ static int max77650_regulator_enable(struct regulator_dev *rdev) static int max77650_regulator_disable(struct regulator_dev *rdev) { - struct max77650_regulator_desc *rdesc; + const struct max77650_regulator_desc *rdesc; struct regmap *map; - rdesc = rdev_get_drvdata(rdev); + rdesc = container_of(rdev->desc, struct max77650_regulator_desc, desc); map = rdev_get_regmap(rdev); return regmap_update_bits(map, rdesc->regB, @@ -145,7 +143,7 @@ static const struct regulator_ops max77651_SBB1_regulator_ops = { .set_active_discharge = regulator_set_active_discharge_regmap, }; -static struct max77650_regulator_desc max77650_LDO_desc = { +static const struct max77650_regulator_desc max77650_LDO_desc = { .desc = { .name = "ldo", .of_match = of_match_ptr("ldo"), @@ -171,7 +169,7 @@ static struct max77650_regulator_desc max77650_LDO_desc = { .regB = MAX77650_REG_CNFG_LDO_B, }; -static struct max77650_regulator_desc max77650_SBB0_desc = { +static const struct max77650_regulator_desc max77650_SBB0_desc = { .desc = { .name = "sbb0", .of_match = of_match_ptr("sbb0"), @@ -201,7 +199,7 @@ static struct max77650_regulator_desc max77650_SBB0_desc = { .regB = MAX77650_REG_CNFG_SBB0_B, }; -static struct max77650_regulator_desc max77650_SBB1_desc = { +static const struct max77650_regulator_desc max77650_SBB1_desc = { .desc = { .name = "sbb1", .of_match = of_match_ptr("sbb1"), @@ -231,7 +229,7 @@ static struct max77650_regulator_desc max77650_SBB1_desc = { .regB = MAX77650_REG_CNFG_SBB1_B, }; -static struct max77650_regulator_desc max77651_SBB1_desc = { +static const struct max77650_regulator_desc max77651_SBB1_desc = { .desc = { .name = "sbb1", .of_match = of_match_ptr("sbb1"), @@ -264,7 +262,7 @@ static struct max77650_regulator_desc max77651_SBB1_desc = { .regB = MAX77650_REG_CNFG_SBB1_B, }; -static struct max77650_regulator_desc max77650_SBB2_desc = { +static const struct max77650_regulator_desc max77650_SBB2_desc = { .desc = { .name = "sbb2", .of_match = of_match_ptr("sbb2"), @@ -294,7 +292,7 @@ static struct max77650_regulator_desc max77650_SBB2_desc = { .regB = MAX77650_REG_CNFG_SBB2_B, }; -static struct max77650_regulator_desc max77651_SBB2_desc = { +static const struct max77650_regulator_desc max77651_SBB2_desc = { .desc = { .name = "sbb2", .of_match = of_match_ptr("sbb2"), @@ -326,8 +324,8 @@ static struct max77650_regulator_desc max77651_SBB2_desc = { static int max77650_regulator_probe(struct platform_device *pdev) { - struct max77650_regulator_desc **rdescs; - struct max77650_regulator_desc *rdesc; + const struct max77650_regulator_desc **rdescs; + const struct max77650_regulator_desc *rdesc; struct regulator_config config = { }; struct device *dev, *parent; struct regulator_dev *rdev; @@ -376,7 +374,6 @@ static int max77650_regulator_probe(struct platform_device *pdev) for (i = 0; i < MAX77650_REGULATOR_NUM_REGULATORS; i++) { rdesc = rdescs[i]; - config.driver_data = rdesc; rdev = devm_regulator_register(dev, &rdesc->desc, &config); if (IS_ERR(rdev))