mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-30 03:27:44 -04:00
power: bq24257: Fix use of uninitialized pointer bq->charger
bq->charger is initialized in bq24257_power_supply_init.
Therefore, bq24257_power_supply_init should be called before the
registration of the IRQ handler bq24257_irq_handler_thread that calls
power_supply_changed(bq->charger).
Signed-off-by: Georges Savoundararadj <[email protected]>
Cc: Aurelien Chanot <[email protected]>
Cc: Andreas Dannenberg <[email protected]>
Cc: Sebastian Reichel <[email protected]>
Cc: David Woodhouse <[email protected]>
Fixes: 2219a93596 ("power_supply: Add TI BQ24257 charger driver")
Signed-off-by: Sebastian Reichel <[email protected]>
This commit is contained in:
parent
9edeaada19
commit
0610735928
1 changed files with 6 additions and 6 deletions
|
|
@ -1068,6 +1068,12 @@ static int bq24257_probe(struct i2c_client *client,
|
|||
return ret;
|
||||
}
|
||||
|
||||
ret = bq24257_power_supply_init(bq);
|
||||
if (ret < 0) {
|
||||
dev_err(dev, "Failed to register power supply\n");
|
||||
return ret;
|
||||
}
|
||||
|
||||
ret = devm_request_threaded_irq(dev, client->irq, NULL,
|
||||
bq24257_irq_handler_thread,
|
||||
IRQF_TRIGGER_FALLING |
|
||||
|
|
@ -1078,12 +1084,6 @@ static int bq24257_probe(struct i2c_client *client,
|
|||
return ret;
|
||||
}
|
||||
|
||||
ret = bq24257_power_supply_init(bq);
|
||||
if (ret < 0) {
|
||||
dev_err(dev, "Failed to register power supply\n");
|
||||
return ret;
|
||||
}
|
||||
|
||||
ret = sysfs_create_group(&bq->charger->dev.kobj, &bq24257_attr_group);
|
||||
if (ret < 0) {
|
||||
dev_err(dev, "Can't create sysfs entries\n");
|
||||
|
|
|
|||
Loading…
Reference in a new issue