From nobody Thu Sep 19 10:38:52 2024 Received: from mail-ej1-f53.google.com (mail-ej1-f53.google.com [209.85.218.53]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 6FE361B7909 for ; Mon, 9 Sep 2024 13:51:41 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.218.53 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1725889903; cv=none; b=DuC3SQUHPoQ40nJzmzAqdricTKGjqnZvzEQ+IdiVPz+xYWB1ScxygvFj92ucc9/uXECYaNNioKpoUwW/+XMC5uvTpZ7NtByTG/OHR7oWe74Roiv9N1U4hK5P/JPHSEk6Bou4GKfTtRdGNe5NS3R9VSI81lzw0dHAz8xaYRTNqJI= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1725889903; c=relaxed/simple; bh=8TsG7I4Aag1KJIfppBSqZ8uVGEQPJnXHOI9sdDJkZWs=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=u2Qi4Kwu6Cl3jCyEhvtYRisJOmz0YO313++2q1VD0Prmb27Fuy9eaPqxNRZcimee2EUsEZbEKC9zFqVPhkZbu7Rqvt7l67n4Z/rQseNoMy6WVWd3fXrvuXkPoH7jZC0aZqzL0myjDn6wDfacEYIDs/AGXId1g5Gwonmd3ua1bYQ= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org; spf=pass smtp.mailfrom=linaro.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b=gBqgWF87; arc=none smtp.client-ip=209.85.218.53 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linaro.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="gBqgWF87" Received: by mail-ej1-f53.google.com with SMTP id a640c23a62f3a-a8a91c8cdd5so22182866b.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=vger.kernel.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=gBqgWF87Z9RnQhQzTOYJyONj4Vlj2QyEORatHSHsDwh5yE82KGr1CPxaTaNCnDJLOR WNm4k3/A9700Ym02QOg0fb6moM2BGrHZsi286UuPXQ9rIAH8DnzTyNAWMAxU6g4zOTCd hC/gI5hIhvutEh15g7ymS9l77gjI27KUwwIqZTQdmxafByZleQ255zXWtWcN/y7dJBt8 3j6bzzlx/zwsGMR671aHqCyLhUhLIcPPA5gTn1/swX9Cl8RJZ5K1kMEGFaYEnU6EVgs9 L3Nb1sIzqHQyZakvV6Y9FgOJdhDLorE+CEvX54clhHfG9PE1yH/44N+oI7Kw+2yQgyf1 xWOw== 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=o5eZOs4mu85Xd5cWS5Tnp9eeFficDbzH1DHc+qNR882Y16HNcoWa43bw3bc8k6Vikf rYr5EQGDhxJEJV65qujb+45G4/qfawOvlFTHlnu4pSiJfAWGZGeom0xr1G9v94UFvykV nlyFE5qCnDr54eRraO5Jrpdg4zdR6QNDcjgV9JCwtVaEFqtzNo3QzXGnnSiqA335USk6 vQAmCImTZ94SsFNf+2c5S7lmzif0iGvVHhiToxEqloAaynMp7s604V1HX56mJBidsuuM dq8f7HM3zaaNP+2+ClAjBDyR4JVM2vDB0LLqRAfMWZ4AmfoZYNRrSpDH6aoHWoTWWVFD 7GvA== X-Gm-Message-State: AOJu0YxRPU5k59mhex118S2x+KAOtwAHf/GWl6vaNuZdznwRK//JZIOh TQREvxiQcB47G4Xe2OvStNuxuEFSmLneO2aI07K+YS67eGWd8cER/CMUE0UY6RE= 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 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable 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 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/da905= 2-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 { =20 struct da9052_regulator { struct da9052 *da9052; - struct da9052_regulator_info *info; + const struct da9052_regulator_info *info; struct regulator_dev *rdev; }; =20 -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 *rd= ev, unsigned int selector) { struct da9052_regulator *regulator =3D rdev_get_drvdata(rdev); - struct da9052_regulator_info *info =3D regulator->info; + const struct da9052_regulator_info *info =3D regulator->info; int id =3D rdev_get_id(rdev); int volt_uV; =20 @@ -175,7 +175,7 @@ static int da9052_map_voltage(struct regulator_dev *rde= v, int min_uV, int max_uV) { struct da9052_regulator *regulator =3D rdev_get_drvdata(rdev); - struct da9052_regulator_info *info =3D regulator->info; + const struct da9052_regulator_info *info =3D regulator->info; int id =3D rdev_get_id(rdev); int ret, sel; =20 @@ -206,7 +206,7 @@ static int da9052_regulator_set_voltage_sel(struct regu= lator_dev *rdev, unsigned int selector) { struct da9052_regulator *regulator =3D rdev_get_drvdata(rdev); - struct da9052_regulator_info *info =3D regulator->info; + const struct da9052_regulator_info *info =3D regulator->info; int id =3D rdev_get_id(rdev); int ret; =20 @@ -237,7 +237,7 @@ static int da9052_regulator_set_voltage_time_sel(struct= regulator_dev *rdev, unsigned int new_sel) { struct da9052_regulator *regulator =3D rdev_get_drvdata(rdev); - struct da9052_regulator_info *info =3D regulator->info; + const struct da9052_regulator_info *info =3D regulator->info; int id =3D rdev_get_id(rdev); int ret =3D 0; =20 @@ -327,7 +327,7 @@ static const struct regulator_ops da9052_ldo_ops =3D { .activate_bit =3D (abits),\ } =20 -static struct da9052_regulator_info da9052_regulator_info[] =3D { +static const struct da9052_regulator_info da9052_regulator_info[] =3D { 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_in= fo[] =3D { DA9052_LDO(LDO10, ldo10, 50, 1200, 3600, 6, 6, 0), }; =20 -static struct da9052_regulator_info da9053_regulator_info[] =3D { +static const struct da9052_regulator_info da9053_regulator_info[] =3D { 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[] =3D { DA9052_LDO(LDO10, ldo10, 50, 1200, 3600, 6, 6, 0), }; =20 -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 c= hip_id, + int id) { - struct da9052_regulator_info *info; + const struct da9052_regulator_info *info; int i; =20 switch (chip_id) { --=20 2.43.0 From nobody Thu Sep 19 10:38:52 2024 Received: from mail-ej1-f54.google.com (mail-ej1-f54.google.com [209.85.218.54]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id DF3121BA270 for ; Mon, 9 Sep 2024 13:51:42 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.218.54 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1725889904; cv=none; b=pyp7yn3WKiUUvO2SGTEcgIlyHxNdjspuRv9Lvc52ioFBU7fRLY02IX7irMGH3LhWhpEs0kjO8mcPraNn7LZq9ujStl+bCNMfOFxFJzzvIpzE7Oby/xxbGbofeqtYuc7rDBM4rLYtTzPpQfJ6A6ZAX6PZdBN3sJzLgdT533/W5og= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1725889904; c=relaxed/simple; bh=7T+l2SN6pqbE6hOx06iBBg4xZdBmuecLOUZCOIFvMyE=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=Qw/0C7wS0Ft+YTWnwj30JYrvJMJZMlTQTIUInwhdsq/FVmD+jLBAkd56YKohxbJc6Pa10FZ7XX6I3caQP+NbD6R89bX6EzgHpCK/BJpGaYAxCp+YugDRV6c1d+Lu0+ePCqyFEh0GC81iuUciBwpRNIYFbgqYjttZ5yXZRPtB7l4= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org; spf=pass smtp.mailfrom=linaro.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b=iJCHW6F0; arc=none smtp.client-ip=209.85.218.54 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linaro.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="iJCHW6F0" Received: by mail-ej1-f54.google.com with SMTP id a640c23a62f3a-a8a7dddd2bdso18411866b.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=vger.kernel.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=iJCHW6F0h7vHODRF+6Sbg3dN+AmB1f5OxQ9T44Bl/q348IQdN73/cS0Axb78l82vOk U5ZouR7Q2t8c6UzbCKumkQnprA9aWaC4KRVVfNlzmI2lZ0lKaPQC8qifWl5Bu1i6OP2e x3YENUIA2ba1noh3roiO/xmfo4XuK9YHcaqeb+45HeQtCMmSquEiqf//8gCdKcTY1V7B QkoAxZHY1GNH1dH++W/RmhYRiERaYjoWin5UEzDGE8x4nH9SLkk80cNhMklyN1Fr3Yhm 73Y9WjvDFjLUsTMVBemyjp28WDPIpAU+K48SS/evii87Z1HDX1IIhLQicz295w0VZh4F ppow== 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=q+Q5c6ciOOI2chk6qUszj5HVLVk/RWBYGU9F0xRt+RcfJKXKtqBTRXxVkMCGUcf1yl SdvJZiLrCSyasKwWgoApnvpwBDyDXtJxsKksN+K+DQSTdO2FJajFL6UKJGx/7nlJf/11 OP5mm2WUNtsurMGvaOL4vACpRrBaRqlxFU2RP5SYc7RGzmZmBvW3D1+FNZhiDwBQux/U 66kw70pjimn/dVHBV5i6BAJYITR1N38LYnDiRYXmyXwd2b4Xi6D8UUvdq3FPTf4IJtWF bd/PE881wJHw6msLq2FjMSe9/kMN2/tSlZl6DUZ1ciZySQR3ei6r3PFHLOVU1xDcc1/n HOkQ== X-Gm-Message-State: AOJu0YyaRkXW14vX+ZUBGguaVQ8tCpFaqZfrohEurwvJGWyoUBRwix0Q qpnG3kewUXV+t5EtC0VPx6Gboz4Adj7azB387s5nPcXm/ow9KVcugTC9gHVLJFU= 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 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable 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 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/da905= 5-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 { =20 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 =3D rdev_get_drvdata(rdev); - struct da9055_regulator_info *info =3D regulator->info; + const struct da9055_regulator_info *info =3D regulator->info; int ret, mode =3D 0; =20 ret =3D da9055_reg_read(regulator->da9055, info->mode.reg); @@ -107,7 +107,7 @@ static int da9055_buck_set_mode(struct regulator_dev *r= dev, unsigned int mode) { struct da9055_regulator *regulator =3D rdev_get_drvdata(rdev); - struct da9055_regulator_info *info =3D regulator->info; + const struct da9055_regulator_info *info =3D regulator->info; int val =3D 0; =20 switch (mode) { @@ -129,7 +129,7 @@ static int da9055_buck_set_mode(struct regulator_dev *r= dev, static unsigned int da9055_ldo_get_mode(struct regulator_dev *rdev) { struct da9055_regulator *regulator =3D rdev_get_drvdata(rdev); - struct da9055_regulator_info *info =3D regulator->info; + const struct da9055_regulator_info *info =3D regulator->info; int ret; =20 ret =3D da9055_reg_read(regulator->da9055, info->volt.reg_b); @@ -145,7 +145,7 @@ static unsigned int da9055_ldo_get_mode(struct regulato= r_dev *rdev) static int da9055_ldo_set_mode(struct regulator_dev *rdev, unsigned int mo= de) { struct da9055_regulator *regulator =3D rdev_get_drvdata(rdev); - struct da9055_regulator_info *info =3D regulator->info; + const struct da9055_regulator_info *info =3D regulator->info; struct da9055_volt_reg volt =3D info->volt; int val =3D 0; =20 @@ -167,7 +167,7 @@ static int da9055_ldo_set_mode(struct regulator_dev *rd= ev, unsigned int mode) static int da9055_regulator_get_voltage_sel(struct regulator_dev *rdev) { struct da9055_regulator *regulator =3D rdev_get_drvdata(rdev); - struct da9055_regulator_info *info =3D regulator->info; + const struct da9055_regulator_info *info =3D regulator->info; struct da9055_volt_reg volt =3D info->volt; int ret, sel; =20 @@ -199,7 +199,7 @@ static int da9055_regulator_set_voltage_sel(struct regu= lator_dev *rdev, unsigned int selector) { struct da9055_regulator *regulator =3D rdev_get_drvdata(rdev); - struct da9055_regulator_info *info =3D regulator->info; + const struct da9055_regulator_info *info =3D regulator->info; int ret; =20 /* @@ -242,7 +242,7 @@ static int da9055_regulator_set_suspend_voltage(struct = regulator_dev *rdev, int uV) { struct da9055_regulator *regulator =3D rdev_get_drvdata(rdev); - struct da9055_regulator_info *info =3D regulator->info; + const struct da9055_regulator_info *info =3D regulator->info; int ret; =20 /* 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 =3D rdev_get_drvdata(rdev); - struct da9055_regulator_info *info =3D regulator->info; + const struct da9055_regulator_info *info =3D regulator->info; =20 /* Select register set B for voltage ramping. */ if (regulator->reg_rselect =3D=3D 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 =3D rdev_get_drvdata(rdev); - struct da9055_regulator_info *info =3D regulator->info; + const struct da9055_regulator_info *info =3D regulator->info; =20 /* Diselect register set B. */ if (regulator->reg_rselect =3D=3D NO_GPIO) @@ -396,7 +396,7 @@ static const struct regulator_ops da9055_ldo_ops =3D { },\ } =20 -static struct da9055_regulator_info da9055_regulator_info[] =3D { +static const struct da9055_regulator_info da9055_regulator_info[] =3D { 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 =3D regulator->info; + const struct da9055_regulator_info *info =3D 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; } =20 -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; =20 for (i =3D 0; i < ARRAY_SIZE(da9055_regulator_info); i++) { --=20 2.43.0 From nobody Thu Sep 19 10:38:52 2024 Received: from mail-ej1-f47.google.com (mail-ej1-f47.google.com [209.85.218.47]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 519FC1BA292 for ; Mon, 9 Sep 2024 13:51:44 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.218.47 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1725889906; cv=none; b=TL/a8EKsVIhcK5MY3B+A78/o2I4FrrEAglBi646l9eorUEUy9/ciqlSRVQUfgYuBR8QxjV4bxdLa81XOeXwNu44kwC2ZjMZscbmU0GUUGjoXb+Yh1NbCxQo6R8xC3EO1Nv1h8DQs9Yf+oTejjw/onkyAThanr4aCjkEMHN/L9Vs= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1725889906; c=relaxed/simple; bh=cimxQ+TX+25hf08Y2OSBWqQRlO/c5kpOqNI/3js1eFk=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=evDyBdGrjQ68ECANRzh6jXlboD/kAZJUpuPEbpAwVgAnlkOWxk8yAG2i4h9gFGgzdQMFL3GXEzlmKclY1i9wDxcbX6DqOQqbAbD5PPd5aGnrFRZISzq8YDoTQObltu6222RWp2JHniS0uuFtaKx7Yn85dMsfD1lM9Ih/l79ft6w= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org; spf=pass smtp.mailfrom=linaro.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b=NYMZbZj+; arc=none smtp.client-ip=209.85.218.47 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linaro.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="NYMZbZj+" Received: by mail-ej1-f47.google.com with SMTP id a640c23a62f3a-a8a765f980dso26497066b.1 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=vger.kernel.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=NYMZbZj+RsNrKVNlgN547ZBZhmw0jmPPdte76bsbeREEptbn41VNMx+pvGia/gEXvW 5HLS4mzsd5jfWOF6dvhoJJipqTsrNVPkE3/MXOcIt2UWXMCcRokmYFU5HqU/LqRfHprG Ua6xNJqxg9MuChNOvuuTqPHOF55x13uTc5aCxpc9vcMVuFdDYwxPRJHbQDxcDpD/ZYyf gfyV/BBrHg7IKiRD+C/TyvoPAJoukOZ+SJH+oTZZI1gYUZx0tNQftoSplUtxMc4BjWSY IU5bU/AAK32h1PsQA3dUFVTacvADS6o47M6HNSJu9OC1ffvDdA9iCEbSpIN9g+qdRH1g /KPQ== 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=C0w3NzvYLypX3e9ph3gBwa3CFohPYLIdFgYaI+AVZ4Onymvian4Zevzu8Z70k5o+4P TLn5u3o0eTjevABjLZvjZQUIEHyejURjgyM2fiGQ//I02to14TzyTJZ3JcW+e2CYTN3n YJRWXOT+IlhmUyx9FRl7prxA3kG4kHNIKRXbbSMZaUzKwFnTCR1mV5RTjd0OT/a3V/iC ezBkA6wb+p0eoco1i3u8AVs4Zbz749IMEcs5mz0ThJNKlvDIc4fmSdkh5hBojSuYVZKG /h890CJCTcJuivJrg4g2Bte2BpvSfJHwvsnsCVWF/BcisvcTejlJ+IWOPFwkis23Ks1m /XiQ== X-Gm-Message-State: AOJu0Yza2EiWv3g4eNYNSOlQxS6m/XTrWAC+Z/Ah396Ey6pS6lMQky9K /7AZUJbGjSDEfYC7H0k/KpAvIsYsZCZNdt1zpG9NtQmAl+5VyDJbGXG/BLr9T3I= 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 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable 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 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/da906= 3-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_regula= tor_info[] =3D { }; =20 /* Link chip model with regulators info table */ -static struct da9063_dev_model regulators_models[] =3D { +static const struct da9063_dev_model regulators_models[] =3D { { .regulator_info =3D da9063_regulator_info, .n_regulators =3D ARRAY_SIZE(da9063_regulator_info), --=20 2.43.0 From nobody Thu Sep 19 10:38:52 2024 Received: from mail-ej1-f42.google.com (mail-ej1-f42.google.com [209.85.218.42]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id B6C0C1BA87A for ; Mon, 9 Sep 2024 13:51:45 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.218.42 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1725889908; cv=none; b=hW/nHQi9lvgdp511B5xnqTBWrDddNr7xzm1PG+Oaj613huXd1DcI52GZ0MHDbreDMH74jBoCXXv91K1TklBxRdTPEZ48xEoqx+Nh2f4f1i2Ud8KruCPOi8yVShC0w7TT+zo0pRZHiCnzbyUziEvjH47yGgtR3GetkInIduldCx4= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1725889908; c=relaxed/simple; bh=NpUoubZdNxPAP0/VQA+CguJJu4K+4PwUlJgiCI3BfEs=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=H0NXwtW1OnspJ4UquqNfLPad8NFWA5RJHMgpCTk4jkgxS8yYjVCAuUstsU0Zyxx/hMh43A2S4txx5jiIRe3uvrz3p2Og3NG+iI+D2EF2CV/3KmxV8JLSeu9k591IdyqNrCrbouAfSNrITQIapka0YiKh1aU8DaIKbUcE55oaPPk= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org; spf=pass smtp.mailfrom=linaro.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b=cyoDWfk1; arc=none smtp.client-ip=209.85.218.42 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linaro.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="cyoDWfk1" Received: by mail-ej1-f42.google.com with SMTP id a640c23a62f3a-a866902708fso26993266b.2 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=vger.kernel.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=cyoDWfk1hwq23ev/0KNkf72vlqXks7zcE5fbWrbyQltFACZO79Rc64bR/T73D2iO2v EyUEqCALE8KnEA6ZuNKdlZcoBWvxSpoGAxc3cDYvxFQKqZCLQBgJBYFZYsMXUNtD7b0J 0DEdYpDFYX1oikoAxZx+DbmjLiRqpy9h7BnayCHiIftdr0J9NAgyWvXTNa2uznthVYZA SW7Ecc/I4nCqI6IJmT5hfMTxTsqdTizLvGT+bGmBms6XzbJQpzrK+CoyqDL4fM7JSi6E HpFN8BqQMh3JwnjpjT73SiSZzH5iyl6QoXL+pYpjrsnQSGDBOaWs9HWTcdCG7yiiy0os 1P1w== 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=Y/z8ExrXucx8vfEaibnBXOK6tHLT3qU3XFxarKPO4HgSiOsYQXiODJpbmclTiQhNHz jo8ZlGSi/yEIdpwZRQUoRLlnFMd9pjwzRMYw+jyNX0ofuujIMNjp1RoG8cqn0PJEaJDB 9vwkSW6ZoQUo0txSa4ESSs4GZhKgkikDQKdhcC4sItk1n9C25n5a+uftGRWR/CEnuRI5 V2qfq/brbON005rmMry3r6xKIb1Os1DfO33NGzgEOPpAR3Ynoz9gLg/yuS7IKkTb5V1N bcnKc+TrElogYDuL8DFJbjVadL95q6yXlwC9IBIzSZOY4P0YsIVoDMft+YIBTCguJS75 abBg== X-Gm-Message-State: AOJu0Yxr68xBbAi01idOxb3Vxk9nAn/6RxejJpJ7JII6KUqvKf392l9S i2oaJkN5oCqgD9+DQotJH0MV1FCWNWB4oIyiW9rSbNDpMqZ3EGm3F/rwl/aksjM= 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 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable 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 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/da912= 1-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; }; =20 -static struct da9121_range da9121_10A_2phase_current =3D { +static const struct da9121_range da9121_10A_2phase_current =3D { .val_min =3D 7000000, .val_max =3D 20000000, .val_stp =3D 1000000, @@ -61,7 +61,7 @@ static struct da9121_range da9121_10A_2phase_current =3D { .reg_max =3D 14, }; =20 -static struct da9121_range da9121_6A_2phase_current =3D { +static const struct da9121_range da9121_6A_2phase_current =3D { .val_min =3D 7000000, .val_max =3D 12000000, .val_stp =3D 1000000, @@ -69,7 +69,7 @@ static struct da9121_range da9121_6A_2phase_current =3D { .reg_max =3D 6, }; =20 -static struct da9121_range da9121_5A_1phase_current =3D { +static const struct da9121_range da9121_5A_1phase_current =3D { .val_min =3D 3500000, .val_max =3D 10000000, .val_stp =3D 500000, @@ -77,7 +77,7 @@ static struct da9121_range da9121_5A_1phase_current =3D { .reg_max =3D 14, }; =20 -static struct da9121_range da9121_3A_1phase_current =3D { +static const struct da9121_range da9121_3A_1phase_current =3D { .val_min =3D 3500000, .val_max =3D 6000000, .val_stp =3D 500000, @@ -85,7 +85,7 @@ static struct da9121_range da9121_3A_1phase_current =3D { .reg_max =3D 6, }; =20 -static struct da9121_range da914x_40A_4phase_current =3D { +static const struct da9121_range da914x_40A_4phase_current =3D { .val_min =3D 26000000, .val_max =3D 78000000, .val_stp =3D 4000000, @@ -93,7 +93,7 @@ static struct da9121_range da914x_40A_4phase_current =3D { .reg_max =3D 14, }; =20 -static struct da9121_range da914x_20A_2phase_current =3D { +static const struct da9121_range da914x_20A_2phase_current =3D { .val_min =3D 13000000, .val_max =3D 39000000, .val_stp =3D 2000000, @@ -104,7 +104,7 @@ static struct da9121_range da914x_20A_2phase_current = =3D { struct da9121_variant_info { int num_bucks; int num_phases; - struct da9121_range *current_range; + const struct da9121_range *current_range; }; =20 static const struct da9121_variant_info variant_parameters[] =3D { @@ -188,7 +188,7 @@ static int da9121_get_current_limit(struct regulator_de= v *rdev) { struct da9121 *chip =3D rdev_get_drvdata(rdev); int id =3D rdev_get_id(rdev); - struct da9121_range *range =3D + const struct da9121_range *range =3D variant_parameters[chip->variant_id].current_range; unsigned int val =3D 0; int ret =3D 0; @@ -219,7 +219,7 @@ static int da9121_ceiling_selector(struct regulator_dev= *rdev, unsigned int *selector) { struct da9121 *chip =3D rdev_get_drvdata(rdev); - struct da9121_range *range =3D + const struct da9121_range *range =3D variant_parameters[chip->variant_id].current_range; unsigned int level; unsigned int i =3D 0; @@ -259,7 +259,7 @@ static int da9121_set_current_limit(struct regulator_de= v *rdev, { struct da9121 *chip =3D rdev_get_drvdata(rdev); int id =3D rdev_get_id(rdev); - struct da9121_range *range =3D + const struct da9121_range *range =3D variant_parameters[chip->variant_id].current_range; unsigned int sel =3D 0; int ret =3D 0; --=20 2.43.0 From nobody Thu Sep 19 10:38:52 2024 Received: from mail-ej1-f41.google.com (mail-ej1-f41.google.com [209.85.218.41]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 196B61BAECE for ; Mon, 9 Sep 2024 13:51:48 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.218.41 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1725889909; cv=none; b=V5F0EFHGlLtDSsC2TF61TfnjLy4di9L404ICdFEAL8O6YFWjQdK6Itowitf8BA6ApW6aZQFjH8qxUXeqYryUqzUVty0V1FBUVR9QYXb1D5qlFTDkP1Su9/lqJ42IhddOHPRp/a+muOnjpabzKw69XLNj0Ew67fi7ioaQDnG08Kk= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1725889909; c=relaxed/simple; bh=qvFB37UNy0FXUjxrG9GIJ3EDRLNkuyXGb5mp950Q39M=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=ajPysBUDk5vSNiOgmEuxvOSPm84eSwJ1qCLDqRwpHlmnkilG2I5A/MDTm3Eb+hyGnfFDSxO291UxzlEECPyZARkcBDRMoCfzrtwlh7U9uJ2Gs9KxWMnB0ap8l5sBW+pL6ZzHmlxAbS9wSwOmAxHE3NikMaiUVt/+9M76xhHFrUU= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org; spf=pass smtp.mailfrom=linaro.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b=ir+6nr/c; arc=none smtp.client-ip=209.85.218.41 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linaro.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="ir+6nr/c" Received: by mail-ej1-f41.google.com with SMTP id a640c23a62f3a-a8a765f980dso26497966b.1 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=vger.kernel.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=ir+6nr/cTmo6hs2l+weMJp6VJ6+580jC3Lv1yeiNO26oT1SCjw4uyejTROc4QcuQKJ WuFJisoG5lRtmurf/eId1/oazcPvOTgFuZu8mEY7iKHq9k2tj3SwpqME54ca3pMXb0bQ SF1Z6ZUSK6VCj/cyOBo0xcO+h1kGQAJtQiaWCxdhc9PKUplWAQCYX08bxFYegq5jotys ZKwKAUVI1CH0q0Yw4j9HIC6SEX018NHIotm5qkzrMjZJP6DTTedPrHYIBV1prTMOK8pL VHLaADp5/BM4+fInEcLoEGMOgrh0Rwt/MSQkCayjWpHDzxCiVbemX30DkpunrHmPOnV7 2oGA== 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=QtPiD0nroEcH2bs4hlix8OyE/12tZBHmEhcsawMG0M3FHA5RW5ZyxzoPrLlIhcNWqx BFXBFDd7Dr4d+ADT63WKXB/QysYGNH1FArrgjcuyxF+qStpGVFODOmDozSD72aDj4bME +lpDcCamW7VLgpl4wqVpVBPeKIMOVkSmGfde/oS+n9Zifpm8+HVKYLFHeYZujRQnCZcI 7VcX8wC6dWYpfqLFLLnZh7pNpuU7eFsfmtm+0AhtcWb1S9FvRMxFGD7vQeV+NkhcS+QK hV0YC/67DwJBe3TE0nNrrSycxgX/GXqckNmgLyAVdyxd9keDrnToKBwut8Mf7sX1Ps9y QGOQ== X-Gm-Message-State: AOJu0YxsAxQDsXCVWinbTFf4aavFP87iLbjxCPOx7lNSDd/oatQs5Ww/ 7GP+VsNo+W5uK4PVl8JYsOisHeWAxTWb3IqcOm1edMucpNuntXFxUx1RW6MGD1M= 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 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable 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 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/da921= 1-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 =3D { .of_map_mode =3D da9211_map_buck_mode,\ } =20 -static struct regulator_desc da9211_regulators[] =3D { +static const struct regulator_desc da9211_regulators[] =3D { DA9211_BUCK(BUCKA), DA9211_BUCK(BUCKB), }; --=20 2.43.0 From nobody Thu Sep 19 10:38:52 2024 Received: from mail-wr1-f49.google.com (mail-wr1-f49.google.com [209.85.221.49]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id A20651BAED9 for ; Mon, 9 Sep 2024 13:51:48 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.221.49 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1725889910; cv=none; b=N1uP6O0MuetSS9Zqc6dU+m2R/aUH+VfbPurx4/FCKPuN6AhctAA3ZiQ615GhNxYLjKs4OYI3QXq/FaRRSlBr/VzA+x7afXucNif8mikji89Cq7rKuivaOl1USPaTDXx/RXdSFPj15PgUdHjnydr5tuviW8TpuqconIuk8owf70Y= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1725889910; c=relaxed/simple; bh=j2zwQ1BCa3xviw33TQ1yU9leknMd45i2193Hd7keRfQ=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=cavrBa+EDUrNv6k6XRC1qNI4gTE+g60DWfgPOPkvnyIeeKHQ8RMQKpl5hjVRP8FW4I5ycHd551YFd0QXEnRWCl4oSuioRulra/LcCX0Yh4EkqRd0KKIdqvaVJXpeU9/L68vw7o9xY6HS6eOyvTitI6XLe+n61nQJCahos00jCi4= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org; spf=pass smtp.mailfrom=linaro.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b=hFWi8444; arc=none smtp.client-ip=209.85.221.49 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linaro.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="hFWi8444" Received: by mail-wr1-f49.google.com with SMTP id ffacd0b85a97d-374c6ed1af6so134431f8f.1 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=vger.kernel.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=hFWi8444h/YAQ5XB1Mel9v3J1UfXDekUDqw9fOMYHbrzuL/ziK2W4OQf66KXvJpr22 HKjVoQG17Pj1Qm1HslCuKTe9F6zMk/OlFCV4Bjh5GdcGEI04//IoMqBimf6prrEcAnmB FCPt6sGMTkGNHN1j0bhmZTE7S+y0ITIb+2L2QGC94FwmfcRGIj6sbnu8aJN8PObHWqoO BaPCcTQSILX54hoNp5DQ3x9Mf55dv9ObuRXD+RX2dYPIWZQYmAlg/kir+8m5oH0bu4Nr FY4OGHW//JuYIHsEHR16Hi1LUh9fCojd7YaligQhkmrhNI913QtulooS7WmLaZiTQ38c NX/Q== 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=EnIVZ4dLuCOLeuCS1xGehOmxAGVN1SRhRhhD+zIthO7K6Jz49MGFN/v88tUiMsDB79 quTo7BpUa2JRkVQAtF75p14YSq756gEpCczdoFAUPICFkgzqXnafBZy5fECD9S6T6jzI d12z1UGdmFgeHLVoq0WWq7wxGjFXLcIiIUvJL5ME4PD/5Q6igxaXVpKzQbAhk9zeSZfC iojI4rpCoqRipCD7aHGbJjGaYBm+TA6Rb+xbRAr1yPmwYa1oY0/UTJJ0e7tM8ziGEuTq 4KeUNzYpshgM2oyHBzN5Gs9f1PBJBnUeoXHPG+owGBCcjr2W4BuWbNX5E1u+9zFx/A2J j6Ew== X-Gm-Message-State: AOJu0YxyaR4ZXSgaAsx4j2sP6u2YR/5e99Zwsyx4IhItw+V3gphEeV+T AKWs8j/FcsUShBmNx4nEODOi72zo6dHDazfmEXl4N+wBWPGIi6+PWsYyuU8WCKA= 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 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable 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 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/hi642= 1-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; } =20 /* HI6421 regulator information */ -static struct hi6421_regulator_info +static const struct hi6421_regulator_info hi6421_regulator_info[HI6421_NUM_REGULATORS] =3D { 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) =20 static unsigned int hi6421_regulator_ldo_get_mode(struct regulator_dev *rd= ev) { - struct hi6421_regulator_info *info; + const struct hi6421_regulator_info *info; unsigned int reg_val; =20 info =3D container_of(rdev->desc, struct hi6421_regulator_info, desc); @@ -397,7 +397,7 @@ static unsigned int hi6421_regulator_ldo_get_mode(struc= t regulator_dev *rdev) =20 static unsigned int hi6421_regulator_buck_get_mode(struct regulator_dev *r= dev) { - struct hi6421_regulator_info *info; + const struct hi6421_regulator_info *info; unsigned int reg_val; =20 info =3D container_of(rdev->desc, struct hi6421_regulator_info, desc); @@ -411,7 +411,7 @@ static unsigned int hi6421_regulator_buck_get_mode(stru= ct 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; =20 info =3D container_of(rdev->desc, struct hi6421_regulator_info, desc); @@ -436,7 +436,7 @@ static int hi6421_regulator_ldo_set_mode(struct regulat= or_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; =20 info =3D 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; =20 info =3D container_of(rdev->desc, struct hi6421_regulator_info, desc); =20 @@ -539,7 +539,7 @@ static int hi6421_regulator_probe(struct platform_devic= e *pdev) { struct hi6421_pmic *pmic =3D 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 =3D { }; struct regulator_dev *rdev; int i; --=20 2.43.0 From nobody Thu Sep 19 10:38:52 2024 Received: from mail-ed1-f48.google.com (mail-ed1-f48.google.com [209.85.208.48]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 1D4CE1BB685 for ; Mon, 9 Sep 2024 13:51:49 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.208.48 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1725889912; cv=none; b=WWX6kvblzhreJ4DiX2Lq2p+vT17Bdr0sJuvBHUdi4dUCNMZELDMk51M3/p3yEDDCWnnwn22ruUvoBX+VAL9rn7xJmy2kIL3b/z7sYDzQ/F/T3bAnYuLrPIwlbFbhMltPExfoQmHuZpb5zhu1n9yorRGfl3nwKgI+MH1RrNcujgk= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1725889912; c=relaxed/simple; bh=aQxdvJysaJsMuCiXGmuPsUG5zXaAXydDbTeDR80ECyI=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=FsOeVdoaVpxME1GlpwHjGH6DYGlaRJPn6vr45+l/K2Ta96i2pFmmZCOMrP95VTrcAh7GQGYTzM093vA26yutPAXS3jtN6+QB4ETIihgo491G3mCANPjPdwBnVWvlydHHr3aHkYxfUn+CE9AQ0u6aYV48GQP+AifQkFDzawbkUk0= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org; spf=pass smtp.mailfrom=linaro.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b=R1X4o1Cn; arc=none smtp.client-ip=209.85.208.48 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linaro.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="R1X4o1Cn" Received: by mail-ed1-f48.google.com with SMTP id 4fb4d7f45d1cf-5c243ef5322so847083a12.3 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=vger.kernel.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=R1X4o1CnjAw2OlweZP3yXAliuF3exIxoRbfC5XI1syBb+fn53fApg24x++PA43Vw96 APIsHyVhs3P/xw7zyoj5pQKtQazbZW6cht+7HGxpV1Fy3eEInXvJFRk27eblOR0ivU9+ RiRHq/DRSOpK6khb619guYu4azimqdCM6WZLP0OriWbBqJktEa7ArGs8v/8oNOLsxY4N HkXHKm2BL3p0gGG3qRjWpR5bgywwgUC+hB+mPJBJQP6oGVqks4Dw1rH1Cva3MyHscitR kkTqhcsynaGd+QyHixYY7VBbd7cfWcg5ZbaJXflJrzdqDt5Yhh3Bi8j86B7o8eUyhNFt D5qQ== 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=U8C2CJm/a+xQ8+Uqf3CE/PjkQHRAtV3EgmNYsLzseaw0C1Z00zhCGmGSM/aiRqU0H7 BnLxwY16x8MUhaNAYHJfgqRFncs3LIjGSs3UhPSfgZE69HoUZwPdvEdJY9diqM8uaEyB vQQ9D+32viWpLNPTSGRCnD5QMTK7nAMEq9o/qldhcjPyBYZQGqQ0ET4m8j7sLk1QuDAr jBvhJB3GqJTmGAET4DdFsDGSjarn2bzZQIW3RZM8tpgqTi7cCPSN25QNLR0uw377j0U0 fpPvBNrLhsG3g4pm2JzQwu5aw/2FK0EdaWQoosucBaYoOSeMEkYAzCNGpRh4eNl3RHzp rrVw== X-Gm-Message-State: AOJu0YyFapZAaYvqFpWm0L1g5Xa1wTTZC97V0/ONEFMet/9TkHwWRi7p 3JztxuO/CDjTM8AAgePtZdBQb5Uxi78YB9kFtn9iCN5iweXPV4OEvXvWnX74VVQ= 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 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable 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 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/h= i6421v600-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 regulato= r_dev *rdev) =20 static unsigned int hi6421_spmi_regulator_get_mode(struct regulator_dev *r= dev) { - struct hi6421_spmi_reg_info *sreg; + const struct hi6421_spmi_reg_info *sreg; unsigned int reg_val; =20 sreg =3D container_of(rdev->desc, struct hi6421_spmi_reg_info, desc); @@ -133,7 +133,7 @@ static unsigned int hi6421_spmi_regulator_get_mode(stru= ct 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; =20 sreg =3D 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; =20 sreg =3D container_of(rdev->desc, struct hi6421_spmi_reg_info, desc); =20 @@ -195,7 +195,7 @@ enum hi6421_spmi_regulator_id { hi6421v600_ldo34, }; =20 -static struct hi6421_spmi_reg_info regulator_info[] =3D { +static const struct hi6421_spmi_reg_info regulator_info[] =3D { 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 =3D pdev->dev.parent; struct regulator_config config =3D { }; struct hi6421_spmi_reg_priv *priv; - struct hi6421_spmi_reg_info *info; + const struct hi6421_spmi_reg_info *info; struct device *dev =3D &pdev->dev; struct regmap *regmap; struct regulator_dev *rdev; --=20 2.43.0 From nobody Thu Sep 19 10:38:52 2024 Received: from mail-wm1-f43.google.com (mail-wm1-f43.google.com [209.85.128.43]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 51BED1BDA8A for ; Mon, 9 Sep 2024 13:52:02 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.43 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1725889925; cv=none; b=G8R2abBogfwA4VeT41yG52cXLis/KfHMEzyJQprTLKdE8Z2U0jIb/dsdMbxMPdR+8GuuRmd7LCYer9IBY5zYRRyBktI+rY47GfhSgggEQ3LyaFYLuN9vf0DcGxfAlskQpeGB0jSYhgLUIWrAZYdv0YaEDqgs2T4EBff5AOM5Wmw= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1725889925; c=relaxed/simple; bh=jNymqsckfanJHx8PSWuZFbKm3ihIGGZwBaMEOB5ZiE4=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=HzgeYxnYYGe44eot0A14wGuslFi8PKHERNbg9hNuLmLyD0qGdm8MnD8fhhlluK+5CbgyQnTVzkYdgMnmGthf1wYXjMQj6oroqtM5NX2kUqOxEnVe2eTjtBatZ95nVFP5NUnrc6JicRRkWbvRdNStNbVusl4tGeJEJsLS93yiU3E= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org; spf=pass smtp.mailfrom=linaro.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b=Qtzg/w9G; arc=none smtp.client-ip=209.85.128.43 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linaro.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="Qtzg/w9G" Received: by mail-wm1-f43.google.com with SMTP id 5b1f17b1804b1-42cb198f23fso2612485e9.1 for ; Mon, 09 Sep 2024 06:52:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1725889921; x=1726494721; darn=vger.kernel.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=Qtzg/w9GD9ZogwzvGQOc3EePSebfKer087IMXMs8iVoNQ3l33ueGz3Fo+3sAWHqYrk veSfrWA2WreSMmoROmWF5q2RqVxgrhcFEt2NPLxymGYzu6ma+rhhNYyi2/Pykn/zvOi1 sUkR97ZIuQl+0pzGh+zYrAZEyZDkbzz3lQdPkvpFse1nP7AwCxUwxB1wE6/gCK2ukWqH 9tw9bAZWlfGlygZa9CvOML73pzgIBRiqycUTc1Ptcg99gSvx46gkky0ezQXJ4hWAMtjF /tZHvFz3E1OjobE5rSQhhG1gI7WqPZftPkJzeiX9iiJM+kSeQn2y26bqdX3N+6JU8OW2 CegA== 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=K2KXhvLVo2aqzeOF6+bimusr8e0dc2W2Kga5eT5pCFndCCQCVHJ/KynvjdtdSW4VnB FRUIqHgLWj2ZDcxYRO+Zsj/Em4rposa1hh2Xs4Vsqi5sGPu8BLUMTFvDwXy+gI2cTY1M ywsxzyzuTOxVNI+CH8eo21tDitJs2hqFn6uz9K4gnsNQnuOUKnWjaPfeTxDtSMPxynB8 87dZzIsAsoGoXntKP2DmF7f5pJmmGUemCPz3YAGv2Pl3GUCXxF9EnaalG+L9YiGDDvX8 6vdNGnNFzcy9/mnfxwLsTqFEgwH9mVoTfS1cwC0TiZkjcG2pFdR71TViLodztat8O+Q3 P3wA== X-Gm-Message-State: AOJu0Yxc+K/+NR3PdvhIzrhsA7UW+YN9rFhWMat2SeAmsz/3SlFus0Kz 9c328KuIjDRAn2ieNXZ+oquReArVs/bauSlcRhd4lmp29tdQ8cChQ896CHJ2Q3Q= 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 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable 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 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/tps= 65023-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_regulator= s[] =3D { TPS65023_REGULATOR_LDO(2, TPS65023_LDO2_VSEL_table, 0x70), }; =20 -static struct tps_driver_data tps65020_drv_data =3D { +static const struct tps_driver_data tps65020_drv_data =3D { .desc =3D tps65020_regulators, .core_regulator =3D TPS65023_DCDC_3, }; =20 -static struct tps_driver_data tps65021_drv_data =3D { +static const struct tps_driver_data tps65021_drv_data =3D { .desc =3D tps65021_regulators, .core_regulator =3D TPS65023_DCDC_3, }; =20 -static struct tps_driver_data tps65023_drv_data =3D { +static const struct tps_driver_data tps65023_drv_data =3D { .desc =3D tps65023_regulators, .core_regulator =3D TPS65023_DCDC_1, }; --=20 2.43.0 From nobody Thu Sep 19 10:38:52 2024 Received: from mail-ej1-f48.google.com (mail-ej1-f48.google.com [209.85.218.48]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id E45711BBBEA for ; Mon, 9 Sep 2024 13:51:52 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.218.48 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1725889914; cv=none; b=D6ABpPoAs/qqJk5dH9xIGploz7LiNq48qATjYtNvakmL7vMIfIy9S2LKbz+YMNHec5z+GqmhKV76MpzFUG8AYcBP1lhI+XO5mh6GUiho2hqsOGbJZYLLVc1vIaHi+keH+a78j2ydaoL7mQ6l7DUb28rokqDhunL9li5Yh+Yy8b4= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1725889914; c=relaxed/simple; bh=rxHbd8ZN2Gnll5CmN6olaVIKBgECJTgaQrtvW4I7hxI=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=CmdWQ4VdtehxRGQiKQoEJ9HZAl3jmFfSNL4i4cGfu8XTsPa432tjO4naJMM6+i3ehHSVgkjsM7mpqic77O8fd0y5ad/T896Do3UyYXVwBF1GE+AFf0RNtHqfOPaNC85SVEqX/wMk8C/I3AtqRnM9tCkWVZudZlRBGO+09KC70YQ= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org; spf=pass smtp.mailfrom=linaro.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b=ERrNHWWu; arc=none smtp.client-ip=209.85.218.48 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linaro.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="ERrNHWWu" Received: by mail-ej1-f48.google.com with SMTP id a640c23a62f3a-a8a765f980dso26499066b.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=vger.kernel.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=ERrNHWWueLsdsvtS7r7ye4oD1Ovlq1L0rsPrl0lhIT8tG1vLMdWtC8cITRo0joMD2Q 03lx+VTi1MGh2rK1LzMUpGJTpo8gClL6UpwkC9f8OPdqTimvBZcBzJ8ku7N+gBmHsfYo 54znMtOzzxMrHrh3qZDFXBG9Qqfcb+ReVIeKLZXRyxdx+DjbF9yh1XTuDKx53+Hnav0K N98LPXgHA9/OC9QDtp45mKMiMMtqpYo9pVEFdy8/yrmvfFIE5xCO7l75VPH1BmtXDyPg XT/6PP4VBD8nEtUtmO4l6HG2pHT5XOLlm/kKmhVjaVls+v58QZkvijmD3WM/c7xp8okX WnlQ== 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=TmKEBEwtw+psAmvs43H+3qsUzk9O9A1ICGSOP4m/1Ht4hszea0z9ba3K4T86j8l6fA WQ52W+Jf2tva7Ib85nZC2PwUn1prVXGfdCkV5/wc3tyo0V2YPHii7BbXkFgBjC3s8uZ2 ziwWKeqRsA/RwbvXupjNg83wLuCSjWNuTUhBTbYIXrWGZkRcoYCdDj+9Ov/7vSoxF70q kdUxc74VjdwVnIhbojTF6f3TXxPHizup5DiNutwggJbWbrHZF4SELmqWljVugm0gsr0+ hyEyXnS3Kw8Wp5NITrC+mm2hi5hlcOuk1/i6HbAqi1x/TYAYYdPCt06K5NH3CUG6IFIP foFA== X-Gm-Message-State: AOJu0YzdApfzyLV4vEYQ85A5s6+GQvF6BeUEy+L6uMLscqIY6IGDdoul l9RN1q5gOkIVWWG6oLyEBls1Pz2WpnpI00bMsiD+FhMYsF6AogFDZZ68jPypWns= 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' Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable 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 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/max= 77826-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 { =20 struct max77826_regulator_info { struct regmap *regmap; - struct regulator_desc *rdesc; }; =20 static const struct regmap_config max77826_regmap_config =3D { @@ -246,7 +245,6 @@ static int max77826_i2c_probe(struct i2c_client *client) if (!info) return -ENOMEM; =20 - info->rdesc =3D max77826_regulators_desc; regmap =3D devm_regmap_init_i2c(client, &max77826_regmap_config); if (IS_ERR(regmap)) { dev_err(dev, "Failed to allocate regmap!\n"); --=20 2.43.0 From nobody Thu Sep 19 10:38:52 2024 Received: from mail-ej1-f45.google.com (mail-ej1-f45.google.com [209.85.218.45]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 59A611BC07B for ; Mon, 9 Sep 2024 13:51:54 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.218.45 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1725889916; cv=none; b=iabu/kdypX9FtlKOySMUkaadWTUonBxDj1dInijYzfNy8szO7IqCSN36EStSHLL0JY1svaCdyIwS4km4Deq6vdPBph5Q5gvjUM76CDeJ6s6S684RsW9EZHvSOH+VtlZpuv1w6mfNnPF3M0aA3ikQ7P5TIMXH0SYXIu9+ffVIAWk= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1725889916; c=relaxed/simple; bh=795en8GaERiwJn6rOfhvPyay4QNcnSep7UjxTkcJ3Mc=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=AkJJpU7Ji51StUaSPH+F9a6SqTF+aNKdeV2eR7zuFqUJoko/OR4F0abImEiXZPlHHEvQ00IIth2FVBFbdOjlQ0zsPPZD+3C5dGEVHj8lPVvXbMUIpfSylMb6TZMYQVKKUn4N1p/DudzH7riBV1CMEAQj9Cetu61bZUPz/ZKQa6k= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org; spf=pass smtp.mailfrom=linaro.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b=lqZRw2KQ; arc=none smtp.client-ip=209.85.218.45 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linaro.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="lqZRw2KQ" Received: by mail-ej1-f45.google.com with SMTP id a640c23a62f3a-a8a913874b8so24325466b.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=vger.kernel.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=lqZRw2KQPVtSyqT7p/Q10J937GAaFzEpQY0WRPvCcBSiAIADGJrvXLP+wfiyxg0vJh JPC2EnO/T73TdYcHH+J3vkntmF0UbSqDLEQf8WDZOfk8sP1CWV7aZfbxsUopJc1z+KP2 vAvh/+0acoHGYxuUbG/QtuoC6o070A7wCiG+jTANRWm3obwWmH/mxTAMgXjG88w3msa1 bi9w0n3nOSbUeh4RQBGUTMRZXou+k36bYIfrMWwd+53nBRr7Jv+tQ0Q1CMXOHX5o3qAZ m6cDSulZ9KTZ9S2JiM6zvl723sBo75RsuYQpGH3TgwEnkV9WhdPpWO9cDAACoLUbApve v4kA== 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=Wgvzalec/ybUWmlWl8bZZyu3qzNoSkEixR3w9g+5Uu+FnGRhR7SjVERHNcK+/6b9na jrvoUAAickoFOjsjWX1KcAQ1ydUXCyezVUoH7cky4jT/x3Gh3B95Ivj1xuc6XOoDjy32 5qYvjOQDL2RVHocCH10BXCXPrXpVacHWuAS27ALMOEHpvYwkfnOoCQnCbIDKY8QFrVCK Ukj8+pOmbAXWiyhtLo/4b2qDUmsD7Y3yvm2S+g56KJCz8SlOFSqLlPerPloZvjF+Zr+o HPzz5mo5a0kLNbR+V804dGkwWx9M6kUWZF15GzGNV+u8R5PzpngS244U66pWsRJlxU6u Ragw== X-Gm-Message-State: AOJu0YwvpUOhG92AxHq/uscyWrVnA38HP/P4Bi5XZK3uSwSxayNWtr0A 82ZypvMyLWYm/hfiaMF6YMy9/5xP6UDUf5bbonxl3vQhEUdYvdcpnJYn0VHdewY= 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 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable 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 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/max= 77826-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 =3D= { .set_voltage_time_sel =3D max77826_set_voltage_time_sel, }; =20 -static struct regulator_desc max77826_regulators_desc[] =3D { +static const struct regulator_desc max77826_regulators_desc[] =3D { MAX77826_LDO(1, NMOS), MAX77826_LDO(2, NMOS), MAX77826_LDO(3, NMOS), --=20 2.43.0 From nobody Thu Sep 19 10:38:52 2024 Received: from mail-wm1-f50.google.com (mail-wm1-f50.google.com [209.85.128.50]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id D38751BC09E for ; Mon, 9 Sep 2024 13:51:55 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.50 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1725889917; cv=none; b=bKxSMZjPJDRD7OLK7kkJGN9qlv1jiyCFA4h76uMqjeOsBJ/9fnMY/VTeSOMa2egpBCpMj/noF10DIPmejTmzoFMK6v8EGR8HMHkI4gnMNFNlBeXKuocEeFI8tdf0UJMkhrgoA6balgQlqg5gUTRy1w2aDK/vXM7PtcggsVm9Z8I= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1725889917; c=relaxed/simple; bh=zfZGJPZ+7n/u+R7h1aiFdsdkEzudbMyrWwt0mCMNVy8=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=BW/PSg3vtm6v124woVRheF8iM69lLgXBLndtElRd5uw342IT+CLp9fnWqcYuYwX9F3YcbERwtkK6G9a0uHtKM3b5doh8YpjEq8IqmuBENzwMMw8L+UAJkt7sng36NXhjiU5XcR4RHRdbskbLHnWEttFwTvofGut3+dVGaMF3t1A= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org; spf=pass smtp.mailfrom=linaro.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b=HnsuNF9u; arc=none smtp.client-ip=209.85.128.50 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linaro.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="HnsuNF9u" Received: by mail-wm1-f50.google.com with SMTP id 5b1f17b1804b1-42cb1e3b449so2531205e9.3 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=vger.kernel.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=HnsuNF9uTiZz2KD36y4vGRhG/UVM2phfhdiPAuKuD65LaqZkhdxaZSA9R+8agSAhoJ EHSCt45YtgBi5Pc3N3qtjJkixOtVo6DdwQZp1qRL3iGXRg/XzR4PIgqaMXVojPSSnK8V OL8rz7NSaEvl8zlExlCwG5J04JHKFaF3QOhsi5nMp2l8QAB2Jc1Q+i7gdg3Pj0hj8TvS Z/1PWM0EwqXoThYVNfjDBMDfQhvAzymMoKZLS7PMeIN3XbL+SBkMXoygI/4PXiQwEu6H hBXO+V6MB5vqoHdP9em3KOO9wviRLN1SToi6Di2WMo1PNuAlDHG+41nipJ2PXmGXTJEE KTew== 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=jO8Jwb5QT1ejSleakB/RmIvL2LY424adn7cg3/WFtrF8OkrYuwUlQxiCv1HHDlCFzN jfDKZBmVk5lyY9qdYNhvRGCYv75u0rW/xBeyww06squN0ou/zA4YjfnWR3xiC6LcQ+C6 EY8rBxALQO7J6apDoRgdnjZOyqPJ58F3vBQpBQB/4GG43qnMIxjHo6CaMtobmaTdu8Jz 7SqxlEX1fCOObResgji14NbHYR5BnSy3VQ0SpqnC4l4uaTp6sxO/eB15dXT6sm+Zn0On rYMK53hqeTVT21SaP3fDiyU+BozUece28yns1+Wpkm+XmxI+c8esgFS2cy8CtyiV9+IB TiPg== X-Gm-Message-State: AOJu0Yy+sjA8veYoMOMk/0qxC6jB5EQ5jJARgkQMiMVqvn5tbPNVLMje 42gBwItjqZQIevTr6niW5AomVQ65gd95xucGNOvR3GLV341AWNTCzvxWMOXg8ko= 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 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable 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 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/m= tk-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 { }; =20 struct dvfsrc_regulator_pdata { - struct regulator_desc *descs; + const struct regulator_desc *descs; u32 size; }; =20 @@ -107,7 +107,7 @@ static const unsigned int mt6873_voltages[] =3D { 725000, }; =20 -static struct regulator_desc mt6873_regulators[] =3D { +static const struct regulator_desc mt6873_regulators[] =3D { 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[] =3D { 800000, }; =20 -static struct regulator_desc mt8183_regulators[] =3D { +static const struct regulator_desc mt8183_regulators[] =3D { MTK_DVFSRC_VREG("dvfsrc-vcore", VCORE, mt8183_voltages), }; =20 @@ -138,7 +138,7 @@ static const unsigned int mt8195_voltages[] =3D { 750000, }; =20 -static struct regulator_desc mt8195_regulators[] =3D { +static const struct regulator_desc mt8195_regulators[] =3D { 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; =20 for (i =3D 0; i < pdata->size; i++) { - struct regulator_desc *vrdesc =3D &pdata->descs[i]; + const struct regulator_desc *vrdesc =3D &pdata->descs[i]; struct regulator_dev *rdev; =20 rdev =3D devm_regulator_register(&pdev->dev, vrdesc, &config); --=20 2.43.0 From nobody Thu Sep 19 10:38:52 2024 Received: from mail-ej1-f54.google.com (mail-ej1-f54.google.com [209.85.218.54]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 3AE591BCA05 for ; Mon, 9 Sep 2024 13:51:57 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.218.54 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1725889919; cv=none; b=nPb+RwryObkwiKAbOpjyoORwO4AeOVfRlXc8uGKa3ewci+0T/C9jcYL80104m0lQWz/DJp03KDQzyA8OU7FikDFvZDqr5NuXdZ1I3HHkOYGGelPiHH8vEuRSIdtOPlsGREqOf6hgW+eD0CXs7vIfJqRMZxAgsR/XaWgFAHWc3kU= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1725889919; c=relaxed/simple; bh=MS4Vn8NDElkbWDEAQWJiCHTN4oDL8ETlvc4aO5xEqXE=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=Au3iKqGGeXqvKzMsDJawaOAMe1ub8nhZNs7K5uTDcJqvuP0TbQ5KjThDu5wIZyP1JOMNmH8XRopoaU7VDRTLF9gI7BF+1fuIsfq826lNxEluLIUJb59qi4BhepdscGxzJLJqyaszown0yKVRxx7mPW+HedJQXH2mmmRc3FaInNw= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org; spf=pass smtp.mailfrom=linaro.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b=wtNEPAOA; arc=none smtp.client-ip=209.85.218.54 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linaro.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="wtNEPAOA" Received: by mail-ej1-f54.google.com with SMTP id a640c23a62f3a-a8a91c8cdd5so22186966b.0 for ; Mon, 09 Sep 2024 06:51:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1725889915; x=1726494715; darn=vger.kernel.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=wtNEPAOA8zPTggjNZsJmPNtm8uCjNQ2aZXUEDuka0sq6uCH9TGvCY4vcxK4bjIyJdP ffqgD615pvGgV5j5CiN0BHZCFRpHAOzQsrXeugEcBoeEfoteVqypF+B9fD/CtPOXymXf Miuhc6NQi6uAzemHP/iq1DLB6//9g7Wq02djKqHK/iaWOGxb4LUSMC6qdypg2esKTQIA 4nn23nR/MOwYdi461IfZ7IAmTqbMMJLbhGy5shWgRFRg1IC/aVkzU70xJv3CQncNCsuN yBdt8SVNi/+60khZoKZ6BYEyveJxWUvIm+YUr8fM8A3dTxQukcd+EL8ISlAWPT3sv9+d b9VA== 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=GA5ue/paFmZfIue6oSBxTaK5TvaeS9IvpWeOVqAJlL2kdzxy1r92WqgDNlMaLp6PRw LFMd3oO2dvztdZQgq9fOsUuKZj8b6liIfmlYkb0E2Wit7U5U7CmqBbqQwc/cmIQlhSYW oHlLRYpgU8EOLd4b/PwK9cKZ8oCp975pcS+f+zldsglOizsTuUSKFx87rtnswRINKV6o 1JLuMrhSdom+PHUjYAOV4Slc8oWFgUXA0aCtynSZ06MMAn71UZY3SXdufP8xENZL8/iN TNv4f+PHEQnIdRcmrJh2f25ZOlpGa6Oo9nze2dm+zUyuDvkXfHmgqAhfq7EKoh3xgBDH NbPw== X-Gm-Message-State: AOJu0YzhJ40ZFO1l1V///MoAii85VX52T7fgMcrySeGo419D49PJbLUm QskKyOIkKrd40GGzN/R00vZs87ImRpsIwCUN/8cfEOcqC6676jstdzr4lIrTrlw= 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 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable 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 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-re= gulator.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 =3D _lowpwr, \ } =20 -static struct pcap_regulator vreg_table[] =3D { +static const struct pcap_regulator vreg_table[] =3D { 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[] =3D { static int pcap_regulator_set_voltage_sel(struct regulator_dev *rdev, unsigned selector) { - struct pcap_regulator *vreg =3D &vreg_table[rdev_get_id(rdev)]; + const struct pcap_regulator *vreg =3D &vreg_table[rdev_get_id(rdev)]; void *pcap =3D rdev_get_drvdata(rdev); =20 /* the regulator doesn't support voltage switching */ @@ -155,7 +155,7 @@ static int pcap_regulator_set_voltage_sel(struct regula= tor_dev *rdev, =20 static int pcap_regulator_get_voltage_sel(struct regulator_dev *rdev) { - struct pcap_regulator *vreg =3D &vreg_table[rdev_get_id(rdev)]; + const struct pcap_regulator *vreg =3D &vreg_table[rdev_get_id(rdev)]; void *pcap =3D rdev_get_drvdata(rdev); u32 tmp; =20 @@ -169,7 +169,7 @@ static int pcap_regulator_get_voltage_sel(struct regula= tor_dev *rdev) =20 static int pcap_regulator_enable(struct regulator_dev *rdev) { - struct pcap_regulator *vreg =3D &vreg_table[rdev_get_id(rdev)]; + const struct pcap_regulator *vreg =3D &vreg_table[rdev_get_id(rdev)]; void *pcap =3D rdev_get_drvdata(rdev); =20 if (vreg->en =3D=3D NA) @@ -180,7 +180,7 @@ static int pcap_regulator_enable(struct regulator_dev *= rdev) =20 static int pcap_regulator_disable(struct regulator_dev *rdev) { - struct pcap_regulator *vreg =3D &vreg_table[rdev_get_id(rdev)]; + const struct pcap_regulator *vreg =3D &vreg_table[rdev_get_id(rdev)]; void *pcap =3D rdev_get_drvdata(rdev); =20 if (vreg->en =3D=3D NA) @@ -191,7 +191,7 @@ static int pcap_regulator_disable(struct regulator_dev = *rdev) =20 static int pcap_regulator_is_enabled(struct regulator_dev *rdev) { - struct pcap_regulator *vreg =3D &vreg_table[rdev_get_id(rdev)]; + const struct pcap_regulator *vreg =3D &vreg_table[rdev_get_id(rdev)]; void *pcap =3D rdev_get_drvdata(rdev); u32 tmp; =20 --=20 2.43.0 From nobody Thu Sep 19 10:38:52 2024 Received: from mail-ej1-f53.google.com (mail-ej1-f53.google.com [209.85.218.53]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 9E1151BD4EE for ; Mon, 9 Sep 2024 13:51:58 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.218.53 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1725889921; cv=none; b=MJrSA+2tmVTuXze7rKrVAu2cos0+yZhG8MESwFDFcWNUQ9Tb7rDwz3ViPddRcGzosES6XyNGYNw2AcX0pdX/6+NJbHFKsaAkTmOaCpF9RNeibw6HZC8CnuxCu08eONR/9fbuOjaP+lqL5gq7VBoefsnrbqYl1ywywoD3FQsvF6I= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1725889921; c=relaxed/simple; bh=HRKyZjGM94NkFQ6StvG56VA5RTKeFKEABwUAsw2nTr0=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=SqE6rYKcQ82R2DkQXiOBTvI/jAPDSqSITOe9j59vXlIYigCtsl86ZNM9uJWAJg3Ip0y1vChK3hyU/MWw+kFuwLupNPt6aHc3GXeTm1C8BL0UjrPseVlx5E1XRv9FehwS8H/Wy/3r+jsuFem/Jc01mcCPsw63kgD9U15wPkX+j4E= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org; spf=pass smtp.mailfrom=linaro.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b=QJxdMoJ3; arc=none smtp.client-ip=209.85.218.53 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linaro.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="QJxdMoJ3" Received: by mail-ej1-f53.google.com with SMTP id a640c23a62f3a-a8a87c7c68dso12366266b.1 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=vger.kernel.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=QJxdMoJ3nCnO2tzHj6mQ5YmmlfSX/tSPZMS2OC39TUXix5sBO/ExUodH3qwElOAhGp SjqhFSJJTPlgI1C9ls7iqKtgPE1oPkFDkzoIwrEl2giG7wbWH3VvWUQ8DGepoq8Ir+wh i5hDMTXMNeBKZ/hSJpjAxqYEAE8EyY78SFOb3z4+B8r9cLb2zgcrLtvKqiBSCrfQmADd DdzVoEErotetD6vnoFhtDTSkNnGbRCxCEjf/RfKpQJCz6e51hOlGIz3fbuej1iYgwLcj stPsoVUa+M5ElxMK8FxkJvvSLeWje0cEdb2+5RzEQWyaKvQS3y2bJK0JpiGSLS7bBwNQ LSnA== 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=KFdBQTBV8PrWLf+dXr4hYA+fFkBX/tkna58WIH1XL99wG0qfTf4xeYWVxKRf3FXPJm dIq7iE1YDlZGAPAl2Pu4FQNK2hbHasv9HQofjvT81EOmdOufR7Q9vBj5JS8A/4m0N4au DICHh1JWysCTYg/v9w0xvWuiOQkTGGsp+SwOTwqJXpnDnaquX0/XTitCWCaCm1ziwOGh 8CFbd8ID/9n32Odlwt6ofod4PdBB0cSpK0m354uCZO2xYr1Rjsgngrpo8NdtD1PQ68aH opyi1UA6UZZPFqzHVOI6h6bHZxwMxrw0Wo0n352WnsT5LZS1NDfNolOZjC74n75Bqjt2 PPXw== X-Gm-Message-State: AOJu0Ywj9tcflfx+G3oJ+6nuMQUNzwXNcKZuB3YE7WCbyUr8l0B/e3+1 S3Mbazk7x5YALInBrmH0+GEhQ4LnUcV3VwuctAlvNjz7gk5LtbGkNtNiNQt5QNk= 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 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable 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 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/pfu= ze100-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; }; =20 static const int pfuze100_swbst[] =3D { @@ -367,7 +367,7 @@ static const struct regulator_ops pfuze3000_sw_regulato= r_ops =3D { } =20 /* PFUZE100 */ -static struct pfuze_regulator pfuze100_regulators[] =3D { +static const struct pfuze_regulator pfuze100_regulators[] =3D { PFUZE100_SW_REG(PFUZE100, SW1AB, PFUZE100_SW1ABVOL, 300000, 1875000, 2500= 0), 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[] =3D= { PFUZE100_COIN_REG(PFUZE100, COIN, PFUZE100_COINVOL, 0x7, pfuze100_coin), }; =20 -static struct pfuze_regulator pfuze200_regulators[] =3D { +static const struct pfuze_regulator pfuze200_regulators[] =3D { PFUZE100_SW_REG(PFUZE200, SW1AB, PFUZE100_SW1ABVOL, 300000, 1875000, 2500= 0), 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[] =3D= { PFUZE100_COIN_REG(PFUZE200, COIN, PFUZE100_COINVOL, 0x7, pfuze100_coin), }; =20 -static struct pfuze_regulator pfuze3000_regulators[] =3D { +static const struct pfuze_regulator pfuze3000_regulators[] =3D { 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[] = =3D { PFUZE100_VGEN_REG(PFUZE3000, VLDO4, PFUZE100_VGEN6VOL, 1800000, 3300000, = 100000), }; =20 -static struct pfuze_regulator pfuze3001_regulators[] =3D { +static const struct pfuze_regulator pfuze3001_regulators[] =3D { 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, 5000= 0), --=20 2.43.0 From nobody Thu Sep 19 10:38:52 2024 Received: from mail-ej1-f48.google.com (mail-ej1-f48.google.com [209.85.218.48]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 867E41BD50C for ; Mon, 9 Sep 2024 13:52:00 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.218.48 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1725889922; cv=none; b=dx18xLndvQABt+A+4XM8UHNajRhs7PEdbQh0kgvPydlqtgfgXRJACwNCvfT+76hGRrPoadtFzxpZXqVeZisgejFEojMQidP9T9C6OknVup1OyrIZjiNCW1MlyKespeD2YTFkxwGMteCXA2XiDuJ5XUMJhyuYuMHZvUlekFR7VsA= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1725889922; c=relaxed/simple; bh=KcmtvuFpgJTQr+NrBtSfkFBmPuXrmTaJALoNQh34mgc=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=WH6SVHIZsp9tLWjlT8YVN4tzgjKKJu5heft19VGs3DSQhqKfUzZ1NiHx+CbANYOF8UcuIjEzRLXGaCiCA8jq60iPfb7FfDLyLzrp5WWQDhgaLl+nkbAsTdElBwxfFTP0InXDy7fjiwqItn/jcd2wvltorOlKvVxMBZUgybxwMyE= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org; spf=pass smtp.mailfrom=linaro.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b=hRLE5843; arc=none smtp.client-ip=209.85.218.48 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linaro.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="hRLE5843" Received: by mail-ej1-f48.google.com with SMTP id a640c23a62f3a-a866902708fso27001366b.2 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=vger.kernel.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=hRLE58431O4jWlmDRO9pSSIqVkku9/ZqtjQbWzUn0hgeYQY221/VArCutRKpjIziMc 2fTkeNGPgORNePow5q7ZWpmhFxxLxpJkcLE40y71H96cgUoSAGIr1DgZpHFpBYngaq2R dSywm3TXDbRSRpBt4KKQubR3UFjXejn/gjY3Qp9SCoWfamOGcroPyRUzvihK/11PujpA U69gCDFuyfnxAOplZEb6QUCCUwuIFmHdzEKswlfGu84CYVC/L7B4lJYsSUTE33ufMEqe T+kLnpllsoqgM55XvrZrTmRWTEYOjv9caflIha0tZgMQhPsLKPe1W0QYfMu3G81xOh0R ptSw== 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=G88wYSlfcQh2dNn4MX0vQUmhuC6dC2MxINKcGWfrckNYB9+PrroR9gIf6N8lI7aSfY jGaaD2wn9fSS+l41gOYtgJuJ95BdoYrPMSCs6q84z1ifXt++V6bcR4PjBaS30XKLeB7H YgnPvhKVY74YJmyvRThP4QCDgbI/OMs8ho3hVwYUj+SKE47XAiEfiIJftZina4iAVh4I f03cEJXHkk2S1cf+JGEHyskiXcEgcJ0eZQt+7Lycnjk+Bls8502K91Nc6FIoesMRXp4M jKpFHMELsbGX7+8NgTGfW7h55q51BYqyI411dBp5elY/2LoT9oiamQ9YmNA2RsimOCJ1 8i9A== X-Gm-Message-State: AOJu0YwdlFjpBDM1nfIlgNA+YW5Pf8tp6Af3P0E1SlMiPWHAxDUk7Huy HW09f6B5PgRweKwAy+gtE4QvaZyzOK5oxl2JqEuA5p6Nsv06gz5Rnbd/irUQ63A= 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 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable 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 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; } =20 -static struct regulator_desc sdm845_refgen_desc =3D { +static const struct regulator_desc sdm845_refgen_desc =3D { .enable_time =3D 5, .name =3D "refgen", .owner =3D THIS_MODULE, @@ -74,7 +74,7 @@ static struct regulator_desc sdm845_refgen_desc =3D { }, }; =20 -static struct regulator_desc sm8250_refgen_desc =3D { +static const struct regulator_desc sm8250_refgen_desc =3D { .enable_reg =3D REFGEN_REG_PWRDWN_CTRL5, .enable_mask =3D REFGEN_PWRDWN_CTRL5_MASK, .enable_val =3D REFGEN_PWRDWN_CTRL5_ENABLE, --=20 2.43.0 From nobody Thu Sep 19 10:38:52 2024 Received: from mail-ed1-f42.google.com (mail-ed1-f42.google.com [209.85.208.42]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id E07AC1BD518 for ; Mon, 9 Sep 2024 13:52:01 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.208.42 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1725889924; cv=none; b=fTAiP0lQw8L4KR2x7xs9QrajcSXO6RYrwxRljq+Xa64E/NewyvTSCnULzqKQ+6zNCfh8v/Oh/qRfX9rGpOhaWhHdkIOakS8NCXl0YDYKwfoyMwXzm877knSQUDHNnPjmd0qX22zWj9+hJSEXnJex22pnF2FQr2p2s0OgpkqL2yw= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1725889924; c=relaxed/simple; bh=30I+hQDkibrC4fpctSIcG7hdlAaMTfnXmLnvdZibnpU=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=oomXw3o8QZWS0O1zy8LiY1jAARbhHOlxfYYKWpw+nE0b7dA8ETlCnwmNMNUSgoiz24Cpj+Ly0+z0BIUj/OiiVMwokTSXGVpxt0It5FPMWWjpHs1kTidkcH7depUyhlM4p2SWSHAxCPIFO2LnH1rDgVDK9z8C3kaRsJ77QTIrv1A= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org; spf=pass smtp.mailfrom=linaro.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b=SpU23G7J; arc=none smtp.client-ip=209.85.208.42 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linaro.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="SpU23G7J" Received: by mail-ed1-f42.google.com with SMTP id 4fb4d7f45d1cf-5c255eab93dso416863a12.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=1725889920; x=1726494720; darn=vger.kernel.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=SpU23G7JvwPVip2PWQ5P8j1Q/c4+OFN9lP5fidFKUJ8ariFjLySEXNeDSh8mmNpSsI DI+3XUMeOJMhF6SuSncLC5sHie+N4D+nRp+6GqPxivlKbCGfLr+kQAJbtfQsS1CrpPfW knk5NqKqQgErLgGGGYsg3Eg6R66fM7+CjVrl5a3n7JsYtF5HK68xAviRKNlLH1q+PJGv HHXNGQRTWd9HPFK/e1DKKqGjQMeAallamqjWo93MspWYZ4NKkmotQ1yJXIeoNcOrwDKT 74HZGezE24NpCyMdaHxgCed9vHe6gLmXRXqwdvitljWsay5xakCKXENBdI+dPDcknnCp qOyw== 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=G8deEQQajmnLbs1ArfCwBlFtjEBVuRHPJ4yhB9DHjtsX3oECDtToGwxtSp1fYyHAY4 77R6Gpx6n1zngISDRJVbTeziV45j529EKPVf8ymr7dF8Oq1ofJjNm+fcyouX1iqE6dfL 7uQozLnLr/DMqpzpIxXghH/pl1686XMNaWdVGWtjljKsDAEiyQz0yqjfUP5zJt47Haho mmie9qxYcBTrigXKAbQtL+fp+mif0wI/GLoMNMBCHbcfuuUNYgk4gap1KKN4ALOraL3w BURlRyj6xizuP8Y3Z+aKQSJ1LE7pJk1DRPv0yZbP+/6ep8jUyjih3bVTQJUgw7tlGgjY JjsQ== X-Gm-Message-State: AOJu0YyaJHT82zwNzeLvUoJZW1f/KzWFxJgLyvZV6il2ys01Qt6O3O88 53nCqSKXGusKmj5mdSYySs5d1BC8buC7HAiKHQQwUX5qb2HEHa7BcjVzffUGSdY= 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' Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable 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 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/h= i6421v530-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; }; =20 /* 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 =3D { \ .name =3D #_ID, \ .of_match =3D of_match_ptr(#_ID), \ @@ -90,22 +87,21 @@ static const struct regulator_ops hi6421v530_ldo_ops; .off_on_delay =3D odelay, \ }, \ .mode_mask =3D ecomask, \ - .eco_microamp =3D ecoamp, \ } =20 /* HI6421V530 regulator information */ =20 static struct hi6421v530_regulator_info hi6421v530_regulator_info[] =3D { 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), }; =20 static unsigned int hi6421v530_regulator_ldo_get_mode( --=20 2.43.0 From nobody Thu Sep 19 10:38:52 2024 Received: from mail-ej1-f52.google.com (mail-ej1-f52.google.com [209.85.218.52]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 2693C1BA27F for ; Mon, 9 Sep 2024 13:52:03 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.218.52 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1725889924; cv=none; b=fUk9P83oTS17pCgW81B1uMysvya5FxoaguhmcxBKuiZjUwc1HatSZFgjKXGLUzlOXp+GXEHPjjgtDUH4H6LApwSayHYCyzcwyKA7Xcm3b8VgQ4E7xajrVxW8TvtziBMro5OhHzrySmwPdHuahetKp/DgB6M9yrJOPoioWsx5UpU= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1725889924; c=relaxed/simple; bh=QfpMH8xpX7M5v1cNMdTuKAFwaOO0ijMMMrIuqJNJ7Fc=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=JQoUCd9Ik9vmnJdIY/EWFBPzjsB+aYHQLfnG1i8xZmWCJ02+MBEJTG67QILdKGX3PRdeFRzwIKLAPIkN5d8VypOnSi1OqODxZc0cv073IIimKINdqYIHRkO+s9+XNcAiQUnq4BxxQWLI2KkgmWzRAQNOezKOvvUm5ZGo00w4kzo= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org; spf=pass smtp.mailfrom=linaro.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b=TTMniVFR; arc=none smtp.client-ip=209.85.218.52 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linaro.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="TTMniVFR" Received: by mail-ej1-f52.google.com with SMTP id a640c23a62f3a-a8a92e8c840so38153466b.2 for ; Mon, 09 Sep 2024 06:52:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1725889921; x=1726494721; darn=vger.kernel.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=TTMniVFRkH7FAW64HG0nVKhi7SVcFNDUXg/BNNoI1aifgw0L6hVZrZSjOeCqXl61+b ES93oSt+YKovm1dUCxenX1Ed4egEPg7QwncUpVRDh27M1HDGQBp9MeNp/ihpUahajpQV 5wiyiswV8+/mzom0u6rJe1rgK9l9Ps9X6qAtZ3CHvUPZqccX3ejAuvga+yzic24Z0mf4 EneCVg9LXZNS2wGiw3Tx6UZ5QBUwnWInbd0O7kSTHMHMmkrC3oDXM6PgwhIhjC0nQwSN QTwXu6a6+vFof0P2Yr4fn5GRDD7bMqfyeGdfJGwj4amB06T4cjRzvs2EjTT9Sa4CIX9W SJng== 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=npiFZZWhD68KDE+/0xyM1kYuU7FxfvPmfcCu0t2+iVPU21vtVy2r+kStlrBr0Pfrgj RK8nDPu5HFq+4g8GeF1s1GtWXEYI0tP1FeVMGbwI9TaviSpVvMDXvyQoZi/UHhJq9WNN hVP5ceaqa9Xno5DJB0AgWnVn+Jl15QqenRwYr/3JJiyfECdmnToHhwmseXqW+MS9/Wmd 9PolsUf2NelYDioRS7N09lKMhgszKXMnyZHvJ5geAK8d2e+Uh6LmXgzwdY8inCtx1+3J dnmjlOqhWewubzYSYstGNScIDoKZfdvWcBOEEK3pAqjKk0F7tGmQLZDAMzDzsB57U3HH fkaQ== X-Gm-Message-State: AOJu0YyKAAufVuv8cTEIveR1/X8stFLhcT8wytMolAVffnIPIEF4Rlky UXJWDx4pVNjQpqyZXvO3bYnX8zs9EfVNSytZxX/owM1WhEtZiqidOxxGPXvUXsk= 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 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable 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 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/h= i6421v530-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; =20 /* HI6421V530 regulator information */ =20 -static struct hi6421v530_regulator_info hi6421v530_regulator_info[] =3D { +static const struct hi6421v530_regulator_info hi6421v530_regulator_info[] = =3D { 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_re= gulator_info[] =3D { 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; =20 - info =3D rdev_get_drvdata(rdev); + info =3D container_of(rdev->desc, struct hi6421v530_regulator_info, rdesc= ); regmap_read(rdev->regmap, rdev->desc->enable_reg, ®_val); =20 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; =20 - info =3D rdev_get_drvdata(rdev); + info =3D container_of(rdev->desc, struct hi6421v530_regulator_info, rdesc= ); switch (mode) { case REGULATOR_MODE_NORMAL: new_mode =3D 0; @@ -172,7 +172,6 @@ static int hi6421v530_regulator_probe(struct platform_d= evice *pdev) for (i =3D 0; i < ARRAY_SIZE(hi6421v530_regulator_info); i++) { config.dev =3D pdev->dev.parent; config.regmap =3D pmic->regmap; - config.driver_data =3D &hi6421v530_regulator_info[i]; =20 rdev =3D devm_regulator_register(&pdev->dev, &hi6421v530_regulator_info[i].rdesc, --=20 2.43.0 From nobody Thu Sep 19 10:38:52 2024 Received: from mail-ej1-f52.google.com (mail-ej1-f52.google.com [209.85.218.52]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id A76E81BDAB4 for ; Mon, 9 Sep 2024 13:52:04 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.218.52 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1725889926; cv=none; b=LYXKFTUU5kGtUlQWv/Ums8MgHsIymwV25MC2a+6S8W2Tu/vumG1su9DqGDt2IY3nj2G6BI854N4vhaBHU088hQRdGS/MdoEeVGwK3gRwvA0Rs3OSUXSzrBhryWU+/+oFdHugQd6hjdCzet6mBQNNgHYZ00KsrPgNMf+VtUtbKC4= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1725889926; c=relaxed/simple; bh=pT3vklV3r+mZAGNAtUkG8vU9TQS654l0/1TCGybfK8Q=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=K9J3sEAYDH+Y+y+qU5ogqvGaclWGbpz6D/CNvl+NI7l8D8KqiDD1YLBCsieY6U7zGllx3esJSIYsSe/VDfEUbVf98YZKfmTJqQ+/YimzoRQCnpVP6lUl6vWQURUxnLuGx/jNrUViTFPTPHGd6pyFZ/CxQcWJYHqWdT3dd7bBbEs= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org; spf=pass smtp.mailfrom=linaro.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b=I8wfYX8t; arc=none smtp.client-ip=209.85.218.52 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linaro.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="I8wfYX8t" Received: by mail-ej1-f52.google.com with SMTP id a640c23a62f3a-a8d2bd7dcd4so8404666b.3 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=vger.kernel.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=I8wfYX8tfs3bIUlo+wVdT9N2bWdXNilZsA16A0aBYWQvU41B9k4wGQKA7PSt/SuTnE i9h68NKghMh/rW7+nwbDgntYi1OEtloe+Btx+m24cPiF0IlMcJJv0sMe7VDlBHUKEerh 56RnAjrf0KXE0Cl6M5YnZUZm5sDfpHF1J8fQDpLH2mhvg2srThDWZ0tA157GRz94L50Y 2znr2H3wn18tyU2Lt57f6MRaTJFS23Yx7BqdfnbAhgjfsLELZO8ddkX5IvMGRkJFP067 +XCKDco8sKxlpDKsY4MQnXkGVo7c3oiaCAHLTf0sNpq6PafIT9QxsMpF6hSngEZy2sKP hyqw== 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=ORXLVJPUvxNfHkAr8z0RiTlLNMisiw6v/2BngtZBbo5pAA4kttT1aOIuRBvK4DszEq /sF6Ye3gv4JkaRxfB6W6+6lNWp9N8lkd8wayI+AcncMxPYI3hbJgpKjzBHvEJya3kLZU RyMD6lXtt4+iLr3lpHbzlKAP0lUuwOhqoC9Tk0LGLlvUtwnvUXK0MTglcApdnbkwUzba h08iCjoioTwzrau995Ymx5levt0P8I73aZuWp96VjBt77IkBoaYuDWwWbBFcKMPDDgri u6avdLVNs8U3tAxJ7zqsUDKQtpkNipF1045B5+yimqSiMn/QTIHpJnCd8xhnVP1nCk4B l56g== X-Gm-Message-State: AOJu0YwNb8Tys5WONtJcPJylx+n5CEd5FAxWDHMP5ZqejGIOhd1ypZqw MzV19ysJW++8Q8+w4UrF9uayapC5H3MDhC4+VJcOtwMXykfwtGb1PDFDn/YRrtY= 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 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable 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 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/max= 77650-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; }; =20 -static struct max77650_regulator_desc max77651_SBB1_desc; - static const unsigned int max77651_sbb1_volt_range_sel[] =3D { 0x0, 0x1, 0x2, 0x3 }; @@ -66,11 +64,11 @@ static const unsigned int max77650_current_limit_table[= ] =3D { =20 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; =20 - rdesc =3D rdev_get_drvdata(rdev); + rdesc =3D container_of(rdev->desc, struct max77650_regulator_desc, desc); map =3D rdev_get_regmap(rdev); =20 rv =3D regmap_read(map, rdesc->regB, &val); @@ -84,10 +82,10 @@ static int max77650_regulator_is_enabled(struct regulat= or_dev *rdev) =20 static int max77650_regulator_enable(struct regulator_dev *rdev) { - struct max77650_regulator_desc *rdesc; + const struct max77650_regulator_desc *rdesc; struct regmap *map; =20 - rdesc =3D rdev_get_drvdata(rdev); + rdesc =3D container_of(rdev->desc, struct max77650_regulator_desc, desc); map =3D rdev_get_regmap(rdev); =20 return regmap_update_bits(map, rdesc->regB, @@ -97,10 +95,10 @@ static int max77650_regulator_enable(struct regulator_d= ev *rdev) =20 static int max77650_regulator_disable(struct regulator_dev *rdev) { - struct max77650_regulator_desc *rdesc; + const struct max77650_regulator_desc *rdesc; struct regmap *map; =20 - rdesc =3D rdev_get_drvdata(rdev); + rdesc =3D container_of(rdev->desc, struct max77650_regulator_desc, desc); map =3D rdev_get_regmap(rdev); =20 return regmap_update_bits(map, rdesc->regB, @@ -145,7 +143,7 @@ static const struct regulator_ops max77651_SBB1_regulat= or_ops =3D { .set_active_discharge =3D regulator_set_active_discharge_regmap, }; =20 -static struct max77650_regulator_desc max77650_LDO_desc =3D { +static const struct max77650_regulator_desc max77650_LDO_desc =3D { .desc =3D { .name =3D "ldo", .of_match =3D of_match_ptr("ldo"), @@ -171,7 +169,7 @@ static struct max77650_regulator_desc max77650_LDO_desc= =3D { .regB =3D MAX77650_REG_CNFG_LDO_B, }; =20 -static struct max77650_regulator_desc max77650_SBB0_desc =3D { +static const struct max77650_regulator_desc max77650_SBB0_desc =3D { .desc =3D { .name =3D "sbb0", .of_match =3D of_match_ptr("sbb0"), @@ -201,7 +199,7 @@ static struct max77650_regulator_desc max77650_SBB0_des= c =3D { .regB =3D MAX77650_REG_CNFG_SBB0_B, }; =20 -static struct max77650_regulator_desc max77650_SBB1_desc =3D { +static const struct max77650_regulator_desc max77650_SBB1_desc =3D { .desc =3D { .name =3D "sbb1", .of_match =3D of_match_ptr("sbb1"), @@ -231,7 +229,7 @@ static struct max77650_regulator_desc max77650_SBB1_des= c =3D { .regB =3D MAX77650_REG_CNFG_SBB1_B, }; =20 -static struct max77650_regulator_desc max77651_SBB1_desc =3D { +static const struct max77650_regulator_desc max77651_SBB1_desc =3D { .desc =3D { .name =3D "sbb1", .of_match =3D of_match_ptr("sbb1"), @@ -264,7 +262,7 @@ static struct max77650_regulator_desc max77651_SBB1_des= c =3D { .regB =3D MAX77650_REG_CNFG_SBB1_B, }; =20 -static struct max77650_regulator_desc max77650_SBB2_desc =3D { +static const struct max77650_regulator_desc max77650_SBB2_desc =3D { .desc =3D { .name =3D "sbb2", .of_match =3D of_match_ptr("sbb2"), @@ -294,7 +292,7 @@ static struct max77650_regulator_desc max77650_SBB2_des= c =3D { .regB =3D MAX77650_REG_CNFG_SBB2_B, }; =20 -static struct max77650_regulator_desc max77651_SBB2_desc =3D { +static const struct max77650_regulator_desc max77651_SBB2_desc =3D { .desc =3D { .name =3D "sbb2", .of_match =3D of_match_ptr("sbb2"), @@ -326,8 +324,8 @@ static struct max77650_regulator_desc max77651_SBB2_des= c =3D { =20 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 =3D { }; struct device *dev, *parent; struct regulator_dev *rdev; @@ -376,7 +374,6 @@ static int max77650_regulator_probe(struct platform_dev= ice *pdev) =20 for (i =3D 0; i < MAX77650_REGULATOR_NUM_REGULATORS; i++) { rdesc =3D rdescs[i]; - config.driver_data =3D rdesc; =20 rdev =3D devm_regulator_register(dev, &rdesc->desc, &config); if (IS_ERR(rdev)) --=20 2.43.0