diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2014-01-03 16:48:25 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2014-01-03 16:48:25 -0500 |
commit | 9a2f1aad2f5bf005560c334d6f0aebd82726315b (patch) | |
tree | 20f71f9311db6d8578ab842f7d29b63322ae1f42 | |
parent | 23e8e5901d8c644c1d30d69d207d7f3c90e99e8c (diff) | |
parent | 93353e8088057dd988362e6cae727af43734b494 (diff) |
Merge tag 'for-v3.13-fixes' of git://git.infradead.org/battery-2.6
Pull battery fixes from Anton Vorontsov:
"Two fixes:
- fix build error caused by max17042_battery conversion to the regmap
API.
- fix kernel oops when booting with wakeup_source_activate enabled"
* tag 'for-v3.13-fixes' of git://git.infradead.org/battery-2.6:
max17042_battery: Fix build errors caused by missing REGMAP_I2C config
power_supply: Fix Oops from NULL pointer dereference from wakeup_source_activate
-rw-r--r-- | drivers/power/Kconfig | 1 | ||||
-rw-r--r-- | drivers/power/power_supply_core.c | 12 |
2 files changed, 7 insertions, 6 deletions
diff --git a/drivers/power/Kconfig b/drivers/power/Kconfig index 5e2054afe840..85ad58c6da17 100644 --- a/drivers/power/Kconfig +++ b/drivers/power/Kconfig | |||
@@ -196,6 +196,7 @@ config BATTERY_MAX17040 | |||
196 | config BATTERY_MAX17042 | 196 | config BATTERY_MAX17042 |
197 | tristate "Maxim MAX17042/17047/17050/8997/8966 Fuel Gauge" | 197 | tristate "Maxim MAX17042/17047/17050/8997/8966 Fuel Gauge" |
198 | depends on I2C | 198 | depends on I2C |
199 | select REGMAP_I2C | ||
199 | help | 200 | help |
200 | MAX17042 is fuel-gauge systems for lithium-ion (Li+) batteries | 201 | MAX17042 is fuel-gauge systems for lithium-ion (Li+) batteries |
201 | in handheld and portable equipment. The MAX17042 is configured | 202 | in handheld and portable equipment. The MAX17042 is configured |
diff --git a/drivers/power/power_supply_core.c b/drivers/power/power_supply_core.c index 00e667296360..557af943b2f5 100644 --- a/drivers/power/power_supply_core.c +++ b/drivers/power/power_supply_core.c | |||
@@ -511,6 +511,10 @@ int power_supply_register(struct device *parent, struct power_supply *psy) | |||
511 | dev_set_drvdata(dev, psy); | 511 | dev_set_drvdata(dev, psy); |
512 | psy->dev = dev; | 512 | psy->dev = dev; |
513 | 513 | ||
514 | rc = dev_set_name(dev, "%s", psy->name); | ||
515 | if (rc) | ||
516 | goto dev_set_name_failed; | ||
517 | |||
514 | INIT_WORK(&psy->changed_work, power_supply_changed_work); | 518 | INIT_WORK(&psy->changed_work, power_supply_changed_work); |
515 | 519 | ||
516 | rc = power_supply_check_supplies(psy); | 520 | rc = power_supply_check_supplies(psy); |
@@ -524,10 +528,6 @@ int power_supply_register(struct device *parent, struct power_supply *psy) | |||
524 | if (rc) | 528 | if (rc) |
525 | goto wakeup_init_failed; | 529 | goto wakeup_init_failed; |
526 | 530 | ||
527 | rc = kobject_set_name(&dev->kobj, "%s", psy->name); | ||
528 | if (rc) | ||
529 | goto kobject_set_name_failed; | ||
530 | |||
531 | rc = device_add(dev); | 531 | rc = device_add(dev); |
532 | if (rc) | 532 | if (rc) |
533 | goto device_add_failed; | 533 | goto device_add_failed; |
@@ -553,11 +553,11 @@ create_triggers_failed: | |||
553 | register_cooler_failed: | 553 | register_cooler_failed: |
554 | psy_unregister_thermal(psy); | 554 | psy_unregister_thermal(psy); |
555 | register_thermal_failed: | 555 | register_thermal_failed: |
556 | wakeup_init_failed: | ||
557 | device_del(dev); | 556 | device_del(dev); |
558 | kobject_set_name_failed: | ||
559 | device_add_failed: | 557 | device_add_failed: |
558 | wakeup_init_failed: | ||
560 | check_supplies_failed: | 559 | check_supplies_failed: |
560 | dev_set_name_failed: | ||
561 | put_device(dev); | 561 | put_device(dev); |
562 | success: | 562 | success: |
563 | return rc; | 563 | return rc; |