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  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Fri, 20 Nov 2020 13:06:07 +0000
From:   Mark Brown <broonie@...nel.org>
To:     Adam Ward <adam.ward@...semi.com>
Cc:     Rob Herring <robh+dt@...nel.org>,
        Liam Girdwood <lgirdwood@...il.com>,
        Vincent Whitchurch <vincent.whitchurch@...s.com>,
        linux-kernel@...r.kernel.org, devicetree@...r.kernel.org
Subject: Re: [PATCH 6/9] regulator: da9121: Update registration to support
 multiple buck variants

On Fri, Nov 20, 2020 at 12:14:56PM +0000, Adam Ward wrote:

> Checks DT matches tally with variant maximum and register accordingly.

This changelog doesn't really explain what the change is supposed to
be doing or why which makes it very hard to review, and the code is far
from obvious.  I can't really tie much of the change to the words here.

> +	if (max_matches > variant_parameters[chip->variant_id].num_bucks) {
> +		dev_err(chip->dev, "Too many regulators in the DT\n");
> +		ret = -EINVAL;
> +		goto error;
> +	}

If this validation is needed it should be in the regulator core.

> +	for (i = 0; i < max_matches; i++) {
> +		const struct regulator_desc *regl_desc =
> +			local_da9121_regulators[chip->variant_id][i];
> +		int id = regl_desc->id;
> +		struct gpio_desc *gpio_ren;
> +
> +		if (chip->pdata->gpiod_ren[i])
> +			gpio_ren = chip->pdata->gpiod_ren[i];
> +		else
> +			gpio_ren = NULL;
> +
> +		config.init_data = chip->pdata->init_data[i];
> +		config.dev = chip->dev;
> +		config.driver_data = chip;
> +		config.regmap = chip->regmap;
> +		config.of_node = chip->pdata->reg_node[i];

I *think* this is all open coding the core's DT parsing support.

Download attachment "signature.asc" of type "application/pgp-signature" (489 bytes)

Powered by blists - more mailing lists