From patchwork Mon Sep 9 13:51:12 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Krzysztof Kozlowski X-Patchwork-Id: 13797092 Received: from mail-ej1-f46.google.com (mail-ej1-f46.google.com [209.85.218.46]) (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 871991BA26C for ; Mon, 9 Sep 2024 13:51:41 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.218.46 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1725889904; cv=none; b=lnfmBmnoQh+mH9b5h9gFTlWXYi6JzV2hu/Tva9NGprffKfbrgaUUo9AJssy94uxASa8J/vFChC/HBCgYo0XNo3DBMiVld4gORRUNhmjc2qvXF0VKqW+FnL/DrJM47GkBLfFGyWOQkFEVXMGsGTnMrz3UsESawmH5II8aAUR8nrw= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1725889904; c=relaxed/simple; bh=8TsG7I4Aag1KJIfppBSqZ8uVGEQPJnXHOI9sdDJkZWs=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=VeiOnOqNiVYs6jCcCk1UzAyr5kNVm00jZhXy3qmEhKSCE1f9UNL9Ny+uMLnWW5r+6kP1YX1LimNeEal9q7GyD4XVWva31k5w/WB2/OHiZr1NWjkAb/Oj7e+I55AH7T/NFAvBSU+IoxkUYA+52Par9o4QrRSxUsm8lYwQCbFiRCg= 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.46 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-f46.google.com with SMTP id a640c23a62f3a-a8a7dddd2c3so30090666b.3 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=tGgriehMC92eqwajZHdxJFQRuf+pdS4aDtT7u0s3QV2kLTeMnuDBp4DclDjVBWP8ay 2Y7sX9xmSyMPkcoQ+XATJPdajNkW4rkTIBzsHdhwR2Y2OHtN+737St2x62c55jMmWaGs tpxrsQnZS3tb6VIQ7QCrYk76NisxOlg3RZPqaDOrPyKB8rWyCH3t7q+Zt+LFBft7fEqF z8Afq79Oe2P3DoJKADbYvR8nNlUEfbFcyGCc08yYcyoChg8vQxmOm2yNYJj2fGHcUjfn gaZJzLQp7kPEmMCY+3akikb9+WUnVdSct9K/aKSbVNx+/w4pEK9fe/uXqbYL5dubX/kv zunQ== X-Forwarded-Encrypted: i=1; AJvYcCVMNQXTpigibShJtf+92RYkKoM9OhpX8lCKI6zrga521dW3zNdEAgwwZ3vRpvycw4Mj3SWgtNmocR4OFpmu@vger.kernel.org X-Gm-Message-State: AOJu0Yz8XhWgdn3QKqlAeP3MX1roJ+Y88guL8lp2r0rDd8ydxBS+IrOa yQCcqrvXvFXQc6V0c4htNET7Jxcw5ztN4tFm2H3Q8rtOnyoONEyl1/Q8rMg5M/E= 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-arm-msm@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20240909-regulator-const-v1-1-8934704a5787@linaro.org> References: <20240909-regulator-const-v1-0-8934704a5787@linaro.org> In-Reply-To: <20240909-regulator-const-v1-0-8934704a5787@linaro.org> To: Support Opensource , Liam Girdwood , Mark Brown , Matthias Brugger , AngeloGioacchino Del Regno , Bartosz Golaszewski Cc: linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org, linux-arm-msm@vger.kernel.org, Krzysztof Kozlowski X-Mailer: b4 0.14.1 X-Developer-Signature: v=1; a=openpgp-sha256; l=3897; i=krzysztof.kozlowski@linaro.org; h=from:subject:message-id; bh=8TsG7I4Aag1KJIfppBSqZ8uVGEQPJnXHOI9sdDJkZWs=; b=owEBbQKS/ZANAwAKAcE3ZuaGi4PXAcsmYgBm3v1ZDiVz4RaFZ9OBGUmyELamJcU43wcaBdMnp 7IbKy42NI+JAjMEAAEKAB0WIQTd0mIoPREbIztuuKjBN2bmhouD1wUCZt79WQAKCRDBN2bmhouD 1yUaD/4uEeY8qieO9UVWcfXUAM+yl+Ah/eISeRWtTgnULmCJznpSj1re/9hypLugcAre2+xitID Tq8ncG/lwdIQRCidg0yWXhmYTBM0IBnVwqPdTTS5aawbalrzDgmhH7kOl7hnmK3NwAjYipICwVc Yf1S5t0yj3dvSYPe8m4cScsFw8Yr1F1xjyMhMZefDWSgOwAUSlhI60QMpc33YtRegPIiWFTquuA bwzd3/+R94rpat8S/FDs0drkfSVcnGk2Ex9sYsd1gv5/koShUW2LT2su58Pxk74uJdEVNfF63CB i1q+bSTWMacll2wHjWYP2BupjluZtzu+6SHjjvn77ba1cexeY+yc3f4P0IGFhcU5IyrxaXGUhrj aTOaasOe3DZVrqd1B9iMU4B7FfCjA5QYSKNtTRqFEVhj19/BLtpp8IZj+lLCikhk82YTEynAF71 9oh66ez1QhjOsm6PiIee6uzFOMVQjdzOAzcMO1riGr2NltOGAgFULtIAVkZ7zP1rOUV5EYq8Qm2 Vdwqhs8uM8Q81U+AwEozboyxkthdl79nY6dwR2ANzIomtERLiQH3owdNeOjdXK7nlkbajN5TrRf Ott2t9N1PMbBZd1t6MISLvamkah9kJWWx7VCEEjtsC7VXLrMdaCBLyi9BlpEOczRz1Hmnqdr+I7 MqltipNYXK0CDcA== X-Developer-Key: i=krzysztof.kozlowski@linaro.org; a=openpgp; fpr=9BD07E0E0C51F8D59677B7541B93437D3B41629B Driver does not modify static data with regulators description (struct da9052_regulator_info), so make it const for code safety. Signed-off-by: Krzysztof Kozlowski --- drivers/regulator/da9052-regulator.c | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/drivers/regulator/da9052-regulator.c b/drivers/regulator/da9052-regulator.c index ab6f5d61b173..fbebe538a648 100644 --- a/drivers/regulator/da9052-regulator.c +++ b/drivers/regulator/da9052-regulator.c @@ -67,11 +67,11 @@ struct da9052_regulator_info { struct da9052_regulator { struct da9052 *da9052; - struct da9052_regulator_info *info; + const struct da9052_regulator_info *info; struct regulator_dev *rdev; }; -static int verify_range(struct da9052_regulator_info *info, +static int verify_range(const struct da9052_regulator_info *info, int min_uV, int max_uV) { if (min_uV > info->max_uV || max_uV < info->min_uV) @@ -151,7 +151,7 @@ static int da9052_list_voltage(struct regulator_dev *rdev, unsigned int selector) { struct da9052_regulator *regulator = rdev_get_drvdata(rdev); - struct da9052_regulator_info *info = regulator->info; + const struct da9052_regulator_info *info = regulator->info; int id = rdev_get_id(rdev); int volt_uV; @@ -175,7 +175,7 @@ static int da9052_map_voltage(struct regulator_dev *rdev, int min_uV, int max_uV) { struct da9052_regulator *regulator = rdev_get_drvdata(rdev); - struct da9052_regulator_info *info = regulator->info; + const struct da9052_regulator_info *info = regulator->info; int id = rdev_get_id(rdev); int ret, sel; @@ -206,7 +206,7 @@ static int da9052_regulator_set_voltage_sel(struct regulator_dev *rdev, unsigned int selector) { struct da9052_regulator *regulator = rdev_get_drvdata(rdev); - struct da9052_regulator_info *info = regulator->info; + const struct da9052_regulator_info *info = regulator->info; int id = rdev_get_id(rdev); int ret; @@ -237,7 +237,7 @@ static int da9052_regulator_set_voltage_time_sel(struct regulator_dev *rdev, unsigned int new_sel) { struct da9052_regulator *regulator = rdev_get_drvdata(rdev); - struct da9052_regulator_info *info = regulator->info; + const struct da9052_regulator_info *info = regulator->info; int id = rdev_get_id(rdev); int ret = 0; @@ -327,7 +327,7 @@ static const struct regulator_ops da9052_ldo_ops = { .activate_bit = (abits),\ } -static struct da9052_regulator_info da9052_regulator_info[] = { +static const struct da9052_regulator_info da9052_regulator_info[] = { DA9052_DCDC(BUCK1, buck1, 25, 500, 2075, 6, 6, DA9052_SUPPLY_VBCOREGO), DA9052_DCDC(BUCK2, buck2, 25, 500, 2075, 6, 6, DA9052_SUPPLY_VBPROGO), DA9052_DCDC(BUCK3, buck3, 25, 950, 2525, 6, 6, DA9052_SUPPLY_VBMEMGO), @@ -344,7 +344,7 @@ static struct da9052_regulator_info da9052_regulator_info[] = { DA9052_LDO(LDO10, ldo10, 50, 1200, 3600, 6, 6, 0), }; -static struct da9052_regulator_info da9053_regulator_info[] = { +static const struct da9052_regulator_info da9053_regulator_info[] = { DA9052_DCDC(BUCK1, buck1, 25, 500, 2075, 6, 6, DA9052_SUPPLY_VBCOREGO), DA9052_DCDC(BUCK2, buck2, 25, 500, 2075, 6, 6, DA9052_SUPPLY_VBPROGO), DA9052_DCDC(BUCK3, buck3, 25, 950, 2525, 6, 6, DA9052_SUPPLY_VBMEMGO), @@ -361,10 +361,10 @@ static struct da9052_regulator_info da9053_regulator_info[] = { DA9052_LDO(LDO10, ldo10, 50, 1200, 3600, 6, 6, 0), }; -static inline struct da9052_regulator_info *find_regulator_info(u8 chip_id, - int id) +static inline const struct da9052_regulator_info *find_regulator_info(u8 chip_id, + int id) { - struct da9052_regulator_info *info; + const struct da9052_regulator_info *info; int i; switch (chip_id) { From patchwork Mon Sep 9 13:51:13 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Krzysztof Kozlowski X-Patchwork-Id: 13797093 Received: from mail-ej1-f44.google.com (mail-ej1-f44.google.com [209.85.218.44]) (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 B58021BA26E for ; Mon, 9 Sep 2024 13:51:42 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.218.44 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1725889904; cv=none; b=fRmkTOG926ou0eX9d2XL2T+198RH2p7EfXp3L8170rbN5lTrkHLtxYbnt/SVB1ast4FbbYEohpK1bZWHBx3k5wOoBfCw8wnQsJl+fyZIoXqiLaz3mixNbSyWVBhdn+SaYXx+7JWQgcBVuvrl74e+oRTnmpYtxcNK2I92gZfWWpo= 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.44 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-f44.google.com with SMTP id a640c23a62f3a-a8713b00219so23252266b.0 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=XIJT64/iyk1v+96lZcnzoEyxBhoBP+JUrIecMUIqgo7gOz5hEdmpWN/JReRmzk0MzV jiJv4fRieA5g/WarWr3X9CqYe6Nn3amikldnROAEbLT57r1/3RF5wPTuO64dyv0bKMmo x1KVqQTMkBMeO4elhj2Ulf4obhm5ytn2VQ1skywW2V8LoW3GDaP9JygxQ5SPRaQU5rdm zDMV+Lk5xrgonSOfRP0ooN7mqX0urai2/MZGt/JT9mLWVZ362paZAe9ExWtLZUpzsCq/ 14w+M7f/HeaE2KSF+Mc3z74KjQnyJCqweSL+EUarii7sFIF4WXncfUR29POlPk+6/2OA viEg== X-Forwarded-Encrypted: i=1; AJvYcCXLuZTgBapypOE9n69ti9m7T20vpxDV5jItOqbPYQtOcMTvTHM247QDCl3111SAaEc4kRveYKz0LWWBW/kD@vger.kernel.org X-Gm-Message-State: AOJu0YycwxESI6o5VSALMhOcLnutVZfn42NLAYs14kOMtMnuSW750teA tauK5kIqZ6ZI0jLL+O5fT6g+zq53dJyRy6rN2tU+OM+5kTfPQdS9AmJDGJ0T4xk= 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-arm-msm@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20240909-regulator-const-v1-2-8934704a5787@linaro.org> References: <20240909-regulator-const-v1-0-8934704a5787@linaro.org> In-Reply-To: <20240909-regulator-const-v1-0-8934704a5787@linaro.org> To: Support Opensource , Liam Girdwood , Mark Brown , Matthias Brugger , AngeloGioacchino Del Regno , Bartosz Golaszewski Cc: linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org, linux-arm-msm@vger.kernel.org, Krzysztof Kozlowski X-Mailer: b4 0.14.1 X-Developer-Signature: v=1; a=openpgp-sha256; l=5542; i=krzysztof.kozlowski@linaro.org; h=from:subject:message-id; bh=7T+l2SN6pqbE6hOx06iBBg4xZdBmuecLOUZCOIFvMyE=; b=owEBbQKS/ZANAwAKAcE3ZuaGi4PXAcsmYgBm3v1a58opF52+48fMopZc5Ie9MgwbFtabVspDx XEDU3SMO8GJAjMEAAEKAB0WIQTd0mIoPREbIztuuKjBN2bmhouD1wUCZt79WgAKCRDBN2bmhouD 10RTD/0R3aEMOqjsaXdiCVQWplC8EpgbLj8ZanFKI2VfbsehBl68HKT/D98YBx6czQKoVB2yrlW PYvASCaQUm5YWQWux7cw+yXpnbq7LVSD6eNjRVw/q6tmWdrstD+Qn7t4HN1ktZzo4oBK7rlvLMc x3mtMz9FRaTzTH5Nazadk42WBjKw7mxTr7QMxR442nCi5/HyqlGDYagpIJNG+XYLQbo1iVKmoDG 6Zu3wrt2pSFqWk18Hy3ShRYELnzjdFhiSB1RnGaByDwQxBdg+u445qBb0su71+1+Bmpl9rk/jkv 8hTlPMk4mSpkaGLWV2CNJ7MhjGvhJTL7pqhlkp43GHePiUHF+W6FVUjupqQueyG7j9xL7FNAv5I ZnioNWLnhS0coGeh1Bgp9zHoRR7yCcHX60En5L5lup9oBDNW6vF6HWQacApjh8sf8cz/QCGzE7x 9wfWe3KsjQaYpjDKD37c1cjI6nF4TMPL9LyQptdgS0aIV+OxuW29I3DaXtVANuU4FZtuM8iY1V1 Y8pmzsl+sjIGQoE9cOvo30Y6+9j/nBeVgPRRvzpfxAEnPQPCNBZJb43aa8IRZF95de7aeqSeppV rL2WZ13ht2jGqi8aKSJYLtaWv7WdHrP8TDes+0K/pPUhR8b7Rve8G/CRjwFQGxWWB1WKgA8ERYB BHYCyhf+ywSoirw== X-Developer-Key: i=krzysztof.kozlowski@linaro.org; a=openpgp; fpr=9BD07E0E0C51F8D59677B7541B93437D3B41629B Driver does not modify static data with regulators description (struct da9055_regulator_info), so make it const for code safety. Signed-off-by: Krzysztof Kozlowski --- drivers/regulator/da9055-regulator.c | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/drivers/regulator/da9055-regulator.c b/drivers/regulator/da9055-regulator.c index 352547c375bd..a0d3414aa79e 100644 --- a/drivers/regulator/da9055-regulator.c +++ b/drivers/regulator/da9055-regulator.c @@ -73,7 +73,7 @@ struct da9055_regulator_info { struct da9055_regulator { struct da9055 *da9055; - struct da9055_regulator_info *info; + const struct da9055_regulator_info *info; struct regulator_dev *rdev; enum gpio_select reg_rselect; }; @@ -81,7 +81,7 @@ struct da9055_regulator { static unsigned int da9055_buck_get_mode(struct regulator_dev *rdev) { struct da9055_regulator *regulator = rdev_get_drvdata(rdev); - struct da9055_regulator_info *info = regulator->info; + const struct da9055_regulator_info *info = regulator->info; int ret, mode = 0; ret = da9055_reg_read(regulator->da9055, info->mode.reg); @@ -107,7 +107,7 @@ static int da9055_buck_set_mode(struct regulator_dev *rdev, unsigned int mode) { struct da9055_regulator *regulator = rdev_get_drvdata(rdev); - struct da9055_regulator_info *info = regulator->info; + const struct da9055_regulator_info *info = regulator->info; int val = 0; switch (mode) { @@ -129,7 +129,7 @@ static int da9055_buck_set_mode(struct regulator_dev *rdev, static unsigned int da9055_ldo_get_mode(struct regulator_dev *rdev) { struct da9055_regulator *regulator = rdev_get_drvdata(rdev); - struct da9055_regulator_info *info = regulator->info; + const struct da9055_regulator_info *info = regulator->info; int ret; ret = da9055_reg_read(regulator->da9055, info->volt.reg_b); @@ -145,7 +145,7 @@ static unsigned int da9055_ldo_get_mode(struct regulator_dev *rdev) static int da9055_ldo_set_mode(struct regulator_dev *rdev, unsigned int mode) { struct da9055_regulator *regulator = rdev_get_drvdata(rdev); - struct da9055_regulator_info *info = regulator->info; + const struct da9055_regulator_info *info = regulator->info; struct da9055_volt_reg volt = info->volt; int val = 0; @@ -167,7 +167,7 @@ static int da9055_ldo_set_mode(struct regulator_dev *rdev, unsigned int mode) static int da9055_regulator_get_voltage_sel(struct regulator_dev *rdev) { struct da9055_regulator *regulator = rdev_get_drvdata(rdev); - struct da9055_regulator_info *info = regulator->info; + const struct da9055_regulator_info *info = regulator->info; struct da9055_volt_reg volt = info->volt; int ret, sel; @@ -199,7 +199,7 @@ static int da9055_regulator_set_voltage_sel(struct regulator_dev *rdev, unsigned int selector) { struct da9055_regulator *regulator = rdev_get_drvdata(rdev); - struct da9055_regulator_info *info = regulator->info; + const struct da9055_regulator_info *info = regulator->info; int ret; /* @@ -242,7 +242,7 @@ static int da9055_regulator_set_suspend_voltage(struct regulator_dev *rdev, int uV) { struct da9055_regulator *regulator = rdev_get_drvdata(rdev); - struct da9055_regulator_info *info = regulator->info; + const struct da9055_regulator_info *info = regulator->info; int ret; /* Select register set B for suspend voltage ramping. */ @@ -264,7 +264,7 @@ static int da9055_regulator_set_suspend_voltage(struct regulator_dev *rdev, static int da9055_suspend_enable(struct regulator_dev *rdev) { struct da9055_regulator *regulator = rdev_get_drvdata(rdev); - struct da9055_regulator_info *info = regulator->info; + const struct da9055_regulator_info *info = regulator->info; /* Select register set B for voltage ramping. */ if (regulator->reg_rselect == NO_GPIO) @@ -277,7 +277,7 @@ static int da9055_suspend_enable(struct regulator_dev *rdev) static int da9055_suspend_disable(struct regulator_dev *rdev) { struct da9055_regulator *regulator = rdev_get_drvdata(rdev); - struct da9055_regulator_info *info = regulator->info; + const struct da9055_regulator_info *info = regulator->info; /* Diselect register set B. */ if (regulator->reg_rselect == NO_GPIO) @@ -396,7 +396,7 @@ static const struct regulator_ops da9055_ldo_ops = { },\ } -static struct da9055_regulator_info da9055_regulator_info[] = { +static const struct da9055_regulator_info da9055_regulator_info[] = { DA9055_BUCK(BUCK1, 25, 725, 2075, 6, 9, 0xc, 2), DA9055_BUCK(BUCK2, 25, 925, 2500, 6, 0, 3, 0), DA9055_LDO(LDO1, 50, 900, 3300, 6, 2), @@ -417,7 +417,7 @@ static int da9055_gpio_init(struct device *dev, struct regulator_config *config, struct da9055_pdata *pdata, int id) { - struct da9055_regulator_info *info = regulator->info; + const struct da9055_regulator_info *info = regulator->info; struct gpio_desc *ren; struct gpio_desc *ena; struct gpio_desc *rsel; @@ -491,9 +491,9 @@ static irqreturn_t da9055_ldo5_6_oc_irq(int irq, void *data) return IRQ_HANDLED; } -static inline struct da9055_regulator_info *find_regulator_info(int id) +static inline const struct da9055_regulator_info *find_regulator_info(int id) { - struct da9055_regulator_info *info; + const struct da9055_regulator_info *info; int i; for (i = 0; i < ARRAY_SIZE(da9055_regulator_info); i++) { From patchwork Mon Sep 9 13:51:14 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Krzysztof Kozlowski X-Patchwork-Id: 13797094 Received: from mail-ej1-f51.google.com (mail-ej1-f51.google.com [209.85.218.51]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 79A681BA297 for ; Mon, 9 Sep 2024 13:51:44 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.218.51 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1725889906; cv=none; b=IL3h86OknE0L1TN5yvNIPuAijPkWq2y6d0+ARj+R3RXWJ9p0mEaQpiuJ+36JSLkCAQOdTloDZSwewH44zeJpoTfQFAhb+rqFCdr28J9p1iV+alZupkBxLZkn18nhDHMx3NZbtyRinJ1VVPIehaNHiAhg7PiYzFLIeDuURihOiBg= 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.51 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linaro.org 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-f51.google.com with SMTP id a640c23a62f3a-a8d1a00e0d0so8613266b.3 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=vDwnE7mjQFi19qKGDNM3mJihHoX0G4y3b3uK9cjM5WenD7BPjuPKt9lIcBNh/9TGDe /Npn/ev9W30FZUPZqGa6ijxR8sdXaQl0RmA61KAbawUhl3JbSuoP2lZG5YoAJY/da/0c DHJAMJi+YmlkBjtPXgIVClXr/YoBGR5CDyRfbr5CV2ImgBm856VZZZSYkFBZo2oRQOO7 IEtzIo0hax4Aich5bLx+opF+96OjidBMmp7Ut/TeNh78x5+onZRzpfbk0YuTRE+VAbUa aCVr8l8ZIKKcizjr7LXeUaEGv2O/CvcDoNpBWqWjMSFlU0WnAdV35k65zfPIl/YmzxaY 0rIw== X-Forwarded-Encrypted: i=1; AJvYcCXaOrgm/mJ3amyxtfHeuXHXfUaCJLbeVH8xyG7uh7Gh4Q1OrNlgw6PhC/sr4YSx9DBlhJQ78mqb910FIl3J@vger.kernel.org X-Gm-Message-State: AOJu0YxWMF09uxRCpVSLfg8mEA4OeZFEUV3Oj5QOrhA6uR/xeIVg3wCc 5Or1CEdKh65odGe+wcLmdIV6fI36yKn65y6b855VDKbQbJctmXjgDTmJyG1502M= 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-arm-msm@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20240909-regulator-const-v1-3-8934704a5787@linaro.org> References: <20240909-regulator-const-v1-0-8934704a5787@linaro.org> In-Reply-To: <20240909-regulator-const-v1-0-8934704a5787@linaro.org> To: Support Opensource , Liam Girdwood , Mark Brown , Matthias Brugger , AngeloGioacchino Del Regno , Bartosz Golaszewski Cc: linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org, linux-arm-msm@vger.kernel.org, Krzysztof Kozlowski X-Mailer: b4 0.14.1 X-Developer-Signature: v=1; a=openpgp-sha256; l=911; i=krzysztof.kozlowski@linaro.org; h=from:subject:message-id; bh=cimxQ+TX+25hf08Y2OSBWqQRlO/c5kpOqNI/3js1eFk=; b=owEBbQKS/ZANAwAKAcE3ZuaGi4PXAcsmYgBm3v1aJDym6wmOtLH5Qt5LKDk2N02AojxWKhz4K 7VClE9YY1mJAjMEAAEKAB0WIQTd0mIoPREbIztuuKjBN2bmhouD1wUCZt79WgAKCRDBN2bmhouD 12+rEACRykGfztQAt5gbTMUTMyMn8xzuTgPdLneI0nYl5JLT+jE8VkvDxZUmTJ2z13t8uTC3sS6 D9bTzkZna1q7VwPTVYPz4XAqUSsY9/vStht6IJ8I2/V4LQgW4XoI9ZT4qF6g2jw8p7GmAd3yLVx sCxAXAcXG2wRZLDTJc+4eebjeJt5UiETDtn3kl7N0jPEnMUjtAKtDiyIvOKorktNw3zeNhoS5Qs BhmS+DVSniKZ91YA2Pkx1znNJW+jcDa5LZecJdiZN71cq/mLhvY8IocBaxs9fA1KLHOQXsXyEDc ZI6qtIb9uSSyuhUtFIlkUiCsmDucfrqqz4HD7fudjO7qs1hcqVPSEHt0oXIIHfJ8FznXbE/gAvl vvKdRnxXMS+kdFTdo/PvN8mw7sQZAM7JxrJ/v4/tKxz5sEyPLUfWIN8hMGb0wZbo+2+GioGiXYH h97DafFKcVZQaiDlk8Ad8YiT7OrxkuAb/FKyoDLaLyWUMYcjGle3LCDZCz1d0m8lO5qin6wUBHR 061ZU+JxWdGbU9cVoAJtaTlPfZQPaYxzhrMY8QqQQOLfZ8aAMN81CwMft0d4BDQvdH1r5T8334Z L94XDn9LI/rScybEhsQLmyWKku1AtA+JWCuJ/HOsXRm0mLo6PIDyGThxM39q2kJNo6bk1EzZ8Qc NsjeJtpj6cfgB5A== X-Developer-Key: i=krzysztof.kozlowski@linaro.org; a=openpgp; fpr=9BD07E0E0C51F8D59677B7541B93437D3B41629B Driver does not modify static data with device variant description (struct da9063_dev_model), so make it const for code safety. Signed-off-by: Krzysztof Kozlowski --- drivers/regulator/da9063-regulator.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/regulator/da9063-regulator.c b/drivers/regulator/da9063-regulator.c index 82bf321ae06f..4b5f1d6a4b3c 100644 --- a/drivers/regulator/da9063-regulator.c +++ b/drivers/regulator/da9063-regulator.c @@ -715,7 +715,7 @@ static const struct da9063_regulator_info da9063_regulator_info[] = { }; /* Link chip model with regulators info table */ -static struct da9063_dev_model regulators_models[] = { +static const struct da9063_dev_model regulators_models[] = { { .regulator_info = da9063_regulator_info, .n_regulators = ARRAY_SIZE(da9063_regulator_info), From patchwork Mon Sep 9 13:51:15 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Krzysztof Kozlowski X-Patchwork-Id: 13797095 Received: from mail-ej1-f43.google.com (mail-ej1-f43.google.com [209.85.218.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 BCBD41BA897 for ; Mon, 9 Sep 2024 13:51:45 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.218.43 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1725889908; cv=none; b=Md0BdpEsF/wQUrHxW2qUjSew6vfwsBL+7hjSlQ07HK5pHfy5FfpujR+qJw4xbdBwnhfOe8ElAPQ4AYH5M39dYOxMWYUq+SYDvFay8e6a7sjZLopt0KArzkLHbC2pbd+g3tfvzRK7vqN7+wv++gF0i5ZQJEdzBzywArqzDl+wFc4= 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.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="cyoDWfk1" Received: by mail-ej1-f43.google.com with SMTP id a640c23a62f3a-a866902708fso26993366b.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=kmg2rqEIAzM7VD8KmHd45q4PJay15W0h+VeMTq4+onWYpy5kLkRQKGwF9nOm0wETfw KdH4fWuwGXfXrNh69VBGKt2CYw7V1dKDe/LT9W7mJmIxNDsRrfc3WlA89Jxug2/x9qAY wfVf7eST7vE2oFapYLsKZ1AL4SgCcw4O5lvoj9OKX9JTIkLNtWcXTaCUfPuqz1WRTCwD TeanncigYIwfTkLruUCa0+UpZd9GUaRfBYB1DzmTAqZ8tP0TTdpRQUmqUknj1wY+O3aN cy+nvBNSm6jTeOJMDDDHHzM8/uEw04pM5vUjDfiVjWQEBYHX/zuunQEtUB/U+Yi7mllC sz7g== X-Forwarded-Encrypted: i=1; AJvYcCWzryAnSrKzormwuTlmBTMcmgtYCqLKjpNgV90WxFOSy5ztOyBrHQaKlSdyZPE/iRCVyj2rJEl3Wv4HaQwU@vger.kernel.org X-Gm-Message-State: AOJu0YzGwGi+3omfBa3jDAIazbjj/C9X0Wb36Sx4DIJJkZq+ev+EbUhx OfpZXLKExyIs+Ji6t+CL0VTdABSQ84O2uxyCHkIilF535RnB8I/uqgFwUy1VtKY= 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-arm-msm@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20240909-regulator-const-v1-4-8934704a5787@linaro.org> References: <20240909-regulator-const-v1-0-8934704a5787@linaro.org> In-Reply-To: <20240909-regulator-const-v1-0-8934704a5787@linaro.org> To: Support Opensource , Liam Girdwood , Mark Brown , Matthias Brugger , AngeloGioacchino Del Regno , Bartosz Golaszewski Cc: linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org, linux-arm-msm@vger.kernel.org, Krzysztof Kozlowski X-Mailer: b4 0.14.1 X-Developer-Signature: v=1; a=openpgp-sha256; l=3601; i=krzysztof.kozlowski@linaro.org; h=from:subject:message-id; bh=NpUoubZdNxPAP0/VQA+CguJJu4K+4PwUlJgiCI3BfEs=; b=owEBbQKS/ZANAwAKAcE3ZuaGi4PXAcsmYgBm3v1bGMGjRSX40m+jFUd3qXmQIrwJMipZzv7er WSu6zsXuOmJAjMEAAEKAB0WIQTd0mIoPREbIztuuKjBN2bmhouD1wUCZt79WwAKCRDBN2bmhouD 18ryD/wIt2dvPBpg6GfCuXTwI8ZHq/Xhw0UUKgiDvi6l0M1lAqmPdNe0fQPYFdpV7zloCImte9+ P1Rpg8oK5fB2xYfpH2YGpbqr1Uhp45D3NIXMWFiwAa7P73jVOxmn+pZE6+S75b0NBihnwBDjqv3 NL+/U8t1DkPGHOMx/S5pQEuto+kc7rPd1Cfw99rlH0l/lzWxFCcWQlABzlx1P4BLiiA0ao2ODqu b/ALGdnj/u5blpYURBGbHBgJ/eHqljdezVIzg9T1mrzgl5rOOrQIhrUWD4ipvwr5NEo/W0y4nsN luFsScVmEoJCcxj9Zm2tdwmc8QNWI7cZjM7r6NM6X/0vujLWQfb+C8O/RrZXkdMsRey99nU+XTZ siCy5IFha4lpKRaEUrjQ36PxSn2j6+NhxLSi98Ap2WmDA/tL4vEu+5aU8/Vik/zUhQVzQ56Y4kG JsRIM+M9H+zlrQqGWCgPeN+1Tr6T8r9aAmrQ6sqclP7XEYOZBglrDetgxW/lPldfEDwGHdDizXE cs6pOl6y6qIifPvAtZ0g2YecHTpN6UlRVS1nPSXvnVuF0kvICRhgHpvK3wfYnEHvv/fSEzP7qzF 2B8SBCizdJt1YFjLGsqVYGocM+c7PHZL+/nyoTU3nG99OO4KBmwJqaadqY8XKMT6J6IbL7aaDNx 6L2A2Di5T3Pdssg== X-Developer-Key: i=krzysztof.kozlowski@linaro.org; a=openpgp; fpr=9BD07E0E0C51F8D59677B7541B93437D3B41629B Driver does not modify static data with regulator description (struct da9121_range), so make it const for code safety. Signed-off-by: Krzysztof Kozlowski --- drivers/regulator/da9121-regulator.c | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/drivers/regulator/da9121-regulator.c b/drivers/regulator/da9121-regulator.c index 5524bd314f13..ef161eb0ca27 100644 --- a/drivers/regulator/da9121-regulator.c +++ b/drivers/regulator/da9121-regulator.c @@ -53,7 +53,7 @@ struct da9121_range { int reg_max; }; -static struct da9121_range da9121_10A_2phase_current = { +static const struct da9121_range da9121_10A_2phase_current = { .val_min = 7000000, .val_max = 20000000, .val_stp = 1000000, @@ -61,7 +61,7 @@ static struct da9121_range da9121_10A_2phase_current = { .reg_max = 14, }; -static struct da9121_range da9121_6A_2phase_current = { +static const struct da9121_range da9121_6A_2phase_current = { .val_min = 7000000, .val_max = 12000000, .val_stp = 1000000, @@ -69,7 +69,7 @@ static struct da9121_range da9121_6A_2phase_current = { .reg_max = 6, }; -static struct da9121_range da9121_5A_1phase_current = { +static const struct da9121_range da9121_5A_1phase_current = { .val_min = 3500000, .val_max = 10000000, .val_stp = 500000, @@ -77,7 +77,7 @@ static struct da9121_range da9121_5A_1phase_current = { .reg_max = 14, }; -static struct da9121_range da9121_3A_1phase_current = { +static const struct da9121_range da9121_3A_1phase_current = { .val_min = 3500000, .val_max = 6000000, .val_stp = 500000, @@ -85,7 +85,7 @@ static struct da9121_range da9121_3A_1phase_current = { .reg_max = 6, }; -static struct da9121_range da914x_40A_4phase_current = { +static const struct da9121_range da914x_40A_4phase_current = { .val_min = 26000000, .val_max = 78000000, .val_stp = 4000000, @@ -93,7 +93,7 @@ static struct da9121_range da914x_40A_4phase_current = { .reg_max = 14, }; -static struct da9121_range da914x_20A_2phase_current = { +static const struct da9121_range da914x_20A_2phase_current = { .val_min = 13000000, .val_max = 39000000, .val_stp = 2000000, @@ -104,7 +104,7 @@ static struct da9121_range da914x_20A_2phase_current = { struct da9121_variant_info { int num_bucks; int num_phases; - struct da9121_range *current_range; + const struct da9121_range *current_range; }; static const struct da9121_variant_info variant_parameters[] = { @@ -188,7 +188,7 @@ static int da9121_get_current_limit(struct regulator_dev *rdev) { struct da9121 *chip = rdev_get_drvdata(rdev); int id = rdev_get_id(rdev); - struct da9121_range *range = + const struct da9121_range *range = variant_parameters[chip->variant_id].current_range; unsigned int val = 0; int ret = 0; @@ -219,7 +219,7 @@ static int da9121_ceiling_selector(struct regulator_dev *rdev, unsigned int *selector) { struct da9121 *chip = rdev_get_drvdata(rdev); - struct da9121_range *range = + const struct da9121_range *range = variant_parameters[chip->variant_id].current_range; unsigned int level; unsigned int i = 0; @@ -259,7 +259,7 @@ static int da9121_set_current_limit(struct regulator_dev *rdev, { struct da9121 *chip = rdev_get_drvdata(rdev); int id = rdev_get_id(rdev); - struct da9121_range *range = + const struct da9121_range *range = variant_parameters[chip->variant_id].current_range; unsigned int sel = 0; int ret = 0; From patchwork Mon Sep 9 13:51:16 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Krzysztof Kozlowski X-Patchwork-Id: 13797096 Received: from mail-ej1-f51.google.com (mail-ej1-f51.google.com [209.85.218.51]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 1F9F81BAED1 for ; Mon, 9 Sep 2024 13:51:48 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.218.51 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1725889909; cv=none; b=QjdlBJcNITB9kfNVa35Hg6C2IIDHBK7lghgqaEJoB4Af+qalx4us2dQQwleJxpZ4pwaai5ATFXPJeqK3TT1jrQhJaAhcb5iGSDy2DGBODijUH39+CRNPhFAdXqH/wVHR12RFdbvbdfD9lj7XR/NW4IBBjBQxwD/HPPqRPpK8ncs= 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.51 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linaro.org 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-f51.google.com with SMTP id a640c23a62f3a-a8d302b6b30so8521166b.0 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=H6rF/ICQxN/JQ+At+0IZ4Z0N0M/UKNYUUS74zzNsI5FQhjQ6L/NwyRe3vrlKyRWCVb 3eKouuyJ1A9AnlCzu7sKnrdvsXxrI9THjV9I3lS0BULTqupJmZXGq3JZJbY9ksHBnFTP 2iWvchI1zCNWUhojn0dAa2yOLJDW3KDmh5NjIUUKjLP3i4R3Pd/fBQ4bJdcyHl+kqW9b GNdLSR7eCWoBRI4gSxEfWn0txzNaluzOJHqne74+h8GScnS2cGQeyZLLsdXceozUxRwR g3oh46RjQgm6IEe/PkkUaC3nDGxODxsY80c/rj3Zy3/yF1BqTgh9Nbev8twnsg+n1s+a 2NXA== X-Forwarded-Encrypted: i=1; AJvYcCUK9zMdcGkNmFQlW9xSdxO6MuBgHl+XixjZl8GBYsYlyeaIvKOTm+zfyr5M/DmpRTYq6BlotXg0k76SS6J3@vger.kernel.org X-Gm-Message-State: AOJu0YzEsJ9joEI8H4YHFzWjYN0Em5hexLji34gIkTiS15Pl5mDXmwwL ArHOK2FvcE5DPzEqZL5U+p/N4v2wxeOUPcmo3RSXVCbtBkX/06uRjeZ+32KVe18= 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-arm-msm@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20240909-regulator-const-v1-5-8934704a5787@linaro.org> References: <20240909-regulator-const-v1-0-8934704a5787@linaro.org> In-Reply-To: <20240909-regulator-const-v1-0-8934704a5787@linaro.org> To: Support Opensource , Liam Girdwood , Mark Brown , Matthias Brugger , AngeloGioacchino Del Regno , Bartosz Golaszewski Cc: linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org, linux-arm-msm@vger.kernel.org, Krzysztof Kozlowski X-Mailer: b4 0.14.1 X-Developer-Signature: v=1; a=openpgp-sha256; l=819; i=krzysztof.kozlowski@linaro.org; h=from:subject:message-id; bh=qvFB37UNy0FXUjxrG9GIJ3EDRLNkuyXGb5mp950Q39M=; b=owEBbQKS/ZANAwAKAcE3ZuaGi4PXAcsmYgBm3v1cXH5mO890K3vAeJUuv0AtSmRWejCS85Vei fX3f8LzbhCJAjMEAAEKAB0WIQTd0mIoPREbIztuuKjBN2bmhouD1wUCZt79XAAKCRDBN2bmhouD 11ChD/4yh9ctCFV0lMqYOZv20i4KdgYa2NLHUN4pjlhvUeE7bNRx3gvPpT3oVHy6TYPDGYd5xo3 qjMOhlaWM98n4j3kvYr2n4bj+STEKZbYNUGMiSvU/lGDNdaGlcMDA41KdZS2+dtZPIXiYXTXoy4 /XrGKA5vm9X/3c1vlsz1D4SnBOFXPARuDCy0e0zAa21CsIe3ymWRvgkWPPJSDNewvsrYGT/+n8p luKgHx2DD/MLwnhTHKNCVJ4ZoGW/Ze2TO4/2MVkHu8KoXY0Oza+VL2cjhcDxfrQJiuegsVR7pjE pYOLDyEJ/13cTDHX4CEjygyGVrVPolQOJuG0LDOd75YSZMTpsNLxb7A5o+/pkKzT6+23qHWSOsF F9ELpIwY6vQyXC8KxYXtgaePWfY9pJIWkXfYEX7+OM9U2yu0Tf/DYoYCpd8RLqyI0YChNH73f/Y 7GM5HG1jaUjTcqDnKB1AK14fBS9qyMZOSiAtykpZEWGBAuV5jhBKo7APsx0Qf3XkXQWgRx07qyy +xlJz1udRGESQ79PA8s7uWN6tyGr+pVk/qfIhnSQYt4c3K4hcFFBXoiHwbNVRvaVU65qpe8uL64 nwtioO7ua6RiqxYui6Yc/8tCc9hGvBoC+DgR8RYhkAsvp5qYbsP0GYjBvYtKMeNqtXkGMc3hUe1 MI4gi9DFb78nIkw== X-Developer-Key: i=krzysztof.kozlowski@linaro.org; a=openpgp; fpr=9BD07E0E0C51F8D59677B7541B93437D3B41629B Driver does not modify static data with regulator description (struct regulator_desc), so make it const for code safety. Signed-off-by: Krzysztof Kozlowski --- drivers/regulator/da9211-regulator.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/regulator/da9211-regulator.c b/drivers/regulator/da9211-regulator.c index d8b39ea3de0e..d4f14d7ea8cf 100644 --- a/drivers/regulator/da9211-regulator.c +++ b/drivers/regulator/da9211-regulator.c @@ -264,7 +264,7 @@ static const struct regulator_ops da9211_buck_ops = { .of_map_mode = da9211_map_buck_mode,\ } -static struct regulator_desc da9211_regulators[] = { +static const struct regulator_desc da9211_regulators[] = { DA9211_BUCK(BUCKA), DA9211_BUCK(BUCKB), }; From patchwork Mon Sep 9 13:51:17 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Krzysztof Kozlowski X-Patchwork-Id: 13797097 Received: from mail-wr1-f41.google.com (mail-wr1-f41.google.com [209.85.221.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 A72C91BAEDB for ; Mon, 9 Sep 2024 13:51:48 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.221.41 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1725889910; cv=none; b=HI3pg7SObRG/mosKkWaJpTDaHMZKvtvk8wR0sXZc71iIMhYxaszeZO6LpbrW2+aJiMBuMggKIQnpJrKSXTG/4hwbuMFY0Ewz7ePPeypbsgbiSk/MkI/XrMu5GYgdnij83kUtq6/4zttRpMsfgCSxcPKDJ9Tk/qM9U4vYQ0ql8vo= 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.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="hFWi8444" Received: by mail-wr1-f41.google.com with SMTP id ffacd0b85a97d-374c2df8a07so103042f8f.0 for ; Mon, 09 Sep 2024 06:51:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1725889907; x=1726494707; darn=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=d5VEGmNTCASiqHDzxlnf06o6DpxVuU2BujcwpkMuvLmGeQIxX9yZ/+R7ERDdTW95Nx uL1ZFNIUIgI1zzEXa7Xpbf8P470m6rMWWZ0VCsXvD9+J+rjVGfx1GkV9CMBgGXK0dSc2 y/qA+Wv5EgfEEtD0JAFlyE5e+awRr8jSiz2Z8NQSCnpgbQh2H+heAIFd4hE8/RyqnUEy 7oVV7voYoIhy5SQxh0oXKT3qaroEN1Ef4pGn3u8efb/geITBsiS0qFVPKa+fRRYDvjYO 1qPARO+GmuM3puejTPA+LFByMichnCx/R4rWkLuw9eNonaLwodwYRzMfk+P6Yb5ovqRt RSlg== X-Forwarded-Encrypted: i=1; AJvYcCUD00Lvs24fxn74cPp+6F3KQccghWTtSJxLyGksZFBslWuaqXYD/f2vzOvMiA/fbOa8XCIKXinYIIA1s5s0@vger.kernel.org X-Gm-Message-State: AOJu0Yx2/ABJoC7EQ6iKDJsx01fS4CYCBOvScTwf/sNG89mFLX8zgjju 2m3LcdFg1C4S5onkAjM2P2CMeCk7f5ZK13aECFIR8wF9c4+m6Fh7qKv0smjgDWk= 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-arm-msm@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20240909-regulator-const-v1-6-8934704a5787@linaro.org> References: <20240909-regulator-const-v1-0-8934704a5787@linaro.org> In-Reply-To: <20240909-regulator-const-v1-0-8934704a5787@linaro.org> To: Support Opensource , Liam Girdwood , Mark Brown , Matthias Brugger , AngeloGioacchino Del Regno , Bartosz Golaszewski Cc: linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org, linux-arm-msm@vger.kernel.org, Krzysztof Kozlowski X-Mailer: b4 0.14.1 X-Developer-Signature: v=1; a=openpgp-sha256; l=3081; i=krzysztof.kozlowski@linaro.org; h=from:subject:message-id; bh=j2zwQ1BCa3xviw33TQ1yU9leknMd45i2193Hd7keRfQ=; b=owEBbQKS/ZANAwAKAcE3ZuaGi4PXAcsmYgBm3v1dar5m8pWkgX0YQ41g0FmZeSQHS5Ldzu5oS VY/Jxr8BWyJAjMEAAEKAB0WIQTd0mIoPREbIztuuKjBN2bmhouD1wUCZt79XQAKCRDBN2bmhouD 196TD/9RCl439qn314C+1T07HG8J93zopFOVXqjRy5Chbs5rO9u7m7CWkTeYHrZRX11Lsv/pD8I 92sYpTkK7vooauJ0uvcp3EMdJb5DiMrjs6ZmG+mXxH6XVliP1laV5MM0KiyDQeQoxAPO9tqmen3 yL4kC7BbpHsME4uSggz2G7SUJ/oHzaJ70GDRgB/BYnqnNvqJbP0KMsLHyhg3AxgRRw2mNawPdHe kwMomDZN92uAzVczA1Ynpj7p74RF9KBVIZvAlIl1efcitCaJUMOj3gEYTwRfA0jWDBKMAiCYdyE 1JNU01he7Duw2eMYTuSdroWOk81VkunYCpFrGvuSxFvttiFIAuwhPZhVks4dAfOtRlLbqdZ1qsE emRlIThRFUeb+glNUU7QLIG6JXpXtd6lGIEGK1SktsF7A3zQgo1M6ukdkioa5k7PxK8kZk+FszD /PSqRFLSiLqTZVz66TJNUcNs+hSOo3gzi6GBco5mW02vsquNRXrREUBVUseeCvWtI8v9lPwwIIN zbD3lqgTWX025GXQhLUk9I56pMObo+qAux80yYS2enK5o5hc9EJjf7SC8kMWhO6BmmMDYyoViuw wMWN4XPk2B1WZtQb3TGYlMlGotK1q6KnFPgSzICh+WNwhXYyOorLxMRRaJl/YA2eTuoxfKpiIt9 xHhe5ucd9x/ZU6Q== X-Developer-Key: i=krzysztof.kozlowski@linaro.org; a=openpgp; fpr=9BD07E0E0C51F8D59677B7541B93437D3B41629B Driver does not modify static data with regulator description (struct hi6421_regulator_info), so make it const for code safety. Signed-off-by: Krzysztof Kozlowski --- drivers/regulator/hi6421-regulator.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/drivers/regulator/hi6421-regulator.c b/drivers/regulator/hi6421-regulator.c index 82e9e364d4d4..69d24728d6a4 100644 --- a/drivers/regulator/hi6421-regulator.c +++ b/drivers/regulator/hi6421-regulator.c @@ -303,7 +303,7 @@ static const struct regulator_ops hi6421_buck345_ops; } /* HI6421 regulator information */ -static struct hi6421_regulator_info +static const struct hi6421_regulator_info hi6421_regulator_info[HI6421_NUM_REGULATORS] = { HI6421_LDO(LDO0, hi6421_vout0, ldo_0_voltages, 0x20, 0x07, 0x20, 0x10, 10000, 0x20, 8000), @@ -384,7 +384,7 @@ static int hi6421_regulator_enable(struct regulator_dev *rdev) static unsigned int hi6421_regulator_ldo_get_mode(struct regulator_dev *rdev) { - struct hi6421_regulator_info *info; + const struct hi6421_regulator_info *info; unsigned int reg_val; info = container_of(rdev->desc, struct hi6421_regulator_info, desc); @@ -397,7 +397,7 @@ static unsigned int hi6421_regulator_ldo_get_mode(struct regulator_dev *rdev) static unsigned int hi6421_regulator_buck_get_mode(struct regulator_dev *rdev) { - struct hi6421_regulator_info *info; + const struct hi6421_regulator_info *info; unsigned int reg_val; info = container_of(rdev->desc, struct hi6421_regulator_info, desc); @@ -411,7 +411,7 @@ static unsigned int hi6421_regulator_buck_get_mode(struct regulator_dev *rdev) static int hi6421_regulator_ldo_set_mode(struct regulator_dev *rdev, unsigned int mode) { - struct hi6421_regulator_info *info; + const struct hi6421_regulator_info *info; unsigned int new_mode; info = container_of(rdev->desc, struct hi6421_regulator_info, desc); @@ -436,7 +436,7 @@ static int hi6421_regulator_ldo_set_mode(struct regulator_dev *rdev, static int hi6421_regulator_buck_set_mode(struct regulator_dev *rdev, unsigned int mode) { - struct hi6421_regulator_info *info; + const struct hi6421_regulator_info *info; unsigned int new_mode; info = container_of(rdev->desc, struct hi6421_regulator_info, desc); @@ -462,7 +462,7 @@ static unsigned int hi6421_regulator_ldo_get_optimum_mode(struct regulator_dev *rdev, int input_uV, int output_uV, int load_uA) { - struct hi6421_regulator_info *info; + const struct hi6421_regulator_info *info; info = container_of(rdev->desc, struct hi6421_regulator_info, desc); @@ -539,7 +539,7 @@ static int hi6421_regulator_probe(struct platform_device *pdev) { struct hi6421_pmic *pmic = dev_get_drvdata(pdev->dev.parent); struct hi6421_regulator_pdata *pdata; - struct hi6421_regulator_info *info; + const struct hi6421_regulator_info *info; struct regulator_config config = { }; struct regulator_dev *rdev; int i; From patchwork Mon Sep 9 13:51:18 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Krzysztof Kozlowski X-Patchwork-Id: 13797098 Received: from mail-ed1-f52.google.com (mail-ed1-f52.google.com [209.85.208.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 1C8B01BB684 for ; Mon, 9 Sep 2024 13:51:49 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.208.52 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1725889912; cv=none; b=Ww9bYr31aDTdDJ9DDbR4/cWUoSIeZAcFtdJa1Mqc5TGMyA7NdEfBGctY6ZwJiXscIJJbCWAWaR+Iqs0su+rOZi6Ud4btauSc6GuvoghP5qPgMVPlpzHE+EdpuqvV0dSY37pVAiG3hBUqA5QJcemkgNHAueJziteUZiWMrloI/Ds= 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.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="R1X4o1Cn" Received: by mail-ed1-f52.google.com with SMTP id 4fb4d7f45d1cf-5c26e5d05d3so569259a12.0 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=Cp74lYZGdFa2kftwbC1hcagsI7nFiTou29fVgoIdvLtcHxyo9Hzf41lr9xD5Z3r5ny LEY3i9LQ2BMXbf2aYACqd79uZkNF5d14i2W4vKXX2lrVV703L2vG30r+X1K44817a7MW fZZcEiQheqZidi9zUiptq743AClXWFzkXIzV2K8SYbMMre7krE6xSWxxTzbxispADdIU PPNMl8alwnqjT9fYRnnsMSGkdUyVwWfKLQ2PpFaIAfa0efqTrlnonpzk6e+AmWXIvdOS P4FgfcoHCEbKfcuPRIRc/AYmwKivRRjfarS251z1Y1sjXk8vO7g8q6JG5lha7vBfuKtX KCqQ== X-Forwarded-Encrypted: i=1; AJvYcCWqmronfVsz5Qaz8xMiMnYVrGY7B/PsZm9r2F5dQqmUwE4Pc5lvAMEL3ibgBhEYtjyOhLJ72aPuL66AoOLY@vger.kernel.org X-Gm-Message-State: AOJu0Yy5CtQXn9AwXhvLCBLQKgEJdCcggUQ/PMI4RufMvbgBBuUaq1QQ G77PG84DbDRwAmGLt0ZMyo4t19i3wTuIut+GVodP0oALYY/QwIe/GnVDE4zjOrs= 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-arm-msm@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20240909-regulator-const-v1-7-8934704a5787@linaro.org> References: <20240909-regulator-const-v1-0-8934704a5787@linaro.org> In-Reply-To: <20240909-regulator-const-v1-0-8934704a5787@linaro.org> To: Support Opensource , Liam Girdwood , Mark Brown , Matthias Brugger , AngeloGioacchino Del Regno , Bartosz Golaszewski Cc: linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org, linux-arm-msm@vger.kernel.org, Krzysztof Kozlowski X-Mailer: b4 0.14.1 X-Developer-Signature: v=1; a=openpgp-sha256; l=2313; i=krzysztof.kozlowski@linaro.org; h=from:subject:message-id; bh=aQxdvJysaJsMuCiXGmuPsUG5zXaAXydDbTeDR80ECyI=; b=owEBbQKS/ZANAwAKAcE3ZuaGi4PXAcsmYgBm3v1eEV9BEYMcFSBw7lfXCzYrANegqqdP0KgLr wLORiBbAs+JAjMEAAEKAB0WIQTd0mIoPREbIztuuKjBN2bmhouD1wUCZt79XgAKCRDBN2bmhouD 1/NGEACM/+upk2qItNXTCceOePEuc0yrqvApHPovnARhqgTaI4wjCEJjM3WbPMEs2it8jbbZY3R GWgKaMlU0NZCMQLdzbK6xCPCY0HAUlP5hXV7Z67Ga6wVt96WZRE3i3UvH5aLubbrFfPdsAdZWxc 9A4DfZDmLK+ex/r4s9ef8DAk2U49qbgi17CR/BLEP0SVqJqNLTiyiLRGcPq24oKifYOQFnpxhAS KtLzPTPMLJFV5UQhgfwbPRBI28xbaJAlPyzqxW98B5cTUSz6Aln73tTlcSF620UGIUyFoKwRury BOep0BgcFjCQdaJJwn+Dq8kp4Eazcf9knQFU9TPu2T7Kwz9aRVGTXA2myWRdgBlJzhjcQWK+mOp j+9qAJ5Kbl+Y1Oy8grzj5aSPTbuo5b1Z79AqfRmD3QFOucMRzqU/OcOtIfVHUUQghwLE+j/asq9 Few4VKtyywvJ0AcvBTNWRK3PrJvu4yNZqkIzoqNSeMV6WYl5ZPKLEu9A+O+R1cILiAE10eaE/Jc inkY3yW1Ccyj1xQxAf+DLVEKSbkpTOSmdlaos8Eh6zLj+JZjsB8Z7LNUgzCvaDqtwC8hRw3H7z5 QLC2PSX21usUhZ+r+2B9ey/R10vItMc/Uwhxzhhkrb0vhzGWcObfrkEyjxtbYij4VEE+YX6NFud nxDwTMTP+ayKivA== X-Developer-Key: i=krzysztof.kozlowski@linaro.org; a=openpgp; fpr=9BD07E0E0C51F8D59677B7541B93437D3B41629B Driver does not modify static data with regulator description (struct hi6421_spmi_reg_info), so make it const for code safety. Signed-off-by: Krzysztof Kozlowski --- drivers/regulator/hi6421v600-regulator.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/drivers/regulator/hi6421v600-regulator.c b/drivers/regulator/hi6421v600-regulator.c index 4e10daa1e689..e5f6fbfc9016 100644 --- a/drivers/regulator/hi6421v600-regulator.c +++ b/drivers/regulator/hi6421v600-regulator.c @@ -118,7 +118,7 @@ static int hi6421_spmi_regulator_enable(struct regulator_dev *rdev) static unsigned int hi6421_spmi_regulator_get_mode(struct regulator_dev *rdev) { - struct hi6421_spmi_reg_info *sreg; + const struct hi6421_spmi_reg_info *sreg; unsigned int reg_val; sreg = container_of(rdev->desc, struct hi6421_spmi_reg_info, desc); @@ -133,7 +133,7 @@ static unsigned int hi6421_spmi_regulator_get_mode(struct regulator_dev *rdev) static int hi6421_spmi_regulator_set_mode(struct regulator_dev *rdev, unsigned int mode) { - struct hi6421_spmi_reg_info *sreg; + const struct hi6421_spmi_reg_info *sreg; unsigned int val; sreg = container_of(rdev->desc, struct hi6421_spmi_reg_info, desc); @@ -160,7 +160,7 @@ hi6421_spmi_regulator_get_optimum_mode(struct regulator_dev *rdev, int input_uV, int output_uV, int load_uA) { - struct hi6421_spmi_reg_info *sreg; + const struct hi6421_spmi_reg_info *sreg; sreg = container_of(rdev->desc, struct hi6421_spmi_reg_info, desc); @@ -195,7 +195,7 @@ enum hi6421_spmi_regulator_id { hi6421v600_ldo34, }; -static struct hi6421_spmi_reg_info regulator_info[] = { +static const struct hi6421_spmi_reg_info regulator_info[] = { HI6421V600_LDO(ldo3, range_1v5_to_2v0, 0x16, 0x01, 0x51, 20000, 120, @@ -235,7 +235,7 @@ static int hi6421_spmi_regulator_probe(struct platform_device *pdev) struct device *pmic_dev = pdev->dev.parent; struct regulator_config config = { }; struct hi6421_spmi_reg_priv *priv; - struct hi6421_spmi_reg_info *info; + const struct hi6421_spmi_reg_info *info; struct device *dev = &pdev->dev; struct regmap *regmap; struct regulator_dev *rdev; From patchwork Mon Sep 9 13:51:19 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Krzysztof Kozlowski X-Patchwork-Id: 13797106 Received: from mail-wr1-f44.google.com (mail-wr1-f44.google.com [209.85.221.44]) (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 546B81BDA8C for ; Mon, 9 Sep 2024 13:52:02 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.221.44 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1725889924; cv=none; b=P0pycOV8fD/6ym80efrvCKFPym+U5+oO5NfyRt+OUrJSlnXeXlbeCc+zCWayU0bggGl3PhUcIpIwerC1KTiDR1dE1cYOOxeUwd1ijOQ++K437ZxRC1315oOSCqSBSlIiaDbJwO0J8c3sfmHH1ioaebwzAS1tcq5QAWl8gUaYCaw= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1725889924; c=relaxed/simple; bh=jNymqsckfanJHx8PSWuZFbKm3ihIGGZwBaMEOB5ZiE4=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=SJcShAIOWZh8ivrsu1tdVo9J+xV0J9qf5wGgpK218AdrIehfsZSiXSv+z4lGVunUWAehEn//QGVi4+D4/JeQ/A2SlYXUjdmtdncpJH+3sy/j7ZYu8048UrQMWAdH1nw57/X2qfnrPNVFpV+mxtOuGCGu3g7py/LkBWzSNYkF5T8= 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.221.44 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-wr1-f44.google.com with SMTP id ffacd0b85a97d-378a4091175so30324f8f.0 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=F/vvxurOBz8hJM/J/KS0RhuTPopm02W1mHrXGIwqWMsj89XFLUAzn1+VHKq2wJjEPH LZKDW7jLtcyo8TXpeSfnpN8EtRl0Pg1QeAroBlOTYsD2fZYjf7D88/I0NDnspoEBR/ii dC7p8nhAPJCFG/HxfW8MawjqD0NfPA+wQpq5llhvnKw9S+pYzf0zduiGzS4pFaG08zdm 54kVPm3dgaESQQvD+FGRwWxUMONK3KSltV/FzkdvlkMNsvZq5xGiP1SLa08BWWeQwkeW K3DoDSmGUidMBngkTaXRUyYsXIHvJhrlHlAzP082Jz+i4fsFM2+Z6TLhOuj6gGnTDAS6 DRzg== X-Forwarded-Encrypted: i=1; AJvYcCUctjA9mkrVK0rc7xtK1cgJrvBD7CCYT/wPs2OUity0TAhLs98yOb8d6Ei1mYf6z/OAy+bRmJu77LOOYb0N@vger.kernel.org X-Gm-Message-State: AOJu0YxaTgTrwswKie5X2cF1ovEECiELQziQyVXFXya5gaN9DPL/frmx S8lmQNX69DuBdv8k3qABDvvyjkKBvZSM3ZXGmJSvZtPFV0fupIzvyvFraQbCU1+byGJYvIorBvi C 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-arm-msm@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20240909-regulator-const-v1-8-8934704a5787@linaro.org> References: <20240909-regulator-const-v1-0-8934704a5787@linaro.org> In-Reply-To: <20240909-regulator-const-v1-0-8934704a5787@linaro.org> To: Support Opensource , Liam Girdwood , Mark Brown , Matthias Brugger , AngeloGioacchino Del Regno , Bartosz Golaszewski Cc: linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org, linux-arm-msm@vger.kernel.org, Krzysztof Kozlowski X-Mailer: b4 0.14.1 X-Developer-Signature: v=1; a=openpgp-sha256; l=1273; i=krzysztof.kozlowski@linaro.org; h=from:subject:message-id; bh=jNymqsckfanJHx8PSWuZFbKm3ihIGGZwBaMEOB5ZiE4=; b=owEBbQKS/ZANAwAKAcE3ZuaGi4PXAcsmYgBm3v1frgG8hVoi2NhgvfRQHtO4lcCjJkU+gw/QJ a+Co9CrL8+JAjMEAAEKAB0WIQTd0mIoPREbIztuuKjBN2bmhouD1wUCZt79XwAKCRDBN2bmhouD 16V+D/wIO0j0Z5ZUo4S3NVrBCrwGJwjcNjLMFw1+a6IDku9xFAt7zKjtyZ8CjKRUx5N47SBwAUd XRFalrY9n51RWZN+zZdJZGWegfZwJH8ii+Vo1LcgMN7EXNFQ+GAx8rj8BL9UhPMkbPjXKfTBDos zt/o/ZfRrRb/1WfdTmgMqM1Hxy+yrzi2QeBtr/zUp7nQVs2qWNdJZJscoexW3/Wgy0jCw3XaRGw D0qK1K/ByJAmToUC/X9VNvBvNwnPjjSKvJE+YwhGH3jRqhKdB0h9WnigXlMpZSDZtvam+ADLQnZ uyTLjQEt8qy/6r6X+oFC7qFKD4Q2r93Od6yBXge7eqYgLNr+A/0gj6v8FZnt8/mPEiEeOuGqI72 VGuMSMFXxUPQyWxHvzNm9VCdrJOF5Oh2LdfMOV5+o9B4kynH0b3LCLw3wwt7dpHAaJO/94xJcTs 5Z1L+GsPo0NqHx6zQ2WxviPQFrrTdXT1OyY+uXDQsQlG0SrV5w0/PFa+tpfXWt0mQ6xNFnq/8WH h+5uoRK5ESWAfHL6ZH/vBlKthPGBLgWTLh/eQ5jY2zgS+sKy/FF/0Ow7eNGn8UISr/+MB6BaFu7 9MmfvCT98N2LNuX/IvslzkUrBlcfQ/ezRhYqU+boAGpkg/I57y1+yfKlgTexnJOsWkyq4R9PTxg 28X/ar9rqEWZJTg== X-Developer-Key: i=krzysztof.kozlowski@linaro.org; a=openpgp; fpr=9BD07E0E0C51F8D59677B7541B93437D3B41629B Driver does not modify static data with regulator description (struct tps_driver_data), so make it const for code safety. Signed-off-by: Krzysztof Kozlowski --- drivers/regulator/tps65023-regulator.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/regulator/tps65023-regulator.c b/drivers/regulator/tps65023-regulator.c index d5757fd9a65b..3334b5b7d907 100644 --- a/drivers/regulator/tps65023-regulator.c +++ b/drivers/regulator/tps65023-regulator.c @@ -242,17 +242,17 @@ static const struct regulator_desc tps65023_regulators[] = { TPS65023_REGULATOR_LDO(2, TPS65023_LDO2_VSEL_table, 0x70), }; -static struct tps_driver_data tps65020_drv_data = { +static const struct tps_driver_data tps65020_drv_data = { .desc = tps65020_regulators, .core_regulator = TPS65023_DCDC_3, }; -static struct tps_driver_data tps65021_drv_data = { +static const struct tps_driver_data tps65021_drv_data = { .desc = tps65021_regulators, .core_regulator = TPS65023_DCDC_3, }; -static struct tps_driver_data tps65023_drv_data = { +static const struct tps_driver_data tps65023_drv_data = { .desc = tps65023_regulators, .core_regulator = TPS65023_DCDC_1, }; From patchwork Mon Sep 9 13:51:20 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Krzysztof Kozlowski X-Patchwork-Id: 13797099 Received: from mail-ej1-f50.google.com (mail-ej1-f50.google.com [209.85.218.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 F16191BB6A5 for ; Mon, 9 Sep 2024 13:51:52 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.218.50 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1725889914; cv=none; b=KOXbDpntTQC2KkHjORDtEXniP+Q+Vg6w056ZKN9D9NKCN9z+5xs0rw4hKM85rXUqPebOQil9grcrZ4+A4LHv/1UAnTqez3N7WSdLhxU3Z4QHnw1LmL+5Nj+HN3RB+virYIgEbE9FB9pzNQaXpVQy61vKDf8fEsxvDiA9zgi/suc= 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.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="ERrNHWWu" Received: by mail-ej1-f50.google.com with SMTP id a640c23a62f3a-a8d1a00e0d0so8614666b.3 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=cijlbTodjNF3b3SF/pbplBmCp2aJztVB0ipP9poGs2jUK24tp3OPnBOV09+sTR6snT wKhrUocXWfCmxP0mKv5GSuIATNYjwCFNaPTZUvJSyA2UJrlaWHJVJ9rhED62u1ebqr/R gAJniW73CefVZQOcUO3gGGgKolp5ITe1B+7LeofxLmWOfWwRAc3zXWC9ytfuEWwZrwiH 5d6kjlyXZnhMWFiNm/se97RYAneMbAroQxkrXH9GDvFabPv6xTv6SjsRIOgDEJUDHFiS p8zyWGXfPV5Hk+3Z8I0cRBALe66uzoeDsmfUgRVYB1EP49L4vNVyKpfb3LaD2u8kaabq kE1g== X-Forwarded-Encrypted: i=1; AJvYcCX1ueV34Q+EfWaDNTS5ZwK8WFxBQjH0BKayPjptDoFh8nMQMVE92YJhC0r54vtTRt66oqr6PP+iKK+NFDTF@vger.kernel.org X-Gm-Message-State: AOJu0Yxf9fiOyuM61fHdSVXXYvvoPqMR64IQqFq0S0xOZe7a7T8P3ebP KaZxaKvIoPM4BdeshzpLVcKW3TFnvRRLgb/ndGBgGD/WBUNsKA6ljYj10TVY1+A= 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-arm-msm@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20240909-regulator-const-v1-9-8934704a5787@linaro.org> References: <20240909-regulator-const-v1-0-8934704a5787@linaro.org> In-Reply-To: <20240909-regulator-const-v1-0-8934704a5787@linaro.org> To: Support Opensource , Liam Girdwood , Mark Brown , Matthias Brugger , AngeloGioacchino Del Regno , Bartosz Golaszewski Cc: linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org, linux-arm-msm@vger.kernel.org, Krzysztof Kozlowski X-Mailer: b4 0.14.1 X-Developer-Signature: v=1; a=openpgp-sha256; l=991; i=krzysztof.kozlowski@linaro.org; h=from:subject:message-id; bh=rxHbd8ZN2Gnll5CmN6olaVIKBgECJTgaQrtvW4I7hxI=; b=owEBbQKS/ZANAwAKAcE3ZuaGi4PXAcsmYgBm3v1gk6LT/h4VMebCtZMbJoCRkBZvx8KAMANRf n9s9srNC/uJAjMEAAEKAB0WIQTd0mIoPREbIztuuKjBN2bmhouD1wUCZt79YAAKCRDBN2bmhouD 161kD/9Lp6g4Ua2xpAlNHKFc2J5G5EkSOmL9wRmeRWCqsIzq5Ao0p02ZQ/8kTCNSxibJ8bPQuIK m64QJ0LFlP7nWIYw91ctKvfqnOy9UrHRju3r8U7TXRUYNFab/vQ3BrceR6gpzcLhFXvfTX5En9+ JRGMtRd5J5AiGl5VBp5TIig09DqDdVkFCEpKDBn9zj49laVzNo+V3xue8dnGynTAxW9z2buAKmw gMI3QvQEEk3fqKFNxGFJExDUoC6NHK5qBENhj4+JjHPbYN+gS0KSxwYT3EfTxhE6ufKfpoQzaOX 2bvZ9kMCCaaayjeO4s/J0YlxHCdjAnFy0iTRQ3Q+lWkWbCoYT8KKOU54FAEfvqVZl1M1lCQ6OeG lg/enr2QZKSc3XG6+Qld8the0DM7gOehFJyT02OTsv7Q4Mk93qun+f38yHQOuxZxJCcBmIZCRDr 1udf/OsmXR9Gl0qG/QEslImmSd2+1Kw1McycPnPgPWMGc9hhQtxycEKTzCqDDS/+Pq8rgBZ23em Ck/jxoX3WTakTQHwWJBUqXjZzFeBhpEWY+yGphtd7kJMlyHZoHCbUfloX27j8SAas98RNlyQxpM Tt5GlM0LkHrEzEyWqRpdSva0G/5/lYGNTKtPDYZWm+xvCXgM4jEa5Zx8VCwN0F7GpxQwPiL9omy hTqm9UKegqYPonQ== X-Developer-Key: i=krzysztof.kozlowski@linaro.org; a=openpgp; fpr=9BD07E0E0C51F8D59677B7541B93437D3B41629B The max77826_regulator_info.rdesc is assigned once and never used again. Signed-off-by: Krzysztof Kozlowski --- drivers/regulator/max77826-regulator.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/drivers/regulator/max77826-regulator.c b/drivers/regulator/max77826-regulator.c index 5590cdf615b7..4b656a694108 100644 --- a/drivers/regulator/max77826-regulator.c +++ b/drivers/regulator/max77826-regulator.c @@ -153,7 +153,6 @@ enum max77826_regulators { struct max77826_regulator_info { struct regmap *regmap; - struct regulator_desc *rdesc; }; static const struct regmap_config max77826_regmap_config = { @@ -246,7 +245,6 @@ static int max77826_i2c_probe(struct i2c_client *client) if (!info) return -ENOMEM; - info->rdesc = max77826_regulators_desc; regmap = devm_regmap_init_i2c(client, &max77826_regmap_config); if (IS_ERR(regmap)) { dev_err(dev, "Failed to allocate regmap!\n"); From patchwork Mon Sep 9 13:51:21 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Krzysztof Kozlowski X-Patchwork-Id: 13797100 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 5D5891BC081 for ; Mon, 9 Sep 2024 13:51:54 +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=1725889916; cv=none; b=udmtOs/KDTSqbLYwxhkFwvoHPXoe1e9YCJG+5R6cXhs87R5SQOZ4KT0FVASh+9iMin/U6bV/+nXtP9x2SgMDimr3ry/6xQnneYjEL4T+RGg9RLEYuEJlmLHPYV2poOyYSIib9xM8757K97rsXyjomG+lprTKinBhA6GML6USqJY= 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.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="lqZRw2KQ" Received: by mail-ej1-f47.google.com with SMTP id a640c23a62f3a-a8a7dddd2c3so30092866b.3 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=OqWpc6CHIozaOwcR+xO7MqTM7hFrlplAGx1aOXk1lSmN/jgAefnIXnOE7dEp2Pa3EX P8ZnVNJVmIfMDYH/MomwDBOzOvRqcAzzsxO4+aB+Ls2p+WsG5YSdlO5BHV6R4vL+Rgyf YmiLwRnhiPAf85vLRxXHdspwfWImTt0kpQ/rCEo1I9pJZ/U6bHnt7G/uyk6YLA8lgpN6 spAqn8th/Dy1KvtrNATUUZOColJIW1W1kvELJPX42zFU27jLDAvcdMCaH94Zgr2VO87q ZwJjONgvhFiS9iRd1aKraCFUhFlQtoDyg6gsm73+wYMvN8Q8rDi+dXLAJW+Qbi+3wY3y o4Dg== X-Forwarded-Encrypted: i=1; AJvYcCX40FC3DGYvWMeeaD7h8tCa1/sKYWz5ZjQN+6pxjZo5yO562Pb15/X2Z04o3XArRJb1YGirAoeowigFBx3R@vger.kernel.org X-Gm-Message-State: AOJu0Yw1DmCtDuDR7jKCRqCk8MT3bYHSJoc7erkU0NZhpFPthLp1eYQl 61FNA9ITHhXiWAcx0F0w0Ega+AI0BqIiB3dIWqEBoOsYaoRlY+U0kQX0ZaN+ukQ= 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-arm-msm@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20240909-regulator-const-v1-10-8934704a5787@linaro.org> References: <20240909-regulator-const-v1-0-8934704a5787@linaro.org> In-Reply-To: <20240909-regulator-const-v1-0-8934704a5787@linaro.org> To: Support Opensource , Liam Girdwood , Mark Brown , Matthias Brugger , AngeloGioacchino Del Regno , Bartosz Golaszewski Cc: linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org, linux-arm-msm@vger.kernel.org, Krzysztof Kozlowski X-Mailer: b4 0.14.1 X-Developer-Signature: v=1; a=openpgp-sha256; l=890; i=krzysztof.kozlowski@linaro.org; h=from:subject:message-id; bh=795en8GaERiwJn6rOfhvPyay4QNcnSep7UjxTkcJ3Mc=; b=owEBbQKS/ZANAwAKAcE3ZuaGi4PXAcsmYgBm3v1hg8AgiknaqdgK+QeL6eWRxLilY4eGOB9I7 VzqfGreegyJAjMEAAEKAB0WIQTd0mIoPREbIztuuKjBN2bmhouD1wUCZt79YQAKCRDBN2bmhouD 14XnD/4oSkc1OBYURG8FgVQJOiazLpoxduGRxjx7OGJtTLWiqLTszBmdOLY4L9bw/jZtrnwGiem UMtSHu2H3c4kCyG4oYsD+TWiP2xIa+fey3CAghooYlxJ1kgI/mAEL0UlGpA7byTHEjNPhrIyC/T lA1XLi2juHLKbC5/oP0WoLbgC70kGC9fqGOjfh3vrrMKhdIKlX5FHAYtDJ1/8RtTx7j023w5lSV RAlGBJgndI/7dx61sFHF0DL+TJEala5Jpyger5lPv7njuQc3gPajk248CejWqWC8pH/eiEqgtyO URIftNm8SfINoOR0YD3oDdfRmj2/l5vsymPjloXDOFvj2LF/1yPZ6JK3evtL49z6O2z6s8eeJXS Zi2tdu0vA32j4A6pDEXTm0i5bD5qIVQldM86sMTaqgCB9RHU+qfQ1AytvB3TQzdMhHxI4tJ8OMw bFRL7zbMZNGwyYXJaxjQA3wiOU7pBOR61M3QOwjOJG1Uv2c87S0uepNcJ+okq+CfyXUsSNSNbYQ aKgvis/E5bOVarcjmnES6UZqvirYOIHfNUo+HN130bcwEGOY80BZ1rUiYLk4wZSv7JTDDTijoqH EU4nwqNhX3QBsv0K0G669sjpLHX0fovxwLYrxg1hgUPGH3TMmU9KNmlTYoK8TXGlk6vMPJ2pz3C pGegNyy+hIMcnyw== X-Developer-Key: i=krzysztof.kozlowski@linaro.org; a=openpgp; fpr=9BD07E0E0C51F8D59677B7541B93437D3B41629B Driver does not modify static data with regulator description (struct regulator_desc), so make it const for code safety. Signed-off-by: Krzysztof Kozlowski --- drivers/regulator/max77826-regulator.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/regulator/max77826-regulator.c b/drivers/regulator/max77826-regulator.c index 4b656a694108..310bc8ee7af8 100644 --- a/drivers/regulator/max77826-regulator.c +++ b/drivers/regulator/max77826-regulator.c @@ -186,7 +186,7 @@ static const struct regulator_ops max77826_buck_ops = { .set_voltage_time_sel = max77826_set_voltage_time_sel, }; -static struct regulator_desc max77826_regulators_desc[] = { +static const struct regulator_desc max77826_regulators_desc[] = { MAX77826_LDO(1, NMOS), MAX77826_LDO(2, NMOS), MAX77826_LDO(3, NMOS), From patchwork Mon Sep 9 13:51:22 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Krzysztof Kozlowski X-Patchwork-Id: 13797101 Received: from mail-wm1-f41.google.com (mail-wm1-f41.google.com [209.85.128.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 B31031BC9E2 for ; Mon, 9 Sep 2024 13:51:55 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.41 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1725889917; cv=none; b=d62BJ4mkk85XUiLadAEvheRlC1UCGltESRHfZei6AekyDOPXJ2BJ1vPtPz/X/IERuO52DENHPfvBWvwHC6sUhRRN5WFy362v3SB+zVzMkxg5cCbc/pwJPqV+Rm7AUsDmFpyBxrBkWdgnnB/W37uL2Tcq9oZ5TsletuCTDsE/sUQ= 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.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="HnsuNF9u" Received: by mail-wm1-f41.google.com with SMTP id 5b1f17b1804b1-42cb1866c00so2645695e9.0 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=YJ6h0Way49emY3KK9hUyC17XYODtEbY3Ip3ayyE2T7EnAJe74QlhebbxKs9QodV6lj 1NfOLivWR0krjgTjaldyLm1LCG5f6I1tA3fa9eugtwvtWwpLvZVnja4DuH1m7P9syQE0 i/+2dTc/iIBQV96hUk1Bpq1e1X785S20vMAokM3M6gRBVpVwMVs91k1b8cO+JqfDMZFo 7v2dH4AwYkwJ3e0GuWT7C7rXBEcCnYkkDK52rDg7WQiB+L4zgQaNqIODLnccyBymZD2C 9LpOJyjvU6cBqdaUTww/SXqBw0nO4bj2A2w/gBTo1qbENO5XmsZT05/S2jdsihELRg1f JnsA== X-Forwarded-Encrypted: i=1; AJvYcCVSEJL5qjfziX5jjbkx0HEL2jFt8XlxoMbJ/XF2Ij7o3JuxONlxsEkr7ooI4jsPt41q1jzx6TWkYbx6W4aE@vger.kernel.org X-Gm-Message-State: AOJu0YyhYHp1HTrP0SstNy9dX2AR5z6eShej3egR5FzCdfNzN4qlVarA xQ7n01QwtREvVmPIMiuXBSzpfshKMs1r4XH05odQRVIEa04Wmn31/wLSiAhALQc= 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-arm-msm@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20240909-regulator-const-v1-11-8934704a5787@linaro.org> References: <20240909-regulator-const-v1-0-8934704a5787@linaro.org> In-Reply-To: <20240909-regulator-const-v1-0-8934704a5787@linaro.org> To: Support Opensource , Liam Girdwood , Mark Brown , Matthias Brugger , AngeloGioacchino Del Regno , Bartosz Golaszewski Cc: linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org, linux-arm-msm@vger.kernel.org, Krzysztof Kozlowski X-Mailer: b4 0.14.1 X-Developer-Signature: v=1; a=openpgp-sha256; l=2139; i=krzysztof.kozlowski@linaro.org; h=from:subject:message-id; bh=zfZGJPZ+7n/u+R7h1aiFdsdkEzudbMyrWwt0mCMNVy8=; b=owEBbQKS/ZANAwAKAcE3ZuaGi4PXAcsmYgBm3v1iyrWzON70Cq7VuXn8aYsCpNlvo+gCyF8zr /RcPqSw97WJAjMEAAEKAB0WIQTd0mIoPREbIztuuKjBN2bmhouD1wUCZt79YgAKCRDBN2bmhouD 1yTND/9Kx2lZ3eCZZI46T755Vu5pa+AVNHwPIjhtgawTn9QLWZU4dx/nKarepxpIrJmJoAiNmef l9zUCIQ7tTRLh08J5eaODQJjDqqHS9iKGibJ1szkjME/jAk8tK2AuujylmN7rFF6OnjGZRy1hIX +MEkXzQnCsG3sWC79oLxmePYDAS9w79DyLnc+Y2VG416EUBy0sWemV843d/iP/ImkgfSQ8Z+rF0 NqNl+VSGgnBY0WeVjDR5J/LugNaoWcKIOo9oL0JPMMyqLCIbAyXKnZNOKH1RgJohboAaKvvRWcj pvqFAWqbP+cDOVyuibuNXPW57C0G9xz0AdR5CEvDaxMCzVsog/Mp3P+IPNH0DsLfNaLxMcub5pO 7uG43TuDc8R7IV6+0Kwgq6NsaOT+kBsDFBWodE0Kh2TzOv2uZ2COlbSO4fhWQ4xD+D4oOwxNtVa tkUbOckx0oRsGIXgLDv4DqJxJrzypzsLm12PnHbgKcTSps9z5zMpn193f6UCX6fJO9G6V5/GbFg sqWqNLxaDkdNgDua3Pl4lXKyL+90l4ssXiY9uwL788ThSvGGxE4eazeXMUmZ54lNbDvsDYJVzVj ozpmtPHcblf+kCN45ItBbo+Di94pYfYELDshUwux8NWiV61d+WNWYfAV21pMl+w6F26s8fo25Qh ymgij+ek/OQx8QQ== X-Developer-Key: i=krzysztof.kozlowski@linaro.org; a=openpgp; fpr=9BD07E0E0C51F8D59677B7541B93437D3B41629B Driver does not modify static data with regulator description (struct regulator_desc), so make it const for code safety. Signed-off-by: Krzysztof Kozlowski --- Have in mind that to compile this code, you need pending (off-tree) patches, which I applied. --- drivers/regulator/mtk-dvfsrc-regulator.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/drivers/regulator/mtk-dvfsrc-regulator.c b/drivers/regulator/mtk-dvfsrc-regulator.c index 9bf4163221f1..f5662c569464 100644 --- a/drivers/regulator/mtk-dvfsrc-regulator.c +++ b/drivers/regulator/mtk-dvfsrc-regulator.c @@ -19,7 +19,7 @@ enum dvfsrc_regulator_id { }; struct dvfsrc_regulator_pdata { - struct regulator_desc *descs; + const struct regulator_desc *descs; u32 size; }; @@ -107,7 +107,7 @@ static const unsigned int mt6873_voltages[] = { 725000, }; -static struct regulator_desc mt6873_regulators[] = { +static const struct regulator_desc mt6873_regulators[] = { MTK_DVFSRC_VREG("dvfsrc-vcore", VCORE, mt6873_voltages), MTK_DVFSRC_VREG("dvfsrc-vscp", VSCP, mt6873_voltages), }; @@ -122,7 +122,7 @@ static const unsigned int mt8183_voltages[] = { 800000, }; -static struct regulator_desc mt8183_regulators[] = { +static const struct regulator_desc mt8183_regulators[] = { MTK_DVFSRC_VREG("dvfsrc-vcore", VCORE, mt8183_voltages), }; @@ -138,7 +138,7 @@ static const unsigned int mt8195_voltages[] = { 750000, }; -static struct regulator_desc mt8195_regulators[] = { +static const struct regulator_desc mt8195_regulators[] = { MTK_DVFSRC_VREG("dvfsrc-vcore", VCORE, mt8195_voltages), MTK_DVFSRC_VREG("dvfsrc-vscp", VSCP, mt8195_voltages), }; @@ -159,7 +159,7 @@ static int dvfsrc_vcore_regulator_probe(struct platform_device *pdev) return -EINVAL; for (i = 0; i < pdata->size; i++) { - struct regulator_desc *vrdesc = &pdata->descs[i]; + const struct regulator_desc *vrdesc = &pdata->descs[i]; struct regulator_dev *rdev; rdev = devm_regulator_register(&pdev->dev, vrdesc, &config); From patchwork Mon Sep 9 13:51:23 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Krzysztof Kozlowski X-Patchwork-Id: 13797102 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 2EFD11BC9FF for ; Mon, 9 Sep 2024 13:51:57 +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=1725889918; cv=none; b=kRnP5FEBD49Sw3cggH3JiiEYo2J+NTxZphSWmVTUlXyJkR/7+LUIS8ZgYX9giUDivsDx3yLXmx/YQ8g+piQuU4/FAMwsqDEmULRJfUHmoODmdx2B2MxfXWRgNF7SKN8Ck58TZAknk8QT+xKR5EHYx7QePjuxPDIDr10zIE7oCOo= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1725889918; c=relaxed/simple; bh=MS4Vn8NDElkbWDEAQWJiCHTN4oDL8ETlvc4aO5xEqXE=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=uq7fRvWqWgr1c0pg1XqIqMdiz0JO/MQphHfOh9Lt9J5TOUQOm+8p0WO5Ey7ntxyW9G+M5dYYdtv+4CkcsC+sRri0GWewd3OANZy2SPNLe7xICpi7rqmsFfH4wgj1XcbxTyUqCwdx0eJHJz1AqDijwWXtuct9cFKcv12DkZPdDxI= 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.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="wtNEPAOA" Received: by mail-ej1-f53.google.com with SMTP id a640c23a62f3a-a8a91c8cdd5so22186866b.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=rOmSbZCQJSuEnPa0kfhd4mymBPj1W7bTi0ef1cCftaSOsKYTZVm9gMnabbfrONmgou UXPHOQoUI6b3Flz5TxyE7cHSVYC/YIAJFWC5lYbcbnFGv8y5HvP9r/eYI7zn0RRcbYLi I8yGdnhNbOAkiIqEPkT5IL7hBCKwSJLz9zFBjx+CiSOHGKWRycrWs6Cm2ATJgIrzAUzr dEeLsKAdZTOD4jzCczMdvIhckl5ucEuV0Bp/3lPY/v5AL8wjp2mh7O6Y7GTcpDHz4QQw Ps/ynPOwWh1Nwfm1cWnhOxkUHAnMydBcc7sJ1nlKz0SvklItHVzQPUDc+Dk53MxW5QNq TNDw== X-Forwarded-Encrypted: i=1; AJvYcCXmvxyZ3q/WLUM38E7kTzXmo3Jb7D1r5sXaW++sy1gBh3LmfD4v+o16wkhGMHA5N1RKkS0SGL9WglE/PaeV@vger.kernel.org X-Gm-Message-State: AOJu0Yxj0+CsaHeHUIjKOZObdkB3dxTLKyvYg+NcTfgvf9Uyeb8tbAou MkEvb6PoLkgVaTK91VuqgDXHwnM/WR0pHyVvvHPJDjXZvCK2PLPABYiAJzK9BOA= 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-arm-msm@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20240909-regulator-const-v1-12-8934704a5787@linaro.org> References: <20240909-regulator-const-v1-0-8934704a5787@linaro.org> In-Reply-To: <20240909-regulator-const-v1-0-8934704a5787@linaro.org> To: Support Opensource , Liam Girdwood , Mark Brown , Matthias Brugger , AngeloGioacchino Del Regno , Bartosz Golaszewski Cc: linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org, linux-arm-msm@vger.kernel.org, Krzysztof Kozlowski X-Mailer: b4 0.14.1 X-Developer-Signature: v=1; a=openpgp-sha256; l=2714; i=krzysztof.kozlowski@linaro.org; h=from:subject:message-id; bh=MS4Vn8NDElkbWDEAQWJiCHTN4oDL8ETlvc4aO5xEqXE=; b=owEBbQKS/ZANAwAKAcE3ZuaGi4PXAcsmYgBm3v1ipR0PFario11XiOMREeg6br4HZqWH6heoy GID0BAwI3aJAjMEAAEKAB0WIQTd0mIoPREbIztuuKjBN2bmhouD1wUCZt79YgAKCRDBN2bmhouD 1+kjD/4yE+PIP+59j+gU/cUsfasMKH6r1asR/aM3IqmfKNUATk6MFUoNDDqUNZZnvEQ2gXzj2kL ThFAHRQoOCDMk/5me0Qil5BYYCS7NVWojWcIA/GVUsB90Zc4bYWmSZxs4UijN3cVkqmqT4ddIHK tBcOZmJ9sibK9TVjWT5DjKslzyWfB1WjU2v0w42c6pFD5D4OOdrXMHg1EhcEgb+DsObz20hKhTD JH+rPF33xMlY6zwl0/fcmgxM4uQv2+yLuyhGKg9OFDdcYtXICXhc3Uk7+Uky79VqwLP9hnoyGll Ps0YHrHaeFLkVFErLkBvJtfe8C0+z0LvhmyM8Hwu8OICUSQ1SImwdzggxP/8aIGVSmYCTIxUhmM fEgimd1EJZxM9199uNr2fXFFSw7+2jgiOoVcYC18cQieDZU6mkhTkysZeY7YcVrzF49oNuYSONr GIDEw65D1QWqcpSwx7HEXOwfROB8RgQgoo2D41EYaE1hrqLob34BEAhOqAVZhAWAfUiOYhMkz3O ENspkvf9K2h/6v13cIsrsKnUqjA0C49v0h5EG375HB3awPv3EBQHxCN3ZeDcSWT8qoMJ646n+qC aPfIJZXhcERGnaRZVS6MtRl5WezHcyJ71zGeqitfhtptvvt9rfqHlRQ+fLDtqjjy03WFiT05ZGr a4zrHL0vlDmpXiA== X-Developer-Key: i=krzysztof.kozlowski@linaro.org; a=openpgp; fpr=9BD07E0E0C51F8D59677B7541B93437D3B41629B Driver does not modify static data with regulator description (struct pcap_regulator), so make it const for code safety. Signed-off-by: Krzysztof Kozlowski --- drivers/regulator/pcap-regulator.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/drivers/regulator/pcap-regulator.c b/drivers/regulator/pcap-regulator.c index 319a88412154..441c9344aef7 100644 --- a/drivers/regulator/pcap-regulator.c +++ b/drivers/regulator/pcap-regulator.c @@ -105,7 +105,7 @@ struct pcap_regulator { .lowpwr = _lowpwr, \ } -static struct pcap_regulator vreg_table[] = { +static const struct pcap_regulator vreg_table[] = { VREG_INFO(V1, PCAP_REG_VREG1, 1, 2, 18, 0), VREG_INFO(V2, PCAP_REG_VREG1, 5, 6, 19, 22), VREG_INFO(V3, PCAP_REG_VREG1, 7, 8, 20, 23), @@ -141,7 +141,7 @@ static struct pcap_regulator vreg_table[] = { static int pcap_regulator_set_voltage_sel(struct regulator_dev *rdev, unsigned selector) { - struct pcap_regulator *vreg = &vreg_table[rdev_get_id(rdev)]; + const struct pcap_regulator *vreg = &vreg_table[rdev_get_id(rdev)]; void *pcap = rdev_get_drvdata(rdev); /* the regulator doesn't support voltage switching */ @@ -155,7 +155,7 @@ static int pcap_regulator_set_voltage_sel(struct regulator_dev *rdev, static int pcap_regulator_get_voltage_sel(struct regulator_dev *rdev) { - struct pcap_regulator *vreg = &vreg_table[rdev_get_id(rdev)]; + const struct pcap_regulator *vreg = &vreg_table[rdev_get_id(rdev)]; void *pcap = rdev_get_drvdata(rdev); u32 tmp; @@ -169,7 +169,7 @@ static int pcap_regulator_get_voltage_sel(struct regulator_dev *rdev) static int pcap_regulator_enable(struct regulator_dev *rdev) { - struct pcap_regulator *vreg = &vreg_table[rdev_get_id(rdev)]; + const struct pcap_regulator *vreg = &vreg_table[rdev_get_id(rdev)]; void *pcap = rdev_get_drvdata(rdev); if (vreg->en == NA) @@ -180,7 +180,7 @@ static int pcap_regulator_enable(struct regulator_dev *rdev) static int pcap_regulator_disable(struct regulator_dev *rdev) { - struct pcap_regulator *vreg = &vreg_table[rdev_get_id(rdev)]; + const struct pcap_regulator *vreg = &vreg_table[rdev_get_id(rdev)]; void *pcap = rdev_get_drvdata(rdev); if (vreg->en == NA) @@ -191,7 +191,7 @@ static int pcap_regulator_disable(struct regulator_dev *rdev) static int pcap_regulator_is_enabled(struct regulator_dev *rdev) { - struct pcap_regulator *vreg = &vreg_table[rdev_get_id(rdev)]; + const struct pcap_regulator *vreg = &vreg_table[rdev_get_id(rdev)]; void *pcap = rdev_get_drvdata(rdev); u32 tmp; From patchwork Mon Sep 9 13:51:24 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Krzysztof Kozlowski X-Patchwork-Id: 13797103 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 819B21BC9F0 for ; Mon, 9 Sep 2024 13:51:58 +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=1725889920; cv=none; b=jslHlMl2EPbODsqdOM9jlxAqSGPjB75mov8FlePd5AgfZ0XGQz0bn5FLW8eGB2lN34g+Ln7yiTm1rxISMHWR2UKbgxiPHy6NHwe+bRkcbQpu1gkmuqNvsknQrmVGDhlx+nI8z3Y7VIBlt0ovSkQB1Y3mB8HbIgNvStKwTE6vXuA= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1725889920; c=relaxed/simple; bh=HRKyZjGM94NkFQ6StvG56VA5RTKeFKEABwUAsw2nTr0=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=mxPfJu1wDZkQJscQn9FSfMdqj2KuUGkINGGCSQVjX0UELGQxJerZcvYHZRtsvT7twmejHJvkJZsZLGrQfTVT2MANChlxJGIILYtHhhWXJZWunlf3+dQ8mP+OL+GVGDuJ5ga4FncKu22Ojv/ccZ+lxGDpHhpOa38CbgIbIYYQdMI= 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.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="QJxdMoJ3" Received: by mail-ej1-f48.google.com with SMTP id a640c23a62f3a-a8713b00219so23260566b.0 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=OIvVGhBaS8p16ejtrZAJlSQqfuyiQKpYevjEDRhdvt6ZdzyzsjGM4v+Rt5vT011ygs 2XU6feM2Dmmuzz2t8d0iOYqonzIHOv7Ef5JEjBhm6VG8aPBT+nVe2mqY/F4if6I3xVeo O7R/kvIAUiv8Zyt1End5S3ReJ2iJ7HjkaUH+a2T09dH1WGBZEqL+NQXj8hJ386SEbah7 QlUY9ePUyRanulWDMTphuPtind7eKjlBgsY/Ld0n1fDcuAvN7Gpd+CfvacULor5dwErX Dzuiv3XSgLN2NYkhkx1km0lXN1T2rPbHNv+U85XnTN9HirDIKZJjCKMoXpp8ocsaYjuy TrHQ== X-Forwarded-Encrypted: i=1; AJvYcCUnPunyO5EnERvLoKpx+WOzAKxLLFQKeVH/Y6Eoo3qHHVhXRwEULOaycw+/mNhUxPHmhtpDi0Q7ckUQt+yc@vger.kernel.org X-Gm-Message-State: AOJu0YyguLw/VN9r+01FBovrGziclY0T1EjMC1CSycaN+kh9V6CY7gr3 M5XW42Kv2k4pU6JzloVPDUv8sW3tvVAETb7MnGhT/l2gbHabIP4JLr5fYaZI+/8= 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-arm-msm@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20240909-regulator-const-v1-13-8934704a5787@linaro.org> References: <20240909-regulator-const-v1-0-8934704a5787@linaro.org> In-Reply-To: <20240909-regulator-const-v1-0-8934704a5787@linaro.org> To: Support Opensource , Liam Girdwood , Mark Brown , Matthias Brugger , AngeloGioacchino Del Regno , Bartosz Golaszewski Cc: linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org, linux-arm-msm@vger.kernel.org, Krzysztof Kozlowski X-Mailer: b4 0.14.1 X-Developer-Signature: v=1; a=openpgp-sha256; l=2916; i=krzysztof.kozlowski@linaro.org; h=from:subject:message-id; bh=HRKyZjGM94NkFQ6StvG56VA5RTKeFKEABwUAsw2nTr0=; b=owEBbQKS/ZANAwAKAcE3ZuaGi4PXAcsmYgBm3v1j85Ng6PdTzeDBq/rz5MGVUOdHrew/KeKhR UAfJ5DrtbyJAjMEAAEKAB0WIQTd0mIoPREbIztuuKjBN2bmhouD1wUCZt79YwAKCRDBN2bmhouD 1yq9D/9tEjTOPlkRyFze0AvTYAD9mQWQGKm7MqyAuFjex4vzWptpuDisJx4iUpkQGmRhr25LLQX oXu120pBSWEDyQFmdFWxvR1i6Xjdl9p8ssy7QiCXyXw9LWTDUxT2v26LV5QzupmqthvQ0mEH6ae Kk7gQmRAnIMnVliMEojJJ2KkwvVrye1X+xfnycZobF2ebIi82li/lQ5fDcEyLsm/g89FKLP723D en12o+9U4G6pVLlxeXMDXfxXojQtJzrkujgF6AMsRsuxZs6e6bZJck4wyPC1M2lbdFN7/Y9l4Wp xAIahb3R59XqJ1OMcHNHo897iLmXClURj3Q0ENgymMYfRcVdaqyUTRDal3wXBcfMdfAEwb6d47+ miiThY7QV7kjifx3aZGRwEX6JnwRkw+BZqtTuTw90GwNDsSCEZI6DuHZWWvBPRYiPYqEBWBiTzL yrtKPWp0HEb138JnN1PW505GszshVpkyNd8ghcmPCrmrhOk9HZsVdBd5cU9CY2mv6xEwW+n6loy 51xKnNZ/RYG+mu5B8VhF623N1mZPISanAnuYhEjXfbZI28dSOs75HHcrdVbfxcbjLsbJ0uPq/rj 3p7t129yZIjYUXz4cGYDgLPis2PpWCshGD0TdTvKAqo3F/xR1Yw41HJD0E14ZzKfHxyBYo/1osg UG/PHCWPadpT4/w== X-Developer-Key: i=krzysztof.kozlowski@linaro.org; a=openpgp; fpr=9BD07E0E0C51F8D59677B7541B93437D3B41629B Driver does not modify static data with regulator description (struct pfuze_regulator), so make it const for code safety. Signed-off-by: Krzysztof Kozlowski --- drivers/regulator/pfuze100-regulator.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/drivers/regulator/pfuze100-regulator.c b/drivers/regulator/pfuze100-regulator.c index 7c04870442d3..7d56c22b5e40 100644 --- a/drivers/regulator/pfuze100-regulator.c +++ b/drivers/regulator/pfuze100-regulator.c @@ -76,7 +76,7 @@ struct pfuze_chip { struct device *dev; struct pfuze_regulator regulator_descs[PFUZE100_MAX_REGULATOR]; struct regulator_dev *regulators[PFUZE100_MAX_REGULATOR]; - struct pfuze_regulator *pfuze_regulators; + const struct pfuze_regulator *pfuze_regulators; }; static const int pfuze100_swbst[] = { @@ -367,7 +367,7 @@ static const struct regulator_ops pfuze3000_sw_regulator_ops = { } /* PFUZE100 */ -static struct pfuze_regulator pfuze100_regulators[] = { +static const struct pfuze_regulator pfuze100_regulators[] = { PFUZE100_SW_REG(PFUZE100, SW1AB, PFUZE100_SW1ABVOL, 300000, 1875000, 25000), PFUZE100_SW_REG(PFUZE100, SW1C, PFUZE100_SW1CVOL, 300000, 1875000, 25000), PFUZE100_SW_REG(PFUZE100, SW2, PFUZE100_SW2VOL, 400000, 1975000, 25000), @@ -386,7 +386,7 @@ static struct pfuze_regulator pfuze100_regulators[] = { PFUZE100_COIN_REG(PFUZE100, COIN, PFUZE100_COINVOL, 0x7, pfuze100_coin), }; -static struct pfuze_regulator pfuze200_regulators[] = { +static const struct pfuze_regulator pfuze200_regulators[] = { PFUZE100_SW_REG(PFUZE200, SW1AB, PFUZE100_SW1ABVOL, 300000, 1875000, 25000), PFUZE100_SW_REG(PFUZE200, SW2, PFUZE100_SW2VOL, 400000, 1975000, 25000), PFUZE100_SW_REG(PFUZE200, SW3A, PFUZE100_SW3AVOL, 400000, 1975000, 25000), @@ -403,7 +403,7 @@ static struct pfuze_regulator pfuze200_regulators[] = { PFUZE100_COIN_REG(PFUZE200, COIN, PFUZE100_COINVOL, 0x7, pfuze100_coin), }; -static struct pfuze_regulator pfuze3000_regulators[] = { +static const struct pfuze_regulator pfuze3000_regulators[] = { PFUZE3000_SW_REG(PFUZE3000, SW1A, PFUZE100_SW1ABVOL, 0x1f, pfuze3000_sw1a), PFUZE100_SW_REG(PFUZE3000, SW1B, PFUZE100_SW1CVOL, 700000, 1475000, 25000), PFUZE3000_SW_REG(PFUZE3000, SW2, PFUZE100_SW2VOL, 0x7, pfuze3000_sw2lo), @@ -419,7 +419,7 @@ static struct pfuze_regulator pfuze3000_regulators[] = { PFUZE100_VGEN_REG(PFUZE3000, VLDO4, PFUZE100_VGEN6VOL, 1800000, 3300000, 100000), }; -static struct pfuze_regulator pfuze3001_regulators[] = { +static const struct pfuze_regulator pfuze3001_regulators[] = { PFUZE3000_SW_REG(PFUZE3001, SW1, PFUZE100_SW1ABVOL, 0x1f, pfuze3000_sw1a), PFUZE3000_SW_REG(PFUZE3001, SW2, PFUZE100_SW2VOL, 0x7, pfuze3000_sw2lo), PFUZE3000_SW3_REG(PFUZE3001, SW3, PFUZE100_SW3AVOL, 900000, 1650000, 50000), From patchwork Mon Sep 9 13:51:25 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Krzysztof Kozlowski X-Patchwork-Id: 13797104 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 5F90B1BA278 for ; Mon, 9 Sep 2024 13:52:00 +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=1725889922; cv=none; b=TXellqXHvyW79yIIK17cm84ZOI6UEYl1SQDgwhqLY6vkiiZBaTV56w/BE002IrPDK5x2vkYQZkOKn9aI0e2eYSjgUe8TvJy0ruSnnZAHk5x4IbOJ4g+TFE8w8OTbgR0P1FwKBSVfFWB8M2wb4Xd1fP9f2sWahtt96Nwif+kxOQ0= 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.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="hRLE5843" Received: by mail-ej1-f52.google.com with SMTP id a640c23a62f3a-a8d1a00e0d0so8619266b.3 for ; Mon, 09 Sep 2024 06:52:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1725889919; x=1726494719; darn=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=P97giYvcV77rji8if0kzpNaK4GFQXZWkmjzZ5zHheqgR0ipVBMOIQdzSxW7a0gJlGL cH0uSQF22STjytPVfqBWbFbnPwJZ6NuU+/lgB0mTlyHJ5tA6rahp7eP76qEq1Bi8G29e AO5V/YBtWU0Gim5yaye6mxsBfN3LLx+I//5zb1FeSzlBAmiS3d45nbr051rTRFbNmCcj hIBFBW861xTKHsO7MrglJ4VVHvBZT2iDeRVqylnZN+X87YTq3oByN0yyKHXuPuu8jCzC a5+63tL1732Pg070eqVpWfwi624/FbPUErQPbz9R36fdRPMtyk4zNcuyrSnI+qs/E3aC ty+Q== X-Forwarded-Encrypted: i=1; AJvYcCXr7xQS3gcU8f366AX7P0ZtJf/WZZ9/WDBAG4Aj55REAUbbu/j6VWqRV1887CxtW0Oy5eum/tplEhWgXwm+@vger.kernel.org X-Gm-Message-State: AOJu0YybIl57HdsN1HlFEQRIhEvZIWmTFg5YA+o2ankrGRS+HaLy5aZN iBBnIe3gWE1jJrpq1zUgJF4NuHAF3hCgfI4d7QfQbn3AXtHJ22uMDcGYqZzlI3g= 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-arm-msm@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20240909-regulator-const-v1-14-8934704a5787@linaro.org> References: <20240909-regulator-const-v1-0-8934704a5787@linaro.org> In-Reply-To: <20240909-regulator-const-v1-0-8934704a5787@linaro.org> To: Support Opensource , Liam Girdwood , Mark Brown , Matthias Brugger , AngeloGioacchino Del Regno , Bartosz Golaszewski Cc: linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org, linux-arm-msm@vger.kernel.org, Krzysztof Kozlowski X-Mailer: b4 0.14.1 X-Developer-Signature: v=1; a=openpgp-sha256; l=1177; i=krzysztof.kozlowski@linaro.org; h=from:subject:message-id; bh=KcmtvuFpgJTQr+NrBtSfkFBmPuXrmTaJALoNQh34mgc=; b=owEBbQKS/ZANAwAKAcE3ZuaGi4PXAcsmYgBm3v1khpb7WzxyunM5lYXMazdM4ujdBKnR1uNAG IJMqHk63k6JAjMEAAEKAB0WIQTd0mIoPREbIztuuKjBN2bmhouD1wUCZt79ZAAKCRDBN2bmhouD 1xTvD/9iDwh1+cEyfWNjyNGqc4y9wqU0ZzDeg3tyTbYWtWgBrDXX4gYRWsD0etQouIuhs83FC5m 7m67B+n4Q7QjrfQUtSTkfGWvYGHjLQ/RooOdXrg4+dfjO6myAtqeTeaHlNZu74tr0xVQMocpWC2 CpBT9Ek9UtovGtrVKAqsQhsSbMXSek1w7kB/u3fnRe6Z7N13lKr8XjBaqaaRPsqfS032KXyQ3uv Le3dFP+wqoLN+CqPjM6LMPx8iRceIuX1rSb1CpJgJaf+zLVAVMi5ZitneFTPpWjFHEWw9i2ZxX1 atam2jSgTHB3NgxVpjBoaayFmWv6Rwq5uBmrYvXVpKSK92NHqDmd0hxrq3G3Xl8bF1hpCDtkqVi QhNR3/DD87VK4Jt/7pPG4f1RYHZhNl9qJ2jEqQwLFVfK+GqI1xLCRsl5TY3i6dWXHHqV0KTOtw6 lJn32B6vGS9haLMgSBewc356tSJEBwE6QpycGFI+ENmABZSJvasyHqXQL563bHFyQvHOhCNjsaD R1We9KqaUZJALCSELvgzu0qBevYrx9Yw5VqdwW4id3C4UjPXdVOzId9mlYN2laxcb1+RkTbyEIr yENminEQ5sFMNejQBF6CUF8SBl08MgdL43RBCT7XKPzK4MbNt9K8Uwgn6NVVVrICJgXS0rscTtM y/G9xuQdIzo4sZQ== X-Developer-Key: i=krzysztof.kozlowski@linaro.org; a=openpgp; fpr=9BD07E0E0C51F8D59677B7541B93437D3B41629B Driver does not modify static data with regulator description (struct regulator_desc), so make it const for code safety. Signed-off-by: Krzysztof Kozlowski --- drivers/regulator/qcom-refgen-regulator.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/regulator/qcom-refgen-regulator.c b/drivers/regulator/qcom-refgen-regulator.c index 063e12c08e75..cfa72ce85bc8 100644 --- a/drivers/regulator/qcom-refgen-regulator.c +++ b/drivers/regulator/qcom-refgen-regulator.c @@ -62,7 +62,7 @@ static int qcom_sdm845_refgen_is_enabled(struct regulator_dev *rdev) return 1; } -static struct regulator_desc sdm845_refgen_desc = { +static const struct regulator_desc sdm845_refgen_desc = { .enable_time = 5, .name = "refgen", .owner = THIS_MODULE, @@ -74,7 +74,7 @@ static struct regulator_desc sdm845_refgen_desc = { }, }; -static struct regulator_desc sm8250_refgen_desc = { +static const struct regulator_desc sm8250_refgen_desc = { .enable_reg = REFGEN_REG_PWRDWN_CTRL5, .enable_mask = REFGEN_PWRDWN_CTRL5_MASK, .enable_val = REFGEN_PWRDWN_CTRL5_ENABLE, From patchwork Mon Sep 9 13:51:26 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Krzysztof Kozlowski X-Patchwork-Id: 13797105 Received: from mail-ed1-f45.google.com (mail-ed1-f45.google.com [209.85.208.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 E6B631BD51E for ; Mon, 9 Sep 2024 13:52:01 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.208.45 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1725889923; cv=none; b=UUTYeNbW1RyYLrfUxFenNgxPGgAtxtShY1AccH8B3cq+H1M5Gnb//IOpfNJOgbLlhNRryIdoweyKhBuPnTgXQAnE71OiawRpjdPYpfGfco+JK8WmUqEa54lUx/rtcOKNtx+J9tlw9Q6pQleeUU4ldwt5ix45bCIii2w8tYpN78w= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1725889923; c=relaxed/simple; bh=30I+hQDkibrC4fpctSIcG7hdlAaMTfnXmLnvdZibnpU=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=rIqEUTF6CTzKloYCtOUAan80RvYuz1tPk40s5M1hLFXdBb8ca2ucYl7aMzdffE/3eIOVx/nRD4FbvBWLxz67RgTKjlnK5SNxu0Xn43Gdei1QwGkNZUyJKV5WdXMoZ6Tyh/m53kqzYwMAJMwny1XXoF/41tQa/VF61pAK7y4cegc= 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.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="SpU23G7J" Received: by mail-ed1-f45.google.com with SMTP id 4fb4d7f45d1cf-5c2535b081fso414819a12.2 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=mF/4pDTmh71D+tVdIM5QWm8lgs1/SMVOaoIE+VLMZPYP6s2hOYEkkhR+KpGj2ef9lC q8QQIUIQ49JKtrMkaiUftU5Jz8s4iZ1loMc8p7vgeXab2n/KWLWnmy6e8ErWTUPg+NYU o2QWw2OTMOUGVb2Lz8lWS1heacbuBJ3YV6kBPNbZ+Bl2KaAABPmlv3HGEfwI1ngbj27Y BJE6526WPN0oL21z+VoXKgFkM+og7Te7jkg2d7ZDDakzlzufKlAR78ZW600Kj/nnXaYp /aAIXHeka56Ilg01OlHPhPa6GLobrFqbkbOPElG1VbWp6w+XkMJsqhJQ2VYW/8g//Y6P B3Rg== X-Forwarded-Encrypted: i=1; AJvYcCV55cgQJlljsuoTKrQ4cjp24ipv8rdnyv4bAuivTnWzO9iaPNWKGmczE+2Lau40z/eOnGVDF3oZK8VQkUnh@vger.kernel.org X-Gm-Message-State: AOJu0Yy5IMvoaBh8VfsIqf/618mm8Rt8Q7WtYAXnsC3Vhllc1okubrvv k7mT37hW/pgTQ4879vCg+OrWAzjVp28j3XSTmlWcqZnKNwQMhZPHbVt3XAtdEIE= 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-arm-msm@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20240909-regulator-const-v1-15-8934704a5787@linaro.org> References: <20240909-regulator-const-v1-0-8934704a5787@linaro.org> In-Reply-To: <20240909-regulator-const-v1-0-8934704a5787@linaro.org> To: Support Opensource , Liam Girdwood , Mark Brown , Matthias Brugger , AngeloGioacchino Del Regno , Bartosz Golaszewski Cc: linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org, linux-arm-msm@vger.kernel.org, Krzysztof Kozlowski X-Mailer: b4 0.14.1 X-Developer-Signature: v=1; a=openpgp-sha256; l=2350; i=krzysztof.kozlowski@linaro.org; h=from:subject:message-id; bh=30I+hQDkibrC4fpctSIcG7hdlAaMTfnXmLnvdZibnpU=; b=kA0DAAoBwTdm5oaLg9cByyZiAGbe/WWgVe4Femx5zZkMkuSdYYU3T+Lo1v/39prjIzLzFC2Rk okCMwQAAQoAHRYhBN3SYig9ERsjO264qME3ZuaGi4PXBQJm3v1lAAoJEME3ZuaGi4PXrZ4P/jA0 sscxqGelVqRBLU11Sgi+WZRl0920k7u9YS+qTqrF3B/ixnO5gkeFkh4TidRddSqKEWj+bKpdvWa A985jl1aSp2A42gfSWC7SYcXBpCgXKPR3E5di6RpAUS2Msj8yuwD7dJudEhah6wq+pYlfCNcI3t gdcDxs6cY8+kbdmCsRWXDs8X6PqojXuAlNlKPH9FrQolgKicOVgYfXvyQQrBFRcCrrFHgpPyhZT QMQ4Y+Vcxj5WAg057JH9m2BMVVmcUppJSaBoc1Yz1EN3ZNTm/OZY9lDFywruf24uW6wlZHz22NX RmmZIeW1AUBK7ZpSDY1/R74lzoVOH4CDNVotkjknx06o7Tme2QRHyUQdhghK73hGa4ojfkfM8sT QJ5FWuKNPfujqXIuKg8+xL2slkkJ+UJXYHL1SsIbNzNaulZXEXiO+TAJzDcChJskzf4NE/BRG9G jRPXYkMladjtkLEgp0jvX8Jg88lqSaM5XodDAyrrr/qjRcWLaFpKb4NIG8dViOlRndyg6o+pT0o kZWiKXuuzuoTtzqisFHhoSOsmDWPwmBHu2SSsFqQ0oG8eOsi3v+jwn46ji9DwGcvQu79QkLAOFq 32/amHyTfCBs9oqbF7lZOKOeBYNkW88NZysVNbLHkW52ifnuyjykX+2B4b/QR4BpGZTi4B2bPRP fQWF8 X-Developer-Key: i=krzysztof.kozlowski@linaro.org; a=openpgp; fpr=9BD07E0E0C51F8D59677B7541B93437D3B41629B The hi6421v530_regulator_info.eco_microamp is assigned once and never used again. Signed-off-by: Krzysztof Kozlowski --- drivers/regulator/hi6421v530-regulator.c | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) diff --git a/drivers/regulator/hi6421v530-regulator.c b/drivers/regulator/hi6421v530-regulator.c index 23924ff0c7b2..a9c6c077f50d 100644 --- a/drivers/regulator/hi6421v530-regulator.c +++ b/drivers/regulator/hi6421v530-regulator.c @@ -21,12 +21,10 @@ * struct hi6421v530_regulator_info - hi6421v530 regulator information * @desc: regulator description * @mode_mask: ECO mode bitmask of LDOs; for BUCKs, this masks sleep - * @eco_microamp: eco mode load upper limit (in uA), valid for LDOs only */ struct hi6421v530_regulator_info { struct regulator_desc rdesc; u8 mode_mask; - u32 eco_microamp; }; /* HI6421v530 regulators */ @@ -68,10 +66,9 @@ static const struct regulator_ops hi6421v530_ldo_ops; * emask - enable mask * odelay - off/on delay time in uS * ecomask - eco mode mask - * ecoamp - eco mode load uppler limit in uA */ #define HI6421V530_LDO(_ID, v_table, vreg, vmask, ereg, emask, \ - odelay, ecomask, ecoamp) { \ + odelay, ecomask) { \ .rdesc = { \ .name = #_ID, \ .of_match = of_match_ptr(#_ID), \ @@ -90,22 +87,21 @@ static const struct regulator_ops hi6421v530_ldo_ops; .off_on_delay = odelay, \ }, \ .mode_mask = ecomask, \ - .eco_microamp = ecoamp, \ } /* HI6421V530 regulator information */ static struct hi6421v530_regulator_info hi6421v530_regulator_info[] = { HI6421V530_LDO(LDO3, ldo_3_voltages, 0x061, 0xf, 0x060, 0x2, - 20000, 0x6, 8000), + 20000, 0x6), HI6421V530_LDO(LDO9, ldo_9_11_voltages, 0x06b, 0x7, 0x06a, 0x2, - 40000, 0x6, 8000), + 40000, 0x6), HI6421V530_LDO(LDO11, ldo_9_11_voltages, 0x06f, 0x7, 0x06e, 0x2, - 40000, 0x6, 8000), + 40000, 0x6), HI6421V530_LDO(LDO15, ldo_15_16_voltages, 0x077, 0x7, 0x076, 0x2, - 40000, 0x6, 8000), + 40000, 0x6), HI6421V530_LDO(LDO16, ldo_15_16_voltages, 0x079, 0x7, 0x078, 0x2, - 40000, 0x6, 8000), + 40000, 0x6), }; static unsigned int hi6421v530_regulator_ldo_get_mode( From patchwork Mon Sep 9 13:51:27 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Krzysztof Kozlowski X-Patchwork-Id: 13797107 Received: from mail-ej1-f51.google.com (mail-ej1-f51.google.com [209.85.218.51]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 3DB451BDA99 for ; Mon, 9 Sep 2024 13:52:03 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.218.51 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1725889925; cv=none; b=cfo1cdbCXRxr1SbkLgzRAtf3RnlMxOLWtKK8UNcAwBB9Og1JNLsceP4rGI3U747EDXIEEhhcBUYIAURrMS/NSRbSxOLry7IJJNiuYKanCH9PLG+1c8WWb5ECfJPmzp4gCqKqCq2HRqKm444/ThxOSjTdW1/yIu9vAQSpPZQeErM= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1725889925; c=relaxed/simple; bh=QfpMH8xpX7M5v1cNMdTuKAFwaOO0ijMMMrIuqJNJ7Fc=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=Wo4Bum1t/0AhVYdylLhFWs7A/488nklQwaAeBFqV68k0Yvf+fxZzbvMIHOvPL+sKDT8q4wEWHJ1TLmRHqso7HXGjnhaMziOYCp7HccmUEL8jOYI2HmxqkHP/P+6p8vjqcpcR+6aEZq5BPGwVqORryfem22UN8/lW+r0EXk1YlJM= 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.51 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linaro.org 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-f51.google.com with SMTP id a640c23a62f3a-a8a92e8c840so38153366b.2 for ; Mon, 09 Sep 2024 06:52:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1725889921; x=1726494721; darn=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=ipdwbjDEHNfJ6TvEPgUo2ZEKGopuS0ktnXe3VLzYGg4tFxo/bEqEeXvOwtytePb5uF 1R/dD7aa/iIb86IFNOl5oPCX6ofyy78dQOx+IASCE7qRPWZuA1scJpgDZgkPRflLdJFf iFcRf2Q5q57yKzrrXr6uz4OEWm/n+eRjLjGXlZcuezhPKzfNfPUzU008+Ap91J6AfbdB dgAcrb/8ggwdo4Su3WY+n3uO0lCKSGbpRNjoDkippYTdqvU6LB8ajlVZ2MGLnXkGebn8 Sw01M3rAiZe8+Tt6Vs+z62YuDhIQGg8G8FPb51flSBN0l+mPWuk6O3d9AQ+EAXnM8j8L 49mQ== X-Forwarded-Encrypted: i=1; AJvYcCVJQkcBp/J2EQL7srI3G98OyPFHFjlTLQ4CTFP8MmaMKKdXz05sROnCA8L8PCpi1HWxX5Vm17SoO3cq7LNb@vger.kernel.org X-Gm-Message-State: AOJu0YxTmZxBFaqyI6Vq23pvzChrG4mf8lOJW7lASAjpNoUNm9TGUAdp VjsRVbrF0iN6lRkWnQ5HLGsc95vXGb5YS1xVgvNfEO+lz3PoTQlkeTxx+YvHcGg= 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-arm-msm@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20240909-regulator-const-v1-16-8934704a5787@linaro.org> References: <20240909-regulator-const-v1-0-8934704a5787@linaro.org> In-Reply-To: <20240909-regulator-const-v1-0-8934704a5787@linaro.org> To: Support Opensource , Liam Girdwood , Mark Brown , Matthias Brugger , AngeloGioacchino Del Regno , Bartosz Golaszewski Cc: linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org, linux-arm-msm@vger.kernel.org, Krzysztof Kozlowski X-Mailer: b4 0.14.1 X-Developer-Signature: v=1; a=openpgp-sha256; l=2454; i=krzysztof.kozlowski@linaro.org; h=from:subject:message-id; bh=QfpMH8xpX7M5v1cNMdTuKAFwaOO0ijMMMrIuqJNJ7Fc=; b=owEBbQKS/ZANAwAKAcE3ZuaGi4PXAcsmYgBm3v1mbrrIu6Do6kppOFM21iGEOSQnx+wr6TRGX MTTtX77+QKJAjMEAAEKAB0WIQTd0mIoPREbIztuuKjBN2bmhouD1wUCZt79ZgAKCRDBN2bmhouD 17PsD/49SlTRgOuT9opobBE999Eo0XMLtC18q26ggdv3vW/9xY53TZacc1sfclw2LWcHUPAzpMk v2yz16QkZK0z0MiqCpwIM3z7/b4Idk/YJQxNscRM645bKHaNxlYeBVQgXRpX/rgPYKwne7RRCzS 2G8wCmaSA7KTQ4OK0I/VX1B1w1PVLAdlTp1DajYRjpFMQyCbeGMx1dw2pHFCVEZnGklOtB+JXZw F24rxvpdFzaZTvbSrR8OA3Qr0AbdGSNsvBjJxWxMKNmeXehb9q4X7PeP6NMEWyZuZahJhIwjPuK 4GjDbix7naxDG3LRLFvXQVBTd3tTtlrmarGiqUrWr48TKoOIiXQ9+3DhtiZbU0jen/scVfhLIXN JLmEHol/WBUI0ziNAnJcMtWHmUDZeQZgehGHviTxSEQvRoCRJi8cR8jVrPFXBOeWXUp5+cELP7+ e9OPitc1nA9XIsdv9Is1SNjUSSH8fQGeNLDqzfSNPLkGqGDi8HE/QlkfwsNJ27ITARLbditccpc 3OaBBhaAb6Ejc/HnYwA1EcFNkR+iwRN8RBLJqsGC7GVr9tfTtG1CZDKj8B9TfcLpEpCBvVTcmUd wa85RJKRg3BgCuNk3/bEnS44Ywg8avfJ5Q66Hu84715P6hvPDUVsjB8PJSrlaN477J5Bxa2URNo S2rXdeUiFplSo8w== X-Developer-Key: i=krzysztof.kozlowski@linaro.org; a=openpgp; fpr=9BD07E0E0C51F8D59677B7541B93437D3B41629B Switch from rdev_get_drvdata() to container_of(), so the static 'struct hi6421v530_regulator_info' holding 'struct regulator_desc' can be made const for code safety. Signed-off-by: Krzysztof Kozlowski --- [RFT]: Not tested, only built. --- drivers/regulator/hi6421v530-regulator.c | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/drivers/regulator/hi6421v530-regulator.c b/drivers/regulator/hi6421v530-regulator.c index a9c6c077f50d..b3ebd1624814 100644 --- a/drivers/regulator/hi6421v530-regulator.c +++ b/drivers/regulator/hi6421v530-regulator.c @@ -91,7 +91,7 @@ static const struct regulator_ops hi6421v530_ldo_ops; /* HI6421V530 regulator information */ -static struct hi6421v530_regulator_info hi6421v530_regulator_info[] = { +static const struct hi6421v530_regulator_info hi6421v530_regulator_info[] = { HI6421V530_LDO(LDO3, ldo_3_voltages, 0x061, 0xf, 0x060, 0x2, 20000, 0x6), HI6421V530_LDO(LDO9, ldo_9_11_voltages, 0x06b, 0x7, 0x06a, 0x2, @@ -107,10 +107,10 @@ static struct hi6421v530_regulator_info hi6421v530_regulator_info[] = { static unsigned int hi6421v530_regulator_ldo_get_mode( struct regulator_dev *rdev) { - struct hi6421v530_regulator_info *info; + const struct hi6421v530_regulator_info *info; unsigned int reg_val; - info = rdev_get_drvdata(rdev); + info = container_of(rdev->desc, struct hi6421v530_regulator_info, rdesc); regmap_read(rdev->regmap, rdev->desc->enable_reg, ®_val); if (reg_val & (info->mode_mask)) @@ -122,10 +122,10 @@ static unsigned int hi6421v530_regulator_ldo_get_mode( static int hi6421v530_regulator_ldo_set_mode(struct regulator_dev *rdev, unsigned int mode) { - struct hi6421v530_regulator_info *info; + const struct hi6421v530_regulator_info *info; unsigned int new_mode; - info = rdev_get_drvdata(rdev); + info = container_of(rdev->desc, struct hi6421v530_regulator_info, rdesc); switch (mode) { case REGULATOR_MODE_NORMAL: new_mode = 0; @@ -172,7 +172,6 @@ static int hi6421v530_regulator_probe(struct platform_device *pdev) for (i = 0; i < ARRAY_SIZE(hi6421v530_regulator_info); i++) { config.dev = pdev->dev.parent; config.regmap = pmic->regmap; - config.driver_data = &hi6421v530_regulator_info[i]; rdev = devm_regulator_register(&pdev->dev, &hi6421v530_regulator_info[i].rdesc, From patchwork Mon Sep 9 13:51:28 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Krzysztof Kozlowski X-Patchwork-Id: 13797108 Received: from mail-ej1-f51.google.com (mail-ej1-f51.google.com [209.85.218.51]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id B1D411BDAB7 for ; Mon, 9 Sep 2024 13:52:04 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.218.51 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1725889926; cv=none; b=WBxEogafCN9TOC2f775VpRoun/T0r7pqB6PnNZWZvryPVlpAT2HXEaOq9TEouP/VqKkkveuB3cOspeD/W5066e0dhVP+22MQQPtSex2pctlLsW1qA22hCiK+1rmYfpnQext6g0I3olgKetD7YCiYzX/Kq7EY8lkVvY63vlISfKw= 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.51 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linaro.org 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-f51.google.com with SMTP id a640c23a62f3a-a8a87c7c68dso12367566b.1 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=i6BDQ3UeO4EX6m8Lj5w1AVb/ofxdS2mrBXSoSKW2VUfmSNTTEf23rghoIqdFrOa4Ru M9QOjWJ2xhMeGcGrvN80PmdyRTOUx5PcxC/Kw0ff5H7X3TCB+SNN2BwbomTF69jB0mZo xxDvMt00tu3WLZ7WZR9RE5488tUNtpKXs76XYnU7y49c0CW9+/KVFFbkoGH5FtUFo1q4 kGJ5my0C09d8S4gUifKl9s/hJM85Cksx5WcRifMljjumtAnw0b9RRm+ouTD41gRsecb8 PVHmxhxCicRCks1bzyQBJV/h891vpP5L4qYOw6E1Ne+HrCmsTsxtn+UjWmC47qviO2w7 wIkA== X-Forwarded-Encrypted: i=1; AJvYcCX4liibggj7B1jUePt/hTdjnu9B4vZdG1AXEBldg94oMlcHKWbJrWde0VRVefygwmssnHVHSuXw7T9nxOOz@vger.kernel.org X-Gm-Message-State: AOJu0YzVl+hcbjWJ8mUgNhvxvdOiYPYYq/P5bBeXWCO9m3oekA2Uhvqv u46G3GZ4N/u0s4CodpxPhNmGPzT6ri24xBb0cxFiDVyg0Q7go7FKcvPpnlpgUJc= 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-arm-msm@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20240909-regulator-const-v1-17-8934704a5787@linaro.org> References: <20240909-regulator-const-v1-0-8934704a5787@linaro.org> In-Reply-To: <20240909-regulator-const-v1-0-8934704a5787@linaro.org> To: Support Opensource , Liam Girdwood , Mark Brown , Matthias Brugger , AngeloGioacchino Del Regno , Bartosz Golaszewski Cc: linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org, linux-arm-msm@vger.kernel.org, Krzysztof Kozlowski X-Mailer: b4 0.14.1 X-Developer-Signature: v=1; a=openpgp-sha256; l=5091; i=krzysztof.kozlowski@linaro.org; h=from:subject:message-id; bh=pT3vklV3r+mZAGNAtUkG8vU9TQS654l0/1TCGybfK8Q=; b=owEBbQKS/ZANAwAKAcE3ZuaGi4PXAcsmYgBm3v1nXIJdWNbRtDH6jLRbfKirVbrDR9hrPibYD A0gRNKrWKKJAjMEAAEKAB0WIQTd0mIoPREbIztuuKjBN2bmhouD1wUCZt79ZwAKCRDBN2bmhouD 14qVEACRgLsVdWDXrS20GsTp4A3Ag89uPdX4Lm1yhjam8q9PHA1EcqEd03qyD9++DH9J+ze5ujx c9LiuV8Y4yAXbrIxGmNWOpx5u/7JoGvGjwsAKmG4P+E5hnO96bKsupFq0ZONfubtSA7efMP65qw xfW4XKiQcPq3KaXujdFdgnhdkG8ultcDksYS2ZU/MB3hiiFytZi6dddp7Mfzx7BEHgs7yF4s9m8 yoigsGsbquv2hbcCDnb1ytwDxR+un6SE33cXwUfo5pNBXAW92nmpQbtbWykifj6vIMjV6CmbraR 52C5s+4gdyII3bdtf4HvUTcz66Asm+/9ihcxYClBn5HiA6lUefRTJjN5zqznTDK0L3zPULYVR2h WbLPZiHzj8UDkLW4aGaclTo/gCX5gAgyzDPphNHbsFx185jVuudPHcW7xU1b+9qMguFXzZIwSlp 5tmlv7aRCC/dGhe1JG9DX3G6ICnQW968kLzlnqDcw6EEHsON1+e8XB/FzHZM2TpHLPTUcRdr5D/ 1o0NHLpdQEnvyS5eZKbx08DylInn6xnZ9QbOZ4sYmBITYGcD8Ou4rdHa/lZHhBW1+E0C4QUP16t fLQaiHp2fnlt+GpZXPFrbgCuNfgB6MoliRVSldN2+bWRS5k1sbw8oTaQWBmbqNuZRtcbE5JSIsL 1RjfoAwiIZmG/ZA== X-Developer-Key: i=krzysztof.kozlowski@linaro.org; a=openpgp; fpr=9BD07E0E0C51F8D59677B7541B93437D3B41629B Switch from rdev_get_drvdata() to container_of(), so the static 'struct max77650_regulator_desc' holding 'struct regulator_desc' can be made const for code safety. Signed-off-by: Krzysztof Kozlowski --- [RFT]: Not tested, only built. --- drivers/regulator/max77650-regulator.c | 31 ++++++++++++++----------------- 1 file changed, 14 insertions(+), 17 deletions(-) diff --git a/drivers/regulator/max77650-regulator.c b/drivers/regulator/max77650-regulator.c index 94abfbb2bc1e..7368f54f046d 100644 --- a/drivers/regulator/max77650-regulator.c +++ b/drivers/regulator/max77650-regulator.c @@ -43,8 +43,6 @@ struct max77650_regulator_desc { unsigned int regB; }; -static struct max77650_regulator_desc max77651_SBB1_desc; - static const unsigned int max77651_sbb1_volt_range_sel[] = { 0x0, 0x1, 0x2, 0x3 }; @@ -66,11 +64,11 @@ static const unsigned int max77650_current_limit_table[] = { static int max77650_regulator_is_enabled(struct regulator_dev *rdev) { - struct max77650_regulator_desc *rdesc; + const struct max77650_regulator_desc *rdesc; struct regmap *map; int val, rv, en; - rdesc = rdev_get_drvdata(rdev); + rdesc = container_of(rdev->desc, struct max77650_regulator_desc, desc); map = rdev_get_regmap(rdev); rv = regmap_read(map, rdesc->regB, &val); @@ -84,10 +82,10 @@ static int max77650_regulator_is_enabled(struct regulator_dev *rdev) static int max77650_regulator_enable(struct regulator_dev *rdev) { - struct max77650_regulator_desc *rdesc; + const struct max77650_regulator_desc *rdesc; struct regmap *map; - rdesc = rdev_get_drvdata(rdev); + rdesc = container_of(rdev->desc, struct max77650_regulator_desc, desc); map = rdev_get_regmap(rdev); return regmap_update_bits(map, rdesc->regB, @@ -97,10 +95,10 @@ static int max77650_regulator_enable(struct regulator_dev *rdev) static int max77650_regulator_disable(struct regulator_dev *rdev) { - struct max77650_regulator_desc *rdesc; + const struct max77650_regulator_desc *rdesc; struct regmap *map; - rdesc = rdev_get_drvdata(rdev); + rdesc = container_of(rdev->desc, struct max77650_regulator_desc, desc); map = rdev_get_regmap(rdev); return regmap_update_bits(map, rdesc->regB, @@ -145,7 +143,7 @@ static const struct regulator_ops max77651_SBB1_regulator_ops = { .set_active_discharge = regulator_set_active_discharge_regmap, }; -static struct max77650_regulator_desc max77650_LDO_desc = { +static const struct max77650_regulator_desc max77650_LDO_desc = { .desc = { .name = "ldo", .of_match = of_match_ptr("ldo"), @@ -171,7 +169,7 @@ static struct max77650_regulator_desc max77650_LDO_desc = { .regB = MAX77650_REG_CNFG_LDO_B, }; -static struct max77650_regulator_desc max77650_SBB0_desc = { +static const struct max77650_regulator_desc max77650_SBB0_desc = { .desc = { .name = "sbb0", .of_match = of_match_ptr("sbb0"), @@ -201,7 +199,7 @@ static struct max77650_regulator_desc max77650_SBB0_desc = { .regB = MAX77650_REG_CNFG_SBB0_B, }; -static struct max77650_regulator_desc max77650_SBB1_desc = { +static const struct max77650_regulator_desc max77650_SBB1_desc = { .desc = { .name = "sbb1", .of_match = of_match_ptr("sbb1"), @@ -231,7 +229,7 @@ static struct max77650_regulator_desc max77650_SBB1_desc = { .regB = MAX77650_REG_CNFG_SBB1_B, }; -static struct max77650_regulator_desc max77651_SBB1_desc = { +static const struct max77650_regulator_desc max77651_SBB1_desc = { .desc = { .name = "sbb1", .of_match = of_match_ptr("sbb1"), @@ -264,7 +262,7 @@ static struct max77650_regulator_desc max77651_SBB1_desc = { .regB = MAX77650_REG_CNFG_SBB1_B, }; -static struct max77650_regulator_desc max77650_SBB2_desc = { +static const struct max77650_regulator_desc max77650_SBB2_desc = { .desc = { .name = "sbb2", .of_match = of_match_ptr("sbb2"), @@ -294,7 +292,7 @@ static struct max77650_regulator_desc max77650_SBB2_desc = { .regB = MAX77650_REG_CNFG_SBB2_B, }; -static struct max77650_regulator_desc max77651_SBB2_desc = { +static const struct max77650_regulator_desc max77651_SBB2_desc = { .desc = { .name = "sbb2", .of_match = of_match_ptr("sbb2"), @@ -326,8 +324,8 @@ static struct max77650_regulator_desc max77651_SBB2_desc = { static int max77650_regulator_probe(struct platform_device *pdev) { - struct max77650_regulator_desc **rdescs; - struct max77650_regulator_desc *rdesc; + const struct max77650_regulator_desc **rdescs; + const struct max77650_regulator_desc *rdesc; struct regulator_config config = { }; struct device *dev, *parent; struct regulator_dev *rdev; @@ -376,7 +374,6 @@ static int max77650_regulator_probe(struct platform_device *pdev) for (i = 0; i < MAX77650_REGULATOR_NUM_REGULATORS; i++) { rdesc = rdescs[i]; - config.driver_data = rdesc; rdev = devm_regulator_register(dev, &rdesc->desc, &config); if (IS_ERR(rdev))