From: Anton Vorontsov <cbouatmailru@gmail.com>
To: Mike Rapoport <mike@compulab.co.il>
Cc: Ryan Mallon <ryan@bluewatersys.com>,
linux-kernel@vger.kernel.org,
Yulia Vilensky <vilensky@compulab.co.il>
Subject: Re: [PATCH] ds2782_battery: add support for ds2786 battery gas gauge
Date: Thu, 22 Apr 2010 11:14:38 +0400 [thread overview]
Message-ID: <20100422071437.GA32489@oksana.dev.rtsoft.ru> (raw)
In-Reply-To: <1271919172-12175-1-git-send-email-mike@compulab.co.il>
Hi,
On Thu, Apr 22, 2010 at 09:52:52AM +0300, Mike Rapoport wrote:
> From: Yulia Vilensky <vilensky@compulab.co.il>
>
> Signed-off-by: Yulia Vilensky <vilensky@compulab.co.il>
> Signed-off-by: Mike Rapoport <mike@compulab.co.il>
> ---
Thanks for the patch, looks good overall. Few comments below.
[...]
> +struct ds278x_battery_ops {
> + int (*get_temp)(struct ds278x_info *info, int *temp);
> + int (*get_current)(struct ds278x_info *info, int *current_uA);
> + int (*get_voltage)(struct ds278x_info *info, int *voltage_uA);
> + int (*get_capacity)(struct ds278x_info *info, int *capacity_uA);
> +
Unneeded empty line.
[...]
>
> - info->battery.name = kasprintf(GFP_KERNEL, "ds2782-%d", num);
> + info->battery.name = kasprintf(GFP_KERNEL, "ds278x-%d", num);
I'm a bit worried about this, as this will change sysfs stuff.
I tend to think that this won't cause any real issues, but just
to be on a safe side, can we change that to
kasprintf(GFP_KERNEL, "%s-%d", client->name, num); ?
> if (!info->battery.name) {
> ret = -ENOMEM;
> goto fail_name;
> @@ -277,7 +399,10 @@ static int ds2782_battery_probe(struct i2c_client *client,
>
> i2c_set_clientdata(client, info);
> info->client = client;
> - ds2782_power_supply_init(&info->battery);
> + info->id = num;
> + info->ops = &ds278x_ops[id->driver_data];
> + info->rsns = *((int *)info->client->dev.platform_data);
Please introduce 'struct ds278x_platform_data {int rsns;};'
for this. Place it into include/linux/ds2782_battery.h.
Thanks!
--
Anton Vorontsov
email: cbouatmailru@gmail.com
irc://irc.freenode.net/bd2
next prev parent reply other threads:[~2010-04-22 7:14 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-04-22 6:52 [PATCH] ds2782_battery: add support for ds2786 battery gas gauge Mike Rapoport
2010-04-22 7:14 ` Anton Vorontsov [this message]
2010-04-22 7:35 ` Mike Rapoport
2010-04-22 21:24 ` Ryan Mallon
2010-04-25 15:33 ` Mike Rapoport
2010-04-25 20:44 ` Ryan Mallon
2010-04-26 10:09 ` Anton Vorontsov
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=20100422071437.GA32489@oksana.dev.rtsoft.ru \
--to=cbouatmailru@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mike@compulab.co.il \
--cc=ryan@bluewatersys.com \
--cc=vilensky@compulab.co.il \
/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.