Devicetree
 help / color / mirror / Atom feed
From: "Uwe Kleine-König" <u.kleine-koenig@baylibre.com>
To: "Otto Pflüger" <otto.pflueger@abscue.de>
Cc: Liam Girdwood <lgirdwood@gmail.com>,
	Mark Brown <broonie@kernel.org>,  Rob Herring <robh@kernel.org>,
	Krzysztof Kozlowski <krzk+dt@kernel.org>,
	 Conor Dooley <conor+dt@kernel.org>,
	Orson Zhai <orsonzhai@gmail.com>,
	 Baolin Wang <baolin.wang@linux.alibaba.com>,
	Chunyan Zhang <zhang.lyra@gmail.com>, Lee Jones <lee@kernel.org>,
	 linux-kernel@vger.kernel.org, devicetree@vger.kernel.org,
	 Zhongfa Wang <zhongfa.wang@unisoc.com>
Subject: Re: [PATCH v5 3/3] regulator: Add regulator driver for Unisoc SC2730 PMIC
Date: Fri, 19 Jun 2026 15:42:48 +0200	[thread overview]
Message-ID: <ajVGtio2YdwGpZb7@monoceros> (raw)
In-Reply-To: <20260619-sc2730-regulators-v5-3-0a24c7ed7a97@abscue.de>

[-- Attachment #1: Type: text/plain, Size: 1436 bytes --]

Hello Otto,

On Fri, Jun 19, 2026 at 01:41:49PM +0200, Otto Pflüger wrote:
> +static int sc2730_regulator_probe(struct platform_device *pdev)
> +{
> +	int i, ret;
> +	struct regmap *regmap;
> +	struct regulator_config config = { };
> +	struct regulator_dev *rdev;
> +
> +	regmap = dev_get_regmap(pdev->dev.parent, NULL);
> +	if (!regmap) {
> +		dev_err(&pdev->dev, "failed to get regmap.\n");
> +		return -ENODEV;
> +	}
> +
> +	ret = sc2730_regulator_unlock(regmap);
> +	if (ret) {
> +		dev_err(&pdev->dev, "failed to release regulator lock\n");
> +		return ret;
> +	}

This can be shortend (and improved) to:

	if (ret)
		return dev_err_probe(&pdev->dev, ret, "failed to release regulator lock\n");

ditto for the other error messages in .probe().

> +
> +	config.dev = pdev->dev.parent;
> +	config.regmap = regmap;
> +
> +	for (i = 0; i < ARRAY_SIZE(regulators); i++) {
> +		rdev = devm_regulator_register(&pdev->dev, &regulators[i], &config);
> +		if (IS_ERR(rdev)) {
> +			dev_err(&pdev->dev, "failed to register regulator %s\n",
> +				regulators[i].name);
> +			return PTR_ERR(rdev);
> +		}
> +	}
> +
> +	return 0;
> +}
> +
> +static const struct platform_device_id sc2730_regulator_id_table[] = {
> +	{ "sc2730-regulator" },

Please make this

	{ .name = "sc2730-regulator" },

> +	{ }
> +};
> +MODULE_DEVICE_TABLE(platform, sc2730_regulator_id_table);

Best regards
Uwe

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

      reply	other threads:[~2026-06-19 13:42 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-06-19 11:41 [PATCH v5 0/3] regulator: Add support for Unisoc SC2730 PMIC regulators Otto Pflüger
2026-06-19 11:41 ` [PATCH v5 1/3] regulator: dt-bindings: Add Unisoc SC2730 PMIC Otto Pflüger
2026-06-19 11:41 ` [PATCH v5 2/3] mfd: sprd-sc27xx: Add SC2730 regulator cell Otto Pflüger
2026-06-19 11:41 ` [PATCH v5 3/3] regulator: Add regulator driver for Unisoc SC2730 PMIC Otto Pflüger
2026-06-19 13:42   ` Uwe Kleine-König [this message]

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=ajVGtio2YdwGpZb7@monoceros \
    --to=u.kleine-koenig@baylibre.com \
    --cc=baolin.wang@linux.alibaba.com \
    --cc=broonie@kernel.org \
    --cc=conor+dt@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=krzk+dt@kernel.org \
    --cc=lee@kernel.org \
    --cc=lgirdwood@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=orsonzhai@gmail.com \
    --cc=otto.pflueger@abscue.de \
    --cc=robh@kernel.org \
    --cc=zhang.lyra@gmail.com \
    --cc=zhongfa.wang@unisoc.com \
    /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