From: Krzysztof Kozlowski <krzk@kernel.org>
To: Joan-Na-adi <joan.na.devcode@gmail.com>,
Liam Girdwood <lgirdwood@gmail.com>
Cc: Mark Brown <broonie@kernel.org>, Rob Herring <robh@kernel.org>,
Krzysztof Kozlowski <krzk+dt@kernel.org>,
Conor Dooley <conor+dt@kernel.org>,
linux-kernel@vger.kernel.org, devicetree@vger.kernel.org,
Joan Na <joan.na@analog.com>
Subject: Re: [PATCH v3 2/3] regulator: max77675: Add MAX77675 regulator driver
Date: Tue, 14 Oct 2025 10:17:25 +0200 [thread overview]
Message-ID: <3b220b8b-06b4-4738-8818-6fb4b85e89a8@kernel.org> (raw)
In-Reply-To: <20251014053142.15835-3-joan.na@analog.com>
On 14/10/2025 07:31, Joan-Na-adi wrote:
> From: Joan Na <joan.na@analog.com>
>
> This patch adds support for the Maxim Integrated MAX77675 PMIC regulator.
Please do not use "This commit/patch/change", but imperative mood. See
longer explanation here:
https://elixir.bootlin.com/linux/v6.16/source/Documentation/process/submitting-patches.rst#L94
...
> + config.dev = &client->dev;
> + config.regmap = maxreg->regmap;
> + config.driver_data = maxreg;
> +
> + regulators_np = of_get_child_by_name(client->dev.of_node, "regulators");
Where do you drop this reference?
> + if (!regulators_np) {
> + dev_err(maxreg->dev, "No 'regulators' subnode found in DT\n");
> + return -EINVAL;
> + }
> +
> + for (i = 0; i < MAX77675_ID_NUM_MAX; i++) {
> + const struct regulator_desc *desc = &max77675_regulators[i];
> + struct regulator_dev *rdev;
> + struct device_node *child_np;
> +
> + child_np = of_get_child_by_name(regulators_np, desc->name);
> + if (!child_np) {
> + dev_warn(maxreg->dev, "No DT node for regulator %s\n", desc->name);
> + continue;
> + }
> +
> + config.of_node = child_np;
> +
> + rdev = devm_regulator_register(&client->dev, desc, &config);
Can't you drop child_np reference here?
> + if (IS_ERR(rdev)) {
> + ret = PTR_ERR(rdev);
> + dev_err(maxreg->dev,
> + "Failed to register regulator %d (%s): %d\n",
> + i, desc->name, ret);
> + of_node_put(child_np);
> + return ret;
return dev_err_probe
> + }
> + of_node_put(child_np);
> + }
> +
> + i2c_set_clientdata(client, maxreg);
> +
> + return 0;
> +}
> +
> +static void max77675_regulator_remove(struct i2c_client *client)
> +{
> + /* Nothing to clean up currently */
So drop it, do not add dead code.
> +}
> +
> +static const struct i2c_device_id max77675_i2c_id[] = {
> + { "max77675", 0 },
> + { }
Best regards,
Krzysztof
next prev parent reply other threads:[~2025-10-14 8:17 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-10-14 5:31 [PATCH v3 0/3] MAX77675 regulator driver: Add support for MAX77675 device Joan-Na-adi
2025-10-14 5:31 ` [PATCH v3 1/3] dt-bindings: regulator: Add MAX77675 binding header Joan-Na-adi
2025-10-14 8:09 ` Krzysztof Kozlowski
2025-10-20 10:12 ` Krzysztof Kozlowski
2025-10-14 5:31 ` [PATCH v3 2/3] regulator: max77675: Add MAX77675 regulator driver Joan-Na-adi
2025-10-14 8:17 ` Krzysztof Kozlowski [this message]
2025-10-14 5:31 ` [PATCH v3 3/3] dt-bindings: regulator: Add MAX77675 regulator binding Joan-Na-adi
2025-10-14 8:14 ` Krzysztof Kozlowski
2025-10-14 13:11 ` Mark Brown
2025-10-14 21:54 ` Krzysztof Kozlowski
2025-10-14 22:08 ` Mark Brown
2025-11-06 5:29 ` Joan Na
2025-11-06 7:08 ` Krzysztof Kozlowski
2025-11-07 9:03 ` Joan Na
2025-10-14 16:35 ` Rob Herring (Arm)
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=3b220b8b-06b4-4738-8818-6fb4b85e89a8@kernel.org \
--to=krzk@kernel.org \
--cc=broonie@kernel.org \
--cc=conor+dt@kernel.org \
--cc=devicetree@vger.kernel.org \
--cc=joan.na.devcode@gmail.com \
--cc=joan.na@analog.com \
--cc=krzk+dt@kernel.org \
--cc=lgirdwood@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=robh@kernel.org \
/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;
as well as URLs for NNTP newsgroup(s).