power: supply: bq2415x: add DT referencing support
authorSebastian Reichel <sebastian.reichel@collabora.co.uk>
Wed, 21 Feb 2018 11:42:20 +0000 (12:42 +0100)
committerSebastian Reichel <sre@kernel.org>
Mon, 12 Mar 2018 13:34:51 +0000 (14:34 +0100)
Add support for using bq2415x together with power_supply_am_i_supplied().

Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.co.uk>
drivers/power/supply/bq2415x_charger.c

index c4770a9..cbec70f 100644 (file)
@@ -1037,7 +1037,10 @@ static int bq2415x_power_supply_init(struct bq2415x_device *bq)
        int ret;
        int chip;
        char revstr[8];
-       struct power_supply_config psy_cfg = { .drv_data = bq, };
+       struct power_supply_config psy_cfg = {
+               .drv_data = bq,
+               .of_node = bq->dev->of_node,
+       };
 
        bq->charger_desc.name = bq->name;
        bq->charger_desc.type = POWER_SUPPLY_TYPE_USB;