提交 9a2f1aad 编写于 作者: L Linus Torvalds

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
...@@ -196,6 +196,7 @@ config BATTERY_MAX17040 ...@@ -196,6 +196,7 @@ config BATTERY_MAX17040
config BATTERY_MAX17042 config BATTERY_MAX17042
tristate "Maxim MAX17042/17047/17050/8997/8966 Fuel Gauge" tristate "Maxim MAX17042/17047/17050/8997/8966 Fuel Gauge"
depends on I2C depends on I2C
select REGMAP_I2C
help help
MAX17042 is fuel-gauge systems for lithium-ion (Li+) batteries MAX17042 is fuel-gauge systems for lithium-ion (Li+) batteries
in handheld and portable equipment. The MAX17042 is configured in handheld and portable equipment. The MAX17042 is configured
......
...@@ -511,6 +511,10 @@ int power_supply_register(struct device *parent, struct power_supply *psy) ...@@ -511,6 +511,10 @@ int power_supply_register(struct device *parent, struct power_supply *psy)
dev_set_drvdata(dev, psy); dev_set_drvdata(dev, psy);
psy->dev = dev; psy->dev = dev;
rc = dev_set_name(dev, "%s", psy->name);
if (rc)
goto dev_set_name_failed;
INIT_WORK(&psy->changed_work, power_supply_changed_work); INIT_WORK(&psy->changed_work, power_supply_changed_work);
rc = power_supply_check_supplies(psy); rc = power_supply_check_supplies(psy);
...@@ -524,10 +528,6 @@ int power_supply_register(struct device *parent, struct power_supply *psy) ...@@ -524,10 +528,6 @@ int power_supply_register(struct device *parent, struct power_supply *psy)
if (rc) if (rc)
goto wakeup_init_failed; goto wakeup_init_failed;
rc = kobject_set_name(&dev->kobj, "%s", psy->name);
if (rc)
goto kobject_set_name_failed;
rc = device_add(dev); rc = device_add(dev);
if (rc) if (rc)
goto device_add_failed; goto device_add_failed;
...@@ -553,11 +553,11 @@ int power_supply_register(struct device *parent, struct power_supply *psy) ...@@ -553,11 +553,11 @@ int power_supply_register(struct device *parent, struct power_supply *psy)
register_cooler_failed: register_cooler_failed:
psy_unregister_thermal(psy); psy_unregister_thermal(psy);
register_thermal_failed: register_thermal_failed:
wakeup_init_failed:
device_del(dev); device_del(dev);
kobject_set_name_failed:
device_add_failed: device_add_failed:
wakeup_init_failed:
check_supplies_failed: check_supplies_failed:
dev_set_name_failed:
put_device(dev); put_device(dev);
success: success:
return rc; return rc;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册