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: <20120709131318.GE3934@opensource.wolfsonmicro.com>
Date:	Mon, 9 Jul 2012 14:13:18 +0100
From:	Mark Brown <broonie@...nsource.wolfsonmicro.com>
To:	Sangbeom Kim <sbkim73@...sung.com>
Cc:	'Liam Girdwood' <lrg@...com>, sameo@...ux.intel.com,
	linux-kernel@...r.kernel.org, sbkim01@...il.com
Subject: Re: [PATCH V2 5/7] regualtor: s2mps11: Add samsung s2mps11 regulator
 driver

On Sat, Jul 07, 2012 at 06:42:09PM +0900, Sangbeom Kim wrote:

Looks fairly good overall but a lot of this should be able to be
factored out to use the standard regualtor core support for register
maps now.

> +static const struct sec_voltage_desc buck_voltage_val1 = {
> +	.max = 2000000,
> +	.min =  600000,
> +	.step =   6250,
> +};

These should be using regulator_map_voltage_linear().

> +static int s2mps11_reg_is_enabled(struct regulator_dev *rdev)
> +{

This looks like it should be regulator_is_enabled_regmap() and similarly
for the other enable/disable operations.

> +static int s2mps11_get_voltage_sel(struct regulator_dev *rdev)
> +{

regulator_get_voltage_sel_regmap()

> +static int s2mps11_set_voltage(struct regulator_dev *rdev,
> +				int min_uV, int max_uV, unsigned *selector)

Should be set_voltage_sel(), really set_voltage_sel_regmap()

> +static int s2mps11_set_voltage_time_sel(struct regulator_dev *rdev,
> +					     unsigned int old_sel,
> +					     unsigned int new_sel)

regulator_set_voltage_time().

> +static int s2mps11_set_voltage_sel(struct regulator_dev *rdev, unsigned selector)

regulator_set_voltage_sel_regmap()

> +	s2mps11 = devm_kzalloc(&pdev->dev, sizeof(struct s2mps11_info),
> +				GFP_KERNEL);
> +	if (!s2mps11)
> +		return -ENOMEM;
> +
> +	size = sizeof(struct regulator_dev *) * pdata->num_regulators;
> +	s2mps11->rdev = devm_kzalloc(&pdev->dev, size, GFP_KERNEL);
> +	if (!s2mps11->rdev) {
> +		return -ENOMEM;
> +	}

You should register all the regulators unconditionally rather than only
registering the ones in platform data, this allows people to read the
state of the device even if they can't control it.

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

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ