max17042: propagate of_node to power supply device

max17042_get_status uses the core power_supply_am_i_supplied. That
function relies on DT properties to figure out the power supply
topology, and will error out without DT.

Fixes max17042 battery status being reported as "unknown".

Signed-off-by: Pierre Bourdon <delroth@google.com>
Signed-off-by: Andre Heider <a.heider@gmail.com>
Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.co.uk>
This commit is contained in:
Pierre Bourdon 2018-02-20 16:03:18 +01:00 коммит произвёл Sebastian Reichel
Родитель 4a9be94055
Коммит 66ec32fc7c
1 изменённых файлов: 1 добавлений и 0 удалений

Просмотреть файл

@ -1053,6 +1053,7 @@ static int max17042_probe(struct i2c_client *client,
i2c_set_clientdata(client, chip);
psy_cfg.drv_data = chip;
psy_cfg.of_node = dev->of_node;
/* When current is not measured,
* CURRENT_NOW and CURRENT_AVG properties should be invisible. */