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] [thread-next>] [day] [month] [year] [list]
Message-ID: <20141027163842.GB20765@earth.universe>
Date:	Mon, 27 Oct 2014 17:38:43 +0100
From:	Sebastian Reichel <sre@...nel.org>
To:	Mike Looijmans <mike.looijmans@...ic.nl>
Cc:	linux-pm@...r.kernel.org, linux-kernel@...r.kernel.org,
	dbaryshkov@...il.com, dwmw2@...radead.org
Subject: Re: [PATCH v4] Add LTC2941/LTC2943 Battery Gauge Driver

Hi,

On Thu, Oct 23, 2014 at 02:38:38PM +0200, Mike Looijmans wrote:
> Both the LTC2941 and LTC2943 measure battery capacity.
> The LTC2943 is compatible with the LTC2941, it adds voltage and
> temperature monitoring, and uses a slightly different conversion
> formula for the charge counter.
> 
> To avoid confusion with e.g. the LTC2945, the driver is called
> LTC2941 instead of LTC294X.
> 
> v2: Fix units of measurement: uV, uA and centidegrees.
> v3: Correctly set configuration register. Allow negative values
>     for the sense resistor.
> v4: Run checkpatch.pl and fix all errors and warnings.
> 
> Signed-off-by: Mike Looijmans <mike.looijmans@...ic.nl>
> ---
> [...]
>
> +	np = of_node_get(client->dev.of_node);
> +
> +	/* r_sense can be negative, when sense+ is connected to the battery
> +	 * instead of the sense-. This results in reversed measurements. */
> +	ret = of_property_read_u32(np, "resistor-sense", &r_sense);
> +	if (ret < 0) {
> +		dev_err(&client->dev,
> +			"Could not find resistor-sense in devicetree\n");
> +		goto fail_name;
> +	}
> +	info->r_sense = r_sense;
> +
> +	ret = of_property_read_u32(np, "prescaler-exponent", &prescaler_exp);
> +	if (ret < 0) {
> +		dev_err(&client->dev,
> +			"PrescalerExponent not in devicetree, assume max\n");
> +		prescaler_exp = LTC2941_MAX_PRESCALER_EXP;
> +	}

The device tree properties are not documented. Please document them
in a separate patch and Cc devicetree binding maintainers.

Apart from that the properties should be vendor prefixed (e.g.
"lltc,resistor-sense").

-- Sebastian

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