From nobody Mon Dec 1 23:02:29 2025 Received: from mx0a-0031df01.pphosted.com (mx0a-0031df01.pphosted.com [205.220.168.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id AD7A43016F4 for ; Wed, 26 Nov 2025 16:59:10 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=205.220.168.131 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1764176352; cv=none; b=c0MG0Ne0pFePFmzKrYJIDgMMBpwSVsyU1e7HjvTiv0kwCqvBJJRUXLecva7KEaa/j/rC+hfe24+LDvkxbXIfKwHgRI1IW49Htj29BQcZqL+UUqkiMkYUPPRZuQBrGfjH2CwvcDPA663/Z9Fieo+S6ryjRzM2SgzNElBOWQVb9KU= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1764176352; c=relaxed/simple; bh=ksdKQZDZf6PSfDQolGcZw2sgxojAWSKaADH0pEqNoMg=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=pk1qgV5kqWu5/TGSD3jBgnCkHOYTWL7EhGDobwEkcXUUg51YeYOxpcPUTgd12gIYB0stVLr0gxamqz+oZFjv6H6RtUDsLd2+s53vl8NPGvE0KYBy0ShMxcIj+guVfMwHro0viEV/Piwb9GaTyqbXqx8nv03OikGFerKTP9Awny4= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=oss.qualcomm.com; spf=pass smtp.mailfrom=oss.qualcomm.com; dkim=pass (2048-bit key) header.d=qualcomm.com header.i=@qualcomm.com header.b=Pn7x4zXy; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b=Ig4xOLnm; arc=none smtp.client-ip=205.220.168.131 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=oss.qualcomm.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=oss.qualcomm.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=qualcomm.com header.i=@qualcomm.com header.b="Pn7x4zXy"; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b="Ig4xOLnm" Received: from pps.filterd (m0279865.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id 5AQBNXrk1849221 for ; Wed, 26 Nov 2025 16:59:10 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=qualcomm.com; h= cc:content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to; s=qcppdkim1; bh= k3JbgWsz0MgrUoNw+KV6VClK/+7GvmHIylTI2s89udk=; b=Pn7x4zXy5QN267Fx phQ+eFB+DXPWMX2zPUyRVMnKXuAkPNQXoWd0RpjRpxGSq1xv0xt9ZgidGi7+/UY6 2Q5lRK4doKzxld3kluq/bfdS33BNiSDRJ9qFMll5TdhWK4AgsIGLqtp2QqpkybJJ uioo39jXj6NvZqw5WqfERoXxP+eMo2v3HaT7Wtyho4V14DxiMrAQtN/kEXYnTm7p uE4DZUaeTzXGxnzkN4aZB7NQgbO4v/OFYrAtEcTN5t57F0L5110thT1twtsDXk2H /9UXPyJ4HTzAtnMpwWwZ62iU/NDVfOR7zsxPYzRCDd+dBhMhkC/CqwBvR9fJ1Rbu fN8Njg== Received: from mail-qt1-f199.google.com (mail-qt1-f199.google.com [209.85.160.199]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 4ap0msrxea-1 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NOT) for ; Wed, 26 Nov 2025 16:59:09 +0000 (GMT) Received: by mail-qt1-f199.google.com with SMTP id d75a77b69052e-4edad69b4e8so33681cf.1 for ; Wed, 26 Nov 2025 08:59:09 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oss.qualcomm.com; s=google; t=1764176349; x=1764781149; 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=k3JbgWsz0MgrUoNw+KV6VClK/+7GvmHIylTI2s89udk=; b=Ig4xOLnmx+EY+fLt+C+wSJctBqzTe5Q5dhLaMAONwLX2nAnSatweAqC8HKiEvmbHTc fxETvoefvFF/liU4uWZjT4c8Ld9XIa8phyUUWdBZKC6ONJIPSl6HeXsKgDcwuxXFzn6W lyZVbuUYMOykPyQz019j1KrU1nq8yco6lciYpwoGDiGDx1OtrhQS7G5rMQ1Zzx5moEL4 sjNqPX02UBmyaT3+b7Y7XeoFAtphBGdefNE+8q5qx0MZswEet0JadQI6/zOlAK4Qynje 9CInebEjd/EvgxMHB8OIBSoRGIeRuRFcyW1wbXtg4UICMWxbsNfX32mSd4D6QZUGi5zn S25A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1764176349; x=1764781149; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-gg:x-gm-message-state:from:to :cc:subject:date:message-id:reply-to; bh=k3JbgWsz0MgrUoNw+KV6VClK/+7GvmHIylTI2s89udk=; b=ust9n0p0SqOI1kYxUR0+ZHOb6Axq/Ob5lgzEdqer3tM2u+4BCG6S7J4ltg5QUmfaBk 7k9IOMdLcf0A0pnhR+JROKjXLMwqJr3X6A/5l9xX28/DwFB6EKfbO9C2/R4w6ts/LdBZ tmotWKsERUQXQPmzPpkVawUSrjGsmJdczFXKWe6QryTlQ/5XAQ2FS2NCYRnTHLHDSm+h vZA9akMaYbJVckMLZJy21DoT6oSuk0K2wi2A3rWTnZnkohW5CWXIs8Y/JkIABrxpM3qY b3HWeLoBQjrtvWUCwXLX5Ee7FDRFPrh0KfINqbgxxGAZA4vpy1iZAuKk6sEEOSc08R85 ryqg== X-Gm-Message-State: AOJu0YzFsuWvytBeiVIfFgyhj5nwQPbyfggFwQrvS05QN8tFuWOB9Uif mRqGQ9WHKHmWMWGjLWvE1Ci4y/JtzQ6CfITFsQoNlDWNW4aEsLxhp8WSpNIEDWyL4V+DqjF7HCG ep5TUEMKUs55fyxvKcjJpsDngqy4NgE6OiMrlXazlIlgk2GskbTHlP9M7WRXI10+caNI= X-Gm-Gg: ASbGncvrBK6rGiCXogbPMLSqf7pi3YVgs9S2lUdp6d7nG+ZEw1Nt2S8+7I+EWFGavZU rGTM0NSkR9m5e9dzg4O1iqHU8Eg2Mbg0Ts+lylwKSxC4TI7xD/KW2HtwiHEdFRNBnjVdn7Bt2UM FWWdreabkEG4us1UhwyaBuzmZDy2lAV5wAkMhHvMB0XA0pNeG3yHrRKEdejIZsSFA4tR6SET2ol /yxY/clcvryoAvVX84jY1LzydIep0CZ7arJO90QyuZ3rLwXWY1bE5F5iqIDcny6PO6TG+ewolnq bCs7ezjl4C6BI0PQvU61vJUYKDjU+gn5NOop3d5sxK4dRCLLvoG32lSZj+r0vmDoLGXe+A0/TDi SkVQBTk2MU0TPs1u7fsI+gs3zNvFVreOS0A== X-Received: by 2002:ac8:7d4b:0:b0:4ee:1bdb:a547 with SMTP id d75a77b69052e-4ee4b44942amr390379891cf.14.1764176348675; Wed, 26 Nov 2025 08:59:08 -0800 (PST) X-Google-Smtp-Source: AGHT+IFXP8xwc6R66Df1B5JWgQH4iuh0Ol81d6xkP0icKm57B55Hsx263/Lx3e/3QyuggROGBRbYXQ== X-Received: by 2002:ac8:7d4b:0:b0:4ee:1bdb:a547 with SMTP id d75a77b69052e-4ee4b44942amr390379201cf.14.1764176348111; Wed, 26 Nov 2025 08:59:08 -0800 (PST) Received: from [127.0.1.1] ([178.197.219.123]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-42cb7fa3a81sm42398811f8f.26.2025.11.26.08.59.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 26 Nov 2025 08:59:07 -0800 (PST) From: Krzysztof Kozlowski Date: Wed, 26 Nov 2025 17:58:44 +0100 Subject: [PATCH 1/8] regulator: Use container_of_const() when all types are const Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20251126-container-of-const-regulator-v1-1-eeec378144d4@oss.qualcomm.com> References: <20251126-container-of-const-regulator-v1-0-eeec378144d4@oss.qualcomm.com> In-Reply-To: <20251126-container-of-const-regulator-v1-0-eeec378144d4@oss.qualcomm.com> To: Liam Girdwood , Mark Brown , Bartosz Golaszewski , Matthias Brugger , AngeloGioacchino Del Regno , Samuel Kayode , Matti Vaittinen Cc: linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org, imx@lists.linux.dev, Krzysztof Kozlowski X-Mailer: b4 0.14.3 X-Developer-Signature: v=1; a=openpgp-sha256; l=10498; i=krzysztof.kozlowski@oss.qualcomm.com; h=from:subject:message-id; bh=ksdKQZDZf6PSfDQolGcZw2sgxojAWSKaADH0pEqNoMg=; b=owEBbQKS/ZANAwAKAcE3ZuaGi4PXAcsmYgBpJzHR9c8eoy/Zb1bCHwTyc/IxD6/8sMI7RPdLr hFw5PxjURyJAjMEAAEKAB0WIQTd0mIoPREbIztuuKjBN2bmhouD1wUCaScx0QAKCRDBN2bmhouD 13A2D/96aVoQBIWlztNXHma1dMqEyrhOjl/nJwqbU4bYXR9p/7cDyCWHzZCzlJanYbCQdHlRsU3 4XJvLpFKn3SvHvuqFc3piKonZ+WomWUZNApZFb/vIlNP+3qKj/mqckQQ6z3OxM16g9XSWstiWvh tJG/ALTOSWZrASQacFCckdNuYkNn8Evw1Y1r3dCyiVTy5VXph/WNp/5faqtO3pkByfVRHf0ST4L 6z4lQL9qo8fRN8JbfqrIsun9Sf+9/57RGVcaKdiKmUwGhOeXTrfjace7hrhenXayDc705KHjpNl vwisst1JR5vYIHCkcmgU1NbnUkMG4q95FKcOS+BV5KHvtg1fSCm79r5EsUGNUFnFYi2WEnydKCZ V+Ns7/irjxSJWscArOxlj9ckOeosuoQYzN6Xf0WOHh2U2wICuXj2hiZr4keTRVjztY9/tNwYbfA y85fBdV7vcJ6flA96dLqBIQHVKKI9BTXFZD3bC/6EuCidR6FqfZFhvHxGequ2cVyghIkTER/exb 3aOHQKGJTOwONquL25xJ0Vd/v8z00tEH8KZg6ObhWKrqkOTUFldmCRLBBF2Xv7bnP/R0AU1IA3e 0GcwJVD/hzuxG/Mhd90sxi+T27+6432JhJ2TEetTwtr01w5+jmENQ/rRiXUedI67uaVyLR2w+8U pdjV8C1PTk32Ymw== X-Developer-Key: i=krzysztof.kozlowski@oss.qualcomm.com; a=openpgp; fpr=9BD07E0E0C51F8D59677B7541B93437D3B41629B X-Proofpoint-GUID: FlkC8DJoI3YdK-qJ1ZyDDncMOeqqw2KB X-Proofpoint-Spam-Details-Enc: AW1haW4tMjUxMTI2MDEzOCBTYWx0ZWRfXy7g8DFFHCsJY fdVepeHITr6sQDO0OTLvKvhyLnm90ufvhY0a52CAiIvunQCjTujASv11/nQ/q4IMjfTfwXOapwN qmm4NK9+JiE+WHyhPIKoe/VjPlkZAr89S0d4uoR26x0tYP3hPYtaqG5pB/+YeYuihhNdLTS7dg0 OI94e0BgovdzTYrHIeC4Lg+cA7iPyfXFsAmsi3k6cSby3hh7KJiRL35nFIBq+khiL3kAeyaBJzJ AkTwjC7tZXllnyDdobMxFYqzcQYzNHZce9VkvKL+CgrL9q3dsDT1i9VmXOUMQHaun/4t+Y4uGcl SpL5qEWPyHq0bjzX5OLwtD1Sgl/cBrsD7lzapSaHbDog2RPJAS8byM5b9u0pJDHZn50t163bGFN SSIP63SjrjCJ6LT/RTY25y2W82pW5Q== X-Authority-Analysis: v=2.4 cv=N5Qk1m9B c=1 sm=1 tr=0 ts=692731dd cx=c_pps a=WeENfcodrlLV9YRTxbY/uA==:117 a=Iax6wTeSMpqzYiZSKl48GQ==:17 a=IkcTkHD0fZMA:10 a=6UeiqGixMTsA:10 a=s4-Qcg_JpJYA:10 a=VkNPw1HP01LnGYTKEx00:22 a=EUspDBNiAAAA:8 a=SzMjVNougZAxKi99s30A:9 a=QEXdDO2ut3YA:10 a=kacYvNCVWA4VmyqE58fU:22 X-Proofpoint-ORIG-GUID: FlkC8DJoI3YdK-qJ1ZyDDncMOeqqw2KB X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1121,Hydra:6.1.9,FMLib:17.12.100.49 definitions=2025-11-25_02,2025-11-26_01,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 phishscore=0 malwarescore=0 lowpriorityscore=0 adultscore=0 spamscore=0 clxscore=1015 bulkscore=0 suspectscore=0 impostorscore=0 priorityscore=1501 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2510240001 definitions=main-2511260138 Use container_of_const(), which is preferred over container_of(), when the argument 'ptr' and returned pointer are already const, for better code safety and readability. Signed-off-by: Krzysztof Kozlowski --- drivers/regulator/hi6421-regulator.c | 10 +++++----- drivers/regulator/hi6421v530-regulator.c | 4 ++-- drivers/regulator/hi6421v600-regulator.c | 6 +++--- drivers/regulator/max77650-regulator.c | 6 +++--- drivers/regulator/mt6315-regulator.c | 6 +++--- drivers/regulator/pf1550-regulator.c | 24 ++++++++++++------------ 6 files changed, 28 insertions(+), 28 deletions(-) diff --git a/drivers/regulator/hi6421-regulator.c b/drivers/regulator/hi642= 1-regulator.c index 69d24728d6a4..cd06030c3587 100644 --- a/drivers/regulator/hi6421-regulator.c +++ b/drivers/regulator/hi6421-regulator.c @@ -387,7 +387,7 @@ static unsigned int hi6421_regulator_ldo_get_mode(struc= t regulator_dev *rdev) const struct hi6421_regulator_info *info; unsigned int reg_val; =20 - info =3D container_of(rdev->desc, struct hi6421_regulator_info, desc); + info =3D container_of_const(rdev->desc, struct hi6421_regulator_info, des= c); regmap_read(rdev->regmap, rdev->desc->enable_reg, ®_val); if (reg_val & info->mode_mask) return REGULATOR_MODE_IDLE; @@ -400,7 +400,7 @@ static unsigned int hi6421_regulator_buck_get_mode(stru= ct regulator_dev *rdev) const struct hi6421_regulator_info *info; unsigned int reg_val; =20 - info =3D container_of(rdev->desc, struct hi6421_regulator_info, desc); + info =3D container_of_const(rdev->desc, struct hi6421_regulator_info, des= c); regmap_read(rdev->regmap, rdev->desc->enable_reg, ®_val); if (reg_val & info->mode_mask) return REGULATOR_MODE_STANDBY; @@ -414,7 +414,7 @@ static int hi6421_regulator_ldo_set_mode(struct regulat= or_dev *rdev, const struct hi6421_regulator_info *info; unsigned int new_mode; =20 - info =3D container_of(rdev->desc, struct hi6421_regulator_info, desc); + info =3D container_of_const(rdev->desc, struct hi6421_regulator_info, des= c); switch (mode) { case REGULATOR_MODE_NORMAL: new_mode =3D 0; @@ -439,7 +439,7 @@ static int hi6421_regulator_buck_set_mode(struct regula= tor_dev *rdev, const struct hi6421_regulator_info *info; unsigned int new_mode; =20 - info =3D container_of(rdev->desc, struct hi6421_regulator_info, desc); + info =3D container_of_const(rdev->desc, struct hi6421_regulator_info, des= c); switch (mode) { case REGULATOR_MODE_NORMAL: new_mode =3D 0; @@ -464,7 +464,7 @@ hi6421_regulator_ldo_get_optimum_mode(struct regulator_= dev *rdev, { const struct hi6421_regulator_info *info; =20 - info =3D container_of(rdev->desc, struct hi6421_regulator_info, desc); + info =3D container_of_const(rdev->desc, struct hi6421_regulator_info, des= c); =20 if (load_uA > info->eco_microamp) return REGULATOR_MODE_NORMAL; diff --git a/drivers/regulator/hi6421v530-regulator.c b/drivers/regulator/h= i6421v530-regulator.c index b3ebd1624814..1822f5daf6ce 100644 --- a/drivers/regulator/hi6421v530-regulator.c +++ b/drivers/regulator/hi6421v530-regulator.c @@ -110,7 +110,7 @@ static unsigned int hi6421v530_regulator_ldo_get_mode( const struct hi6421v530_regulator_info *info; unsigned int reg_val; =20 - info =3D container_of(rdev->desc, struct hi6421v530_regulator_info, rdesc= ); + info =3D container_of_const(rdev->desc, struct hi6421v530_regulator_info,= rdesc); regmap_read(rdev->regmap, rdev->desc->enable_reg, ®_val); =20 if (reg_val & (info->mode_mask)) @@ -125,7 +125,7 @@ static int hi6421v530_regulator_ldo_set_mode(struct reg= ulator_dev *rdev, const struct hi6421v530_regulator_info *info; unsigned int new_mode; =20 - info =3D container_of(rdev->desc, struct hi6421v530_regulator_info, rdesc= ); + info =3D container_of_const(rdev->desc, struct hi6421v530_regulator_info,= rdesc); switch (mode) { case REGULATOR_MODE_NORMAL: new_mode =3D 0; diff --git a/drivers/regulator/hi6421v600-regulator.c b/drivers/regulator/h= i6421v600-regulator.c index e5f6fbfc9016..e7c8bc10cf24 100644 --- a/drivers/regulator/hi6421v600-regulator.c +++ b/drivers/regulator/hi6421v600-regulator.c @@ -121,7 +121,7 @@ static unsigned int hi6421_spmi_regulator_get_mode(stru= ct regulator_dev *rdev) const struct hi6421_spmi_reg_info *sreg; unsigned int reg_val; =20 - sreg =3D container_of(rdev->desc, struct hi6421_spmi_reg_info, desc); + sreg =3D container_of_const(rdev->desc, struct hi6421_spmi_reg_info, desc= ); regmap_read(rdev->regmap, rdev->desc->enable_reg, ®_val); =20 if (reg_val & sreg->eco_mode_mask) @@ -136,7 +136,7 @@ static int hi6421_spmi_regulator_set_mode(struct regula= tor_dev *rdev, const struct hi6421_spmi_reg_info *sreg; unsigned int val; =20 - sreg =3D container_of(rdev->desc, struct hi6421_spmi_reg_info, desc); + sreg =3D container_of_const(rdev->desc, struct hi6421_spmi_reg_info, desc= ); switch (mode) { case REGULATOR_MODE_NORMAL: val =3D 0; @@ -162,7 +162,7 @@ hi6421_spmi_regulator_get_optimum_mode(struct regulator= _dev *rdev, { const struct hi6421_spmi_reg_info *sreg; =20 - sreg =3D container_of(rdev->desc, struct hi6421_spmi_reg_info, desc); + sreg =3D container_of_const(rdev->desc, struct hi6421_spmi_reg_info, desc= ); =20 if (!sreg->eco_uA || ((unsigned int)load_uA > sreg->eco_uA)) return REGULATOR_MODE_NORMAL; diff --git a/drivers/regulator/max77650-regulator.c b/drivers/regulator/max= 77650-regulator.c index 7368f54f046d..a809264c77fc 100644 --- a/drivers/regulator/max77650-regulator.c +++ b/drivers/regulator/max77650-regulator.c @@ -68,7 +68,7 @@ static int max77650_regulator_is_enabled(struct regulator= _dev *rdev) struct regmap *map; int val, rv, en; =20 - rdesc =3D container_of(rdev->desc, struct max77650_regulator_desc, desc); + rdesc =3D container_of_const(rdev->desc, struct max77650_regulator_desc, = desc); map =3D rdev_get_regmap(rdev); =20 rv =3D regmap_read(map, rdesc->regB, &val); @@ -85,7 +85,7 @@ static int max77650_regulator_enable(struct regulator_dev= *rdev) const struct max77650_regulator_desc *rdesc; struct regmap *map; =20 - rdesc =3D container_of(rdev->desc, struct max77650_regulator_desc, desc); + rdesc =3D container_of_const(rdev->desc, struct max77650_regulator_desc, = desc); map =3D rdev_get_regmap(rdev); =20 return regmap_update_bits(map, rdesc->regB, @@ -98,7 +98,7 @@ static int max77650_regulator_disable(struct regulator_de= v *rdev) const struct max77650_regulator_desc *rdesc; struct regmap *map; =20 - rdesc =3D container_of(rdev->desc, struct max77650_regulator_desc, desc); + rdesc =3D container_of_const(rdev->desc, struct max77650_regulator_desc, = desc); map =3D rdev_get_regmap(rdev); =20 return regmap_update_bits(map, rdesc->regB, diff --git a/drivers/regulator/mt6315-regulator.c b/drivers/regulator/mt631= 5-regulator.c index 2608a6652d77..d3f93aae0fc5 100644 --- a/drivers/regulator/mt6315-regulator.c +++ b/drivers/regulator/mt6315-regulator.c @@ -80,7 +80,7 @@ static unsigned int mt6315_regulator_get_mode(struct regu= lator_dev *rdev) int ret, regval; u32 modeset_mask; =20 - info =3D container_of(rdev->desc, struct mt6315_regulator_info, desc); + info =3D container_of_const(rdev->desc, struct mt6315_regulator_info, des= c); modeset_mask =3D init->modeset_mask[rdev_get_id(rdev)]; ret =3D regmap_read(rdev->regmap, MT6315_BUCK_TOP_4PHASE_ANA_CON42, ®v= al); if (ret !=3D 0) { @@ -111,7 +111,7 @@ static int mt6315_regulator_set_mode(struct regulator_d= ev *rdev, int ret, val, curr_mode; u32 modeset_mask; =20 - info =3D container_of(rdev->desc, struct mt6315_regulator_info, desc); + info =3D container_of_const(rdev->desc, struct mt6315_regulator_info, des= c); modeset_mask =3D init->modeset_mask[rdev_get_id(rdev)]; curr_mode =3D mt6315_regulator_get_mode(rdev); switch (mode) { @@ -165,7 +165,7 @@ static int mt6315_get_status(struct regulator_dev *rdev) int ret; u32 regval; =20 - info =3D container_of(rdev->desc, struct mt6315_regulator_info, desc); + info =3D container_of_const(rdev->desc, struct mt6315_regulator_info, des= c); ret =3D regmap_read(rdev->regmap, info->status_reg, ®val); if (ret < 0) { dev_err(&rdev->dev, "Failed to get enable reg: %d\n", ret); diff --git a/drivers/regulator/pf1550-regulator.c b/drivers/regulator/pf155= 0-regulator.c index 904926097738..037b8ec94066 100644 --- a/drivers/regulator/pf1550-regulator.c +++ b/drivers/regulator/pf1550-regulator.c @@ -71,9 +71,9 @@ static int pf1550_set_ramp_delay(struct regulator_dev *rd= ev, int ramp_delay) =20 static int pf1550_set_suspend_enable(struct regulator_dev *rdev) { - const struct pf1550_desc *desc =3D container_of(rdev->desc, - struct pf1550_desc, - desc); + const struct pf1550_desc *desc =3D container_of_const(rdev->desc, + struct pf1550_desc, + desc); unsigned int val =3D desc->stby_enable_mask; =20 return regmap_update_bits(rdev->regmap, desc->stby_enable_reg, @@ -82,9 +82,9 @@ static int pf1550_set_suspend_enable(struct regulator_dev= *rdev) =20 static int pf1550_set_suspend_disable(struct regulator_dev *rdev) { - const struct pf1550_desc *desc =3D container_of(rdev->desc, - struct pf1550_desc, - desc); + const struct pf1550_desc *desc =3D container_of_const(rdev->desc, + struct pf1550_desc, + desc); =20 return regmap_update_bits(rdev->regmap, desc->stby_enable_reg, desc->stby_enable_mask, 0); @@ -93,9 +93,9 @@ static int pf1550_set_suspend_disable(struct regulator_de= v *rdev) static int pf1550_buck_set_table_suspend_voltage(struct regulator_dev *rde= v, int uV) { - const struct pf1550_desc *desc =3D container_of(rdev->desc, - struct pf1550_desc, - desc); + const struct pf1550_desc *desc =3D container_of_const(rdev->desc, + struct pf1550_desc, + desc); int ret; =20 ret =3D regulator_map_voltage_ascend(rdev, uV, uV); @@ -111,9 +111,9 @@ static int pf1550_buck_set_table_suspend_voltage(struct= regulator_dev *rdev, static int pf1550_buck_set_linear_suspend_voltage(struct regulator_dev *rd= ev, int uV) { - const struct pf1550_desc *desc =3D container_of(rdev->desc, - struct pf1550_desc, - desc); + const struct pf1550_desc *desc =3D container_of_const(rdev->desc, + struct pf1550_desc, + desc); int ret; =20 ret =3D regulator_map_voltage_linear(rdev, uV, uV); --=20 2.48.1