lkml.org 
[lkml]   [2020]   [May]   [1]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
SubjectRe: [PATCH v3 02/11] power: charger-manager: don't write through desc->properties
On Fri, May 01, 2020 at 02:38:49PM +0200, Sebastian Reichel wrote:
> Hi,
>
> On Fri, Apr 03, 2020 at 10:20:31PM +0200, Michał Mirosław wrote:
> > psy_desc->properties will become pointer to const. Avoid writing
> > through the pointer to enable constification of the tables elsewhere.
> >
> > Signed-off-by: Michał Mirosław <mirq-linux@rere.qmqm.pl>
> For patches 1-3 I used my version, that I wrote in parallel while
> reviewing a different patch series. It is slightly different, but
> achieves the same goal.

There is a bug in the tree now regarding use of num_properties
in charger-manager. Following patch should fix it.

Best Regards,
Michał Mirosław

diff --git a/drivers/power/supply/charger-manager.c b/drivers/power/supply/charger-manager.c
index a71e2ee81423..2ef53dc1f2fb 100644
--- a/drivers/power/supply/charger-manager.c
+++ b/drivers/power/supply/charger-manager.c
@@ -1740,14 +1740,14 @@ static int charger_manager_probe(struct platform_device *pdev)
}
if (!power_supply_get_property(fuel_gauge,
POWER_SUPPLY_PROP_CHARGE_NOW, &val)) {
- properties[cm->charger_psy_desc.num_properties] =
+ properties[num_properties] =
POWER_SUPPLY_PROP_CHARGE_NOW;
num_properties++;
}
if (!power_supply_get_property(fuel_gauge,
POWER_SUPPLY_PROP_CURRENT_NOW,
&val)) {
- properties[cm->charger_psy_desc.num_properties] =
+ properties[num_properties] =
POWER_SUPPLY_PROP_CURRENT_NOW;
num_properties++;
}
\
 
 \ /
  Last update: 2020-05-01 15:30    [W:0.106 / U:0.024 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site