Devicetree
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Duje Mihanović" <dujemihanovic32@gmail.com>
Cc: conor+dt@kernel.org, devicetree@vger.kernel.org, robh@kernel.org
Subject: Re: [PATCH 3/3] regulator: 88pm886: Add Vbus regulator
Date: Tue, 26 May 2026 20:02:42 +0000	[thread overview]
Message-ID: <20260526200242.8B5A71F000E9@smtp.kernel.org> (raw)
In-Reply-To: <20260526-88pm886-vbus-v1-3-f2bd1fd3c19e@dujemihanovic.xyz>

Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [Low] The newly introduced `pm886_vbus_regulator` structure contains function pointers but is allocated in read-write memory instead of read-only memory.
--

commit 133b6ca9034767cb2bdba63244660bc0872522af
Author: Duje Mihanović <duje@dujemihanovic.xyz>

regulator: 88pm886: Add Vbus regulator

This commit adds support for the PMIC's Vbus regulator to the 88pm886
driver. This regulator is mandatory for USB OTG support on boards using
this PMIC.

> diff --git a/drivers/regulator/88pm886-regulator.c b/drivers/regulator/88pm886-regulator.c
> index a38bd4f312b72..039822e86ec87 100644
> --- a/drivers/regulator/88pm886-regulator.c
> +++ b/drivers/regulator/88pm886-regulator.c
[ ... ]
> @@ -337,6 +338,25 @@ static struct regulator_desc pm886_regulators[] = {
>  	},
>  };
>  
> +static const struct linear_range pm886_vbus_volt_ranges[] = {
> +	REGULATOR_LINEAR_RANGE(3750000, 0, 7, 250000)
> +};
> +
> +static struct regulator_desc pm886_vbus_regulator = {

[Severity: Low]
This isn't a bug, but should this pm886_vbus_regulator structure be declared
as const so it is placed in read-only memory?

While the existing pm886_regulators array also lacks the const qualifier,
making this change would require updating the local rdesc pointer in
pm886_regulator_probe to be a const struct regulator_desc pointer.

> +	.name = "vbus",
> +	.regulators_node = "regulators",
> +	.of_match = "vbus",
> +	.ops = &pm886_buck_ops,
> +	.type = REGULATOR_VOLTAGE,
> +	.n_voltages = 8,
> +	.linear_ranges = pm886_vbus_volt_ranges,
> +	.n_linear_ranges = ARRAY_SIZE(pm886_vbus_volt_ranges),
> +	.vsel_reg = PM886_REG_BOOST_CONFIG1,
> +	.vsel_mask = PM886_REG_BOOST_MASK,
> +	.enable_reg = PM886_REG_BATTERY_CONFIG1,
> +	.enable_mask = PM886_REG_VBUS_EN,
> +};

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20260526-88pm886-vbus-v1-0-f2bd1fd3c19e@dujemihanovic.xyz?part=3

  reply	other threads:[~2026-05-26 20:02 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-05-26 19:14 [PATCH 0/3] 88PM886 Vbus regulator support Duje Mihanović
2026-05-26 19:14 ` [PATCH 1/3] dt-bindings: mfd: 88pm886: Allow vbus regulator Duje Mihanović
2026-05-27 15:05   ` Conor Dooley
2026-06-07 11:03   ` Karel Balej
2026-05-26 19:14 ` [PATCH 2/3] mfd: 88pm886: Initialize battery page Duje Mihanović
2026-06-07 10:19   ` Karel Balej
2026-06-07 14:19     ` Duje Mihanović
2026-05-26 19:14 ` [PATCH 3/3] regulator: 88pm886: Add Vbus regulator Duje Mihanović
2026-05-26 20:02   ` sashiko-bot [this message]
2026-06-07 10:44   ` Karel Balej
2026-06-07 14:02     ` Duje Mihanović

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20260526200242.8B5A71F000E9@smtp.kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=conor+dt@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=dujemihanovic32@gmail.com \
    --cc=robh@kernel.org \
    --cc=sashiko-reviews@lists.linux.dev \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox