From patchwork Mon Sep 9 13:51:18 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Krzysztof Kozlowski X-Patchwork-Id: 13797138 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 6073DECE57A for ; Mon, 9 Sep 2024 14:00:51 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Cc:To:In-Reply-To:References :Message-Id:Content-Transfer-Encoding:Content-Type:MIME-Version:Subject:Date: From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=FndzdmkQ1TyGddm5J1kGgfQG5PZMqaxnpW3JAkHAkvA=; b=DFIckCnnmAeo+XIY8KAGRAvTeo Kn4z0r1203/GDqxnThndHjE1rEdJG/BXI69pcBoDsBrlwFMZX84Ht2SGomhfILqcU9OEiG1XDi+oM w0Cl7DDo+FWdhVfu45j+w1D5yPE6Y3Zzi7Ku8ISk+i9Ec8MSH0xY6WtuwHbMQLoGfbhQLxYlmqPG1 fdTXMEleHuqTEkQsjI8/EtVCiAO3o3od4g6KbVBmc9HYv6jy82ZxjFQ/crc0w0fwF/WUxxRo3fCyD Jh5M+xLH02Y0Wdd24gKtC0SP2zIgjShC4fWXAg1ktZxeepfHInQSjgV/6iwo2Hd+wIwLTcZgP2Xp8 bhljMw7Q==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1snewX-00000002BGR-0mnB; Mon, 09 Sep 2024 14:00:37 +0000 Received: from desiato.infradead.org ([2001:8b0:10b:1:d65d:64ff:fe57:4e05]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1sneo7-000000028gU-0yBN for linux-arm-kernel@bombadil.infradead.org; Mon, 09 Sep 2024 13:51:55 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=desiato.20200630; h=Cc:To:In-Reply-To:References: Message-Id:Content-Transfer-Encoding:Content-Type:MIME-Version:Subject:Date: From:Sender:Reply-To:Content-ID:Content-Description; bh=FndzdmkQ1TyGddm5J1kGgfQG5PZMqaxnpW3JAkHAkvA=; b=TnnwyRYiJDZEmsBrRhtIxsLDUd S7WKOealuGVPY4FA8MbmxFVzDVPflbOzMh0zjK8ASDKLSJYvLB3tlpTVyzAe0cpkAMw+avKgY7A40 NCGT5IbgmSFqw71r7EV0/HSiiC3he4QdCOe74fR4ydE3Bei5tMyWwk4LRTT7ELZGR17xH0OYTeFMS 7YODTxBmIl1tnlUapm4lcaWIlEzTlkDySViLjY0YXGOAjx71eIsUQvNOHLjHCk5eC5dS2ED7CpgOv ytZQPUvkCvZnAawFU0r2i8rZ4XK2rNh0roAevwHof0reH6tXBVJ0BoT4/iIEFSV6V/hN1YR08dQzR EpjHk3uA==; Received: from mail-ed1-x531.google.com ([2a00:1450:4864:20::531]) by desiato.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1sneo3-00000000ReM-3yZf for linux-arm-kernel@lists.infradead.org; Mon, 09 Sep 2024 13:51:53 +0000 Received: by mail-ed1-x531.google.com with SMTP id 4fb4d7f45d1cf-5c26fd60b7bso387056a12.1 for ; Mon, 09 Sep 2024 06:51:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1725889908; x=1726494708; darn=lists.infradead.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=FndzdmkQ1TyGddm5J1kGgfQG5PZMqaxnpW3JAkHAkvA=; b=aIKsaI+iIClWRc1XoeAyA7/et+bCE8XAz6znhxCss5QjfgUYFHSDn9fQ34JDdNdk+U eJVPZAJrUlhE1D4xyDaglS/LYg2WnNDk7SqHmJg5jRqH2bH5xTY6Zak4X6X/uBV9b16r nJSE7lHvdMZGOUo+jyi2IhN932g49yYwOdCNPKq6AVVjCPBrnBcMyg6OTt0pqFHirlI0 4i/ptfvSfIZnmIt9QyJQQKgnbRep2CMvDxO5uVrgcF/FEycxLyqzf8578q+2m/oFS8fm ctLPyj424Fmhx9rD+6Cocryj1T7ES/ubsYrW7ej0KF2aFe71jJtVNIUivJg1cxN0vQgq TtBg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1725889908; x=1726494708; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=FndzdmkQ1TyGddm5J1kGgfQG5PZMqaxnpW3JAkHAkvA=; b=f0kVkJvbs63qBcJZ23U2uaxowgP2aHsyGmNQtHyEUTfldC5kYRoBRmfE23LL3EvFtb 551xyR1BwutNbEVYPQrWeIGxQsPGGE0HpDcAUL9K3MasSgQzA2wheLI7nSaeu+Z/EfLB W3dHHz8NLHMrYa+BPOz5S5OvMnta18bcaA4AbCAyPUe4T66eR6hSnHWyVvJVdAcpk3M2 2lcjeKVFa+KofnuPIEPgI9u1U6rmxbdY6fju0557AfgPLKnYQsv7nC+3tPf7FA3MpNWK 7CQ+vfzytgfT2XitJ8StfZ+UDIjv5tDDGcQt8a+Asny8sB4s4m6mAZ2GAx4PmREE1G0p 4e2g== X-Forwarded-Encrypted: i=1; AJvYcCVAV71VJkp+Y5ajOIvwyhESg76vdnfGykK7ipJTZJbi8nlVADtwQawSngL75arJ7Zz6ceSt+c7ePDFo7tVxsrHx@lists.infradead.org X-Gm-Message-State: AOJu0Yx1KYK7NLyTEZdmhdkPn/poD56v0k7q71WflWjfMaZRKupGVPyk RZ9Olzkbqqb6RD9oNSt8j0xashhcVQmakhlkqmTHf/KJjbbglu48LdIp4ZJrHckRCYQCVLL8lyg R X-Google-Smtp-Source: AGHT+IFey0kfUyFLxagH6WYQeneAlVLduFYs1cyOv+swLVtBUWQ2bTPbM+NQhOdNSq4TWZKivO7V+g== X-Received: by 2002:a17:907:3f87:b0:a8d:2624:1a85 with SMTP id a640c23a62f3a-a8d26242590mr191552266b.12.1725889908199; Mon, 09 Sep 2024 06:51:48 -0700 (PDT) Received: from [127.0.1.1] ([178.197.222.82]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-a8d25cf3ad6sm345344566b.148.2024.09.09.06.51.46 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 09 Sep 2024 06:51:47 -0700 (PDT) From: Krzysztof Kozlowski Date: Mon, 09 Sep 2024 15:51:18 +0200 Subject: [PATCH 07/17] regulator: hi6421v600: Constify static data MIME-Version: 1.0 Message-Id: <20240909-regulator-const-v1-7-8934704a5787@linaro.org> References: <20240909-regulator-const-v1-0-8934704a5787@linaro.org> In-Reply-To: <20240909-regulator-const-v1-0-8934704a5787@linaro.org> To: Support Opensource , Liam Girdwood , Mark Brown , Matthias Brugger , AngeloGioacchino Del Regno , Bartosz Golaszewski Cc: linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org, linux-arm-msm@vger.kernel.org, Krzysztof Kozlowski X-Mailer: b4 0.14.1 X-Developer-Signature: v=1; a=openpgp-sha256; l=2313; i=krzysztof.kozlowski@linaro.org; h=from:subject:message-id; bh=aQxdvJysaJsMuCiXGmuPsUG5zXaAXydDbTeDR80ECyI=; b=owEBbQKS/ZANAwAKAcE3ZuaGi4PXAcsmYgBm3v1eEV9BEYMcFSBw7lfXCzYrANegqqdP0KgLr wLORiBbAs+JAjMEAAEKAB0WIQTd0mIoPREbIztuuKjBN2bmhouD1wUCZt79XgAKCRDBN2bmhouD 1/NGEACM/+upk2qItNXTCceOePEuc0yrqvApHPovnARhqgTaI4wjCEJjM3WbPMEs2it8jbbZY3R GWgKaMlU0NZCMQLdzbK6xCPCY0HAUlP5hXV7Z67Ga6wVt96WZRE3i3UvH5aLubbrFfPdsAdZWxc 9A4DfZDmLK+ex/r4s9ef8DAk2U49qbgi17CR/BLEP0SVqJqNLTiyiLRGcPq24oKifYOQFnpxhAS KtLzPTPMLJFV5UQhgfwbPRBI28xbaJAlPyzqxW98B5cTUSz6Aln73tTlcSF620UGIUyFoKwRury BOep0BgcFjCQdaJJwn+Dq8kp4Eazcf9knQFU9TPu2T7Kwz9aRVGTXA2myWRdgBlJzhjcQWK+mOp j+9qAJ5Kbl+Y1Oy8grzj5aSPTbuo5b1Z79AqfRmD3QFOucMRzqU/OcOtIfVHUUQghwLE+j/asq9 Few4VKtyywvJ0AcvBTNWRK3PrJvu4yNZqkIzoqNSeMV6WYl5ZPKLEu9A+O+R1cILiAE10eaE/Jc inkY3yW1Ccyj1xQxAf+DLVEKSbkpTOSmdlaos8Eh6zLj+JZjsB8Z7LNUgzCvaDqtwC8hRw3H7z5 QLC2PSX21usUhZ+r+2B9ey/R10vItMc/Uwhxzhhkrb0vhzGWcObfrkEyjxtbYij4VEE+YX6NFud nxDwTMTP+ayKivA== X-Developer-Key: i=krzysztof.kozlowski@linaro.org; a=openpgp; fpr=9BD07E0E0C51F8D59677B7541B93437D3B41629B X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240909_145152_093387_3147D2C6 X-CRM114-Status: GOOD ( 14.89 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Driver does not modify static data with regulator description (struct hi6421_spmi_reg_info), so make it const for code safety. Signed-off-by: Krzysztof Kozlowski --- drivers/regulator/hi6421v600-regulator.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/drivers/regulator/hi6421v600-regulator.c b/drivers/regulator/hi6421v600-regulator.c index 4e10daa1e689..e5f6fbfc9016 100644 --- a/drivers/regulator/hi6421v600-regulator.c +++ b/drivers/regulator/hi6421v600-regulator.c @@ -118,7 +118,7 @@ static int hi6421_spmi_regulator_enable(struct regulator_dev *rdev) static unsigned int hi6421_spmi_regulator_get_mode(struct regulator_dev *rdev) { - struct hi6421_spmi_reg_info *sreg; + const struct hi6421_spmi_reg_info *sreg; unsigned int reg_val; sreg = container_of(rdev->desc, struct hi6421_spmi_reg_info, desc); @@ -133,7 +133,7 @@ static unsigned int hi6421_spmi_regulator_get_mode(struct regulator_dev *rdev) static int hi6421_spmi_regulator_set_mode(struct regulator_dev *rdev, unsigned int mode) { - struct hi6421_spmi_reg_info *sreg; + const struct hi6421_spmi_reg_info *sreg; unsigned int val; sreg = container_of(rdev->desc, struct hi6421_spmi_reg_info, desc); @@ -160,7 +160,7 @@ hi6421_spmi_regulator_get_optimum_mode(struct regulator_dev *rdev, int input_uV, int output_uV, int load_uA) { - struct hi6421_spmi_reg_info *sreg; + const struct hi6421_spmi_reg_info *sreg; sreg = container_of(rdev->desc, struct hi6421_spmi_reg_info, desc); @@ -195,7 +195,7 @@ enum hi6421_spmi_regulator_id { hi6421v600_ldo34, }; -static struct hi6421_spmi_reg_info regulator_info[] = { +static const struct hi6421_spmi_reg_info regulator_info[] = { HI6421V600_LDO(ldo3, range_1v5_to_2v0, 0x16, 0x01, 0x51, 20000, 120, @@ -235,7 +235,7 @@ static int hi6421_spmi_regulator_probe(struct platform_device *pdev) struct device *pmic_dev = pdev->dev.parent; struct regulator_config config = { }; struct hi6421_spmi_reg_priv *priv; - struct hi6421_spmi_reg_info *info; + const struct hi6421_spmi_reg_info *info; struct device *dev = &pdev->dev; struct regmap *regmap; struct regulator_dev *rdev;