lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <3b220b8b-06b4-4738-8818-6fb4b85e89a8@kernel.org>
Date: Tue, 14 Oct 2025 10:17:25 +0200
From: Krzysztof Kozlowski <krzk@...nel.org>
To: Joan-Na-adi <joan.na.devcode@...il.com>,
 Liam Girdwood <lgirdwood@...il.com>
Cc: Mark Brown <broonie@...nel.org>, Rob Herring <robh@...nel.org>,
 Krzysztof Kozlowski <krzk+dt@...nel.org>, Conor Dooley
 <conor+dt@...nel.org>, linux-kernel@...r.kernel.org,
 devicetree@...r.kernel.org, Joan Na <joan.na@...log.com>
Subject: Re: [PATCH v3 2/3] regulator: max77675: Add MAX77675 regulator driver

On 14/10/2025 07:31, Joan-Na-adi wrote:
> From: Joan Na <joan.na@...log.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

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ