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]
Date:	Sun, 17 Aug 2014 09:06:28 -0500
From:	Mark Brown <broonie@...nel.org>
To:	Chris Zhong <zyw@...k-chips.com>
Cc:	robh+dt@...nel.org, pawel.moll@....com, mark.rutland@....com,
	ijc+devicetree@...lion.org.uk, galak@...eaurora.org,
	sameo@...ux.intel.com, lee.jones@...aro.org, lgirdwood@...il.com,
	a.zummo@...ertech.it, devicetree@...r.kernel.org,
	linux-kernel@...r.kernel.org, rtc-linux@...glegroups.com,
	grant.likely@...aro.org, hl@...k-chips.com,
	huangtao@...k-chips.com, cf@...k-chips.com,
	zhangqing@...k-chips.com, xxx@...k-chips.com,
	dianders@...omium.org, heiko@...ech.de, olof@...om.net,
	sonnyrao@...omium.org, dtor@...omium.org,
	javier.martinez@...labora.co.uk, kever.yang@...k-chips.com
Subject: Re: [PATCH 3/4] RK808: Add rk808 regulator driver

On Sun, Aug 17, 2014 at 10:00:39AM +0800, Chris Zhong wrote:
> The regulator module consists of 4 DCDCs, 8 LDOs and 2 switches.
> The output voltages are configurable and are meant to supply power
> to the main processor and other components

Looks very good - a few small nits below but otherwise fine.  Please use
subject lines matching the style for the subsystem (regulator: in this
case).

> +	reg_np = of_find_node_by_name(np, "regulators");
> +	if (!reg_np)
> +		return -ENXIO;

This needs to be find_child_by_name() otherwise it'll search the entire
device tree and might match other regulators in the system.

> +	count = of_regulator_match(rk808->dev, reg_np, rk808_reg_matches,
> +				   rk808_NUM_REGULATORS);

Should really use RK808_NUM_REGULATORS as the name of the constant -
defines are always upper case.

> +	pdata = rk808->pdata;
> +	if (!pdata) {
> +		dev_err(rk808->dev, "%s no pdata\n", __func__);
> +		return -ENODEV;
> +	}

Missing platform data should be fine for a regulator driver, it should
be able to start up and let the user read back how the device is
configured.

> +		if (reg_data->constraints.name)
> +			rail_name = reg_data->constraints.name;
> +		else
> +			rail_name = rk808_reg[i].name;

Don't do this, just use the rk808_reg name - the regulator core will
take care of applying the name from the constraints.

> +		reg_data->supply_regulator = rail_name;

This should be fixed in the driver, it should be whatever the name the
device uses for the supply in the datasheet.

> +		rk808_rdev = regulator_register(&rk808_reg[i], &config);
> +		if (IS_ERR(rk808_rdev)) {

devm_regulator_register() and then you don't need to clean up on
removal.

> +MODULE_DESCRIPTION("regulator driver for the rk808 series PMICs");
> +MODULE_AUTHOR("Chris Zhong<zyw@...k-chips.com>");
> +MODULE_AUTHOR("Zhang Qing<zhanqging@...k-chips.com>");

Should have a space before the < here.

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

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ