From: Chanwoo Choi <cw00.choi@samsung.com>
To: Anton Vorontsov <anton.vorontsov@linaro.org>
Cc: jenny.tc@intel.com, ramakrishna.pallala@intel.com,
myungjoo.ham@samsung.com, kyungmin.park@samsung.com,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH 3/5] charger-manager: Add support sysfs entry for charger
Date: Fri, 21 Sep 2012 16:25:39 +0900 [thread overview]
Message-ID: <505C1673.50603@samsung.com> (raw)
In-Reply-To: <20120921051239.GA31443@lizard>
On 09/21/2012 02:12 PM, Anton Vorontsov wrote:
> On Tue, Aug 21, 2012 at 05:06:49PM +0900, Chanwoo Choi wrote:
>> This patch add support sysfs entry for each charger(regulator).
>> Charger-manager use one or more chargers for charging battery but
>> some charger isn't necessary on specific scenario. So, if some charger
>> isn't needed, can disable specific charger through 'externally_control'
>> entry while system is on state and confirm the information(name, state)
>> of charger.
>>
>> the list of added sysfs entry
>> - /sys/class/power_supply/battery/chargers/charger.[index]/name
>> : show name of charger(regulator)
>> - /sys/class/power_supply/battery/chargers/charger.[index]/state
>> : show either enabled or disabled state of charger
>> - /sys/class/power_supply/battery/chargers/charger.[index]/externally_control
>
> The API looks sane.
>
> For the future, you might want to get rid of the 'name', and instead
> just point to a regulator device (via a sysfs symlink). I.e.
>
> /sys/class/power_supply/battery/chargers/charger.[index]/device
> would be a symlink to the regulator device.
>
> But for the time being, I guess it's OK as is (although I wouldn't
> mind if it'll use the symlink from the start. :-)
OK, as your said, I will modify sysfs entry for charger(regulator) by
linking sysfs
of regulator device.
>
> [...]
>> for (j = 0 ; j < charger->num_cables ; j++) {
>> struct charger_cable *cable = &charger->cables[j];
>> @@ -1287,6 +1386,71 @@ static int charger_manager_probe(struct platform_device *pdev)
>> cable->charger = charger;
>> cable->cm = cm;
>> }
>> +
> [...]
>> + charger->attr_g.attrs = charger->attrs;
>> +
>> + sysfs_attr_init(&cable->attr_name.attr);
>
> Notice that 'cable' is declared in the 'for' loop above,
> so this doesn't compile for me:
>
> CHECK drivers/power/charger-manager.c
> drivers/power/charger-manager.c:1559:17: error: undefined identifier 'cable'
> drivers/power/charger-manager.c:1564:17: error: undefined identifier 'cable'
> drivers/power/charger-manager.c:1569:17: error: undefined identifier 'cable'
> CC drivers/power/charger-manager.o
> drivers/power/charger-manager.c: In function ‘charger_manager_probe’:
> drivers/power/charger-manager.c:1559:3: error: ‘cable’ undeclared (first use in this function)
> drivers/power/charger-manager.c:1559:3: note: each undeclared identifier is reported only once for each function it appears in
> make[1]: *** [drivers/power/charger-manager.o] Error 1
>
I will fix it.
> Also:
> - Please adhere to the codingstyle, there should be no spaces
> before ';' in the for loop statement.
> - If possible, please consider splitting _probe routine, it is more
> than 300 lines long nowadays.
>
I resend soon patch which fix build break. As you said, I will modify
sysfs entry
for charger(regulator) by linking sysfs of regulator device and split _probe
routine.
Thanks for your comment.
Best Regards,
Chanwoo Choi
prev parent reply other threads:[~2012-09-21 7:25 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-08-21 8:06 [PATCH 3/5] charger-manager: Add support sysfs entry for charger Chanwoo Choi
2012-09-21 5:12 ` Anton Vorontsov
2012-09-21 7:25 ` Chanwoo Choi [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=505C1673.50603@samsung.com \
--to=cw00.choi@samsung.com \
--cc=anton.vorontsov@linaro.org \
--cc=jenny.tc@intel.com \
--cc=kyungmin.park@samsung.com \
--cc=linux-kernel@vger.kernel.org \
--cc=myungjoo.ham@samsung.com \
--cc=ramakrishna.pallala@intel.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.