lkml.org 
[lkml]   [2013]   [Feb]   [4]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 12/73] regulator: core: Show consumers that hold a regulator in Sysfs
On Mon, Feb 04, 2013 at 11:53:27AM +0000, Lee Jones wrote:

> + int use;

Better to call it use_count like the other use_count.

> + list_for_each_entry(reg, &rdev->consumer_list, list) {
> + if (!reg->use)
> + continue;
> +
> + if (reg->dev != NULL)
> + size += sprintf((buf + size), "%s (%d) ",
> + dev_name(reg->dev), reg->use);
> + else
> + size += sprintf((buf + size), "unknown (%d) ",
> + reg->use);

Should really check we don't go over PAGE_SIZE, and since this isn't a
simple value it should go in debugfs (a simple count would be OK in
sysfs, I'd suggest adding both).

> if (ret != 0 && rdev->supply)
> regulator_disable(rdev->supply);
> + else
> + regulator->use++;

This will increase the usage count in the case where we get an error but
don't have a parent supply.
[unhandled content-type:application/pgp-signature]
\
 
 \ /
  Last update: 2013-02-04 22:04    [W:0.366 / U:0.368 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site