public inbox for linux-pm@vger.kernel.org
 help / color / mirror / Atom feed
From: Sebastian Reichel <sre@kernel.org>
To: "Михайлов Алексей Анатольевич" <minimumlaw@rambler.ru>
Cc: linux-kernel@vger.kernel.org, linux-pm@vger.kernel.org, zbr@ioremap.net
Subject: Re: [PATCH 2/2] Add driver for MAX17211/MAX17215 fuel gauge
Date: Sun, 30 Apr 2017 22:44:08 +0200	[thread overview]
Message-ID: <20170430204407.fmmtdb3yi33dkkks@earth> (raw)
In-Reply-To: <77d557e3-3ff3-de60-826c-b98937360d8c@rambler.ru>

[-- Attachment #1: Type: text/plain, Size: 2054 bytes --]

Hi,

On Sun, Apr 30, 2017 at 08:32:10PM +0300, Михайлов Алексей Анатольевич wrote:
> > IIRC we already had problems with small THERMAL_NAME_LENGTH before.
> > I suggest to add another patch, that increases THERMAL_NAME_LENGTH
> > (don't forget to Cc/To the thermal subsystem people).
> May be rename "max17211-battery" to "max17211" and remove no_thermal = true?
> This case thermal zone will work again. In current (mainline) kernel all
> drivers "xxxxxx-battery" (like ds2780-battery or ds2760-battery) compiled,
> but not working (not registered). They can start working again without
> thermal zone by adding no_thermal = true or by remove "-battery" from
> platform device name. Alternative limit on THERMAL_NAME_LENGTH may be
> extended.

I think increasing THERMAL_NAME_LENGTH is the right way.

> > > +	info->bat = power_supply_register(&pdev->dev, &info->bat_desc,
> > > +						&psy_cfg);
> > > +	if (IS_ERR(info->bat)) {
> > > +		dev_err(info->dev, "failed to register battery\n");
> > > +		return PTR_ERR(info->bat);
> > > +	}
> > Please use devm_power_supply_register() and drop the remove
> > function.
> Khm... probe/remove paired functions. I can use devm_power_supply_register
> in my code. But all other fuel gauge drivers use classic probe/remove pair.
> Which decision will be more correct?

Most drivers are older than devm_power_supply_register. We already
have a few fuel gauge drivers, which use it, though:

$ git grep devm_power_supply_register | grep "battery" 
88pm860x_battery.c:	info->battery = devm_power_supply_register(&pdev->dev,
da9150-fg.c:	fg->battery = devm_power_supply_register(dev, &fg_desc, NULL);
max17042_battery.c:	chip->battery = devm_power_supply_register(&client->dev, max17042_desc,
max8997_charger.c:	charger->battery = devm_power_supply_register(&pdev->dev,
max8998_charger.c:	max8998->battery = devm_power_supply_register(max8998->dev,
sbs-battery.c:	chip->power_supply = devm_power_supply_register(&client->dev, sbs_desc,

-- Sebastian

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

      reply	other threads:[~2017-04-30 20:44 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20170429143429.5685-1-minimumlaw@rambler.ru>
     [not found] ` <20170429143429.5685-2-minimumlaw@rambler.ru>
2017-04-29 15:59   ` [PATCH 1/2] Add support for OneWire (W1) devices family 0x26 (MAX17211/MAX17215) Sebastian Reichel
2017-04-30  5:21     ` Alex A. Mihaylov
2017-04-30 20:53       ` Sebastian Reichel
2017-05-01  6:13         ` Alex A. Mihaylov
     [not found] ` <20170429143429.5685-3-minimumlaw@rambler.ru>
2017-04-29 16:40   ` [PATCH 2/2] Add driver for MAX17211/MAX17215 fuel gauge Sebastian Reichel
2017-04-30 17:32     ` Михайлов Алексей Анатольевич
2017-04-30 20:44       ` Sebastian Reichel [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=20170430204407.fmmtdb3yi33dkkks@earth \
    --to=sre@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pm@vger.kernel.org \
    --cc=minimumlaw@rambler.ru \
    --cc=zbr@ioremap.net \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox