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 for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20170430204407.fmmtdb3yi33dkkks@earth>
Date:   Sun, 30 Apr 2017 22:44:08 +0200
From:   Sebastian Reichel <sre@...nel.org>
To:     Михайлов Алексей Анатольевич <minimumlaw@...bler.ru>
Cc:     linux-kernel@...r.kernel.org, linux-pm@...r.kernel.org,
        zbr@...emap.net
Subject: Re: [PATCH 2/2] Add driver for MAX17211/MAX17215 fuel gauge

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

Download attachment "signature.asc" of type "application/pgp-signature" (834 bytes)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ