Power supply class and drivers: remove non obligatory return statements
Per Jeff Garzik request. Signed-off-by: Jeff Garzik <jeff@garzik.org> Signed-off-by: Anton Vorontsov <cbou@mail.ru>
This commit is contained in:
parent
5ebf6e6a96
commit
7b3d54a8c3
|
@ -48,8 +48,6 @@ static void find_main_battery(void)
|
||||||
}
|
}
|
||||||
if (!main_battery)
|
if (!main_battery)
|
||||||
main_battery = batm;
|
main_battery = batm;
|
||||||
|
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static int calculate_time(int status)
|
static int calculate_time(int status)
|
||||||
|
@ -218,7 +216,6 @@ static void apm_battery_apm_get_power_status(struct apm_power_info *info)
|
||||||
}
|
}
|
||||||
|
|
||||||
up(&power_supply_class->sem);
|
up(&power_supply_class->sem);
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static int __init apm_battery_init(void)
|
static int __init apm_battery_init(void)
|
||||||
|
@ -232,7 +229,6 @@ static int __init apm_battery_init(void)
|
||||||
static void __exit apm_battery_exit(void)
|
static void __exit apm_battery_exit(void)
|
||||||
{
|
{
|
||||||
apm_get_power_status = NULL;
|
apm_get_power_status = NULL;
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
module_init(apm_battery_init);
|
module_init(apm_battery_init);
|
||||||
|
|
|
@ -254,8 +254,6 @@ static void ds2760_battery_update_status(struct ds2760_device_info *di)
|
||||||
|
|
||||||
if (di->charge_status != old_charge_status)
|
if (di->charge_status != old_charge_status)
|
||||||
power_supply_changed(&di->bat);
|
power_supply_changed(&di->bat);
|
||||||
|
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void ds2760_battery_work(struct work_struct *work)
|
static void ds2760_battery_work(struct work_struct *work)
|
||||||
|
@ -268,8 +266,6 @@ static void ds2760_battery_work(struct work_struct *work)
|
||||||
|
|
||||||
ds2760_battery_update_status(di);
|
ds2760_battery_update_status(di);
|
||||||
queue_delayed_work(di->monitor_wqueue, &di->monitor_work, interval);
|
queue_delayed_work(di->monitor_wqueue, &di->monitor_work, interval);
|
||||||
|
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#define to_ds2760_device_info(x) container_of((x), struct ds2760_device_info, \
|
#define to_ds2760_device_info(x) container_of((x), struct ds2760_device_info, \
|
||||||
|
@ -283,8 +279,6 @@ static void ds2760_battery_external_power_changed(struct power_supply *psy)
|
||||||
|
|
||||||
cancel_delayed_work(&di->monitor_work);
|
cancel_delayed_work(&di->monitor_work);
|
||||||
queue_delayed_work(di->monitor_wqueue, &di->monitor_work, HZ/10);
|
queue_delayed_work(di->monitor_wqueue, &di->monitor_work, HZ/10);
|
||||||
|
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static int ds2760_battery_get_property(struct power_supply *psy,
|
static int ds2760_battery_get_property(struct power_supply *psy,
|
||||||
|
@ -457,7 +451,6 @@ static int __init ds2760_battery_init(void)
|
||||||
static void __exit ds2760_battery_exit(void)
|
static void __exit ds2760_battery_exit(void)
|
||||||
{
|
{
|
||||||
platform_driver_unregister(&ds2760_battery_driver);
|
platform_driver_unregister(&ds2760_battery_driver);
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
module_init(ds2760_battery_init);
|
module_init(ds2760_battery_init);
|
||||||
|
|
|
@ -341,7 +341,6 @@ static void __exit olpc_bat_exit(void)
|
||||||
power_supply_unregister(&olpc_bat);
|
power_supply_unregister(&olpc_bat);
|
||||||
power_supply_unregister(&olpc_ac);
|
power_supply_unregister(&olpc_ac);
|
||||||
platform_device_unregister(bat_pdev);
|
platform_device_unregister(bat_pdev);
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
module_init(olpc_bat_init);
|
module_init(olpc_bat_init);
|
||||||
|
|
|
@ -97,8 +97,6 @@ static void update_charger(void)
|
||||||
dev_dbg(dev, "charger off\n");
|
dev_dbg(dev, "charger off\n");
|
||||||
pdata->set_charge(0);
|
pdata->set_charge(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void supply_timer_func(unsigned long power_supply_ptr)
|
static void supply_timer_func(unsigned long power_supply_ptr)
|
||||||
|
@ -106,7 +104,6 @@ static void supply_timer_func(unsigned long power_supply_ptr)
|
||||||
void *power_supply = (void *)power_supply_ptr;
|
void *power_supply = (void *)power_supply_ptr;
|
||||||
|
|
||||||
power_supply_changed(power_supply);
|
power_supply_changed(power_supply);
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void charger_timer_func(unsigned long power_supply_ptr)
|
static void charger_timer_func(unsigned long power_supply_ptr)
|
||||||
|
@ -118,7 +115,6 @@ static void charger_timer_func(unsigned long power_supply_ptr)
|
||||||
supply_timer.data = power_supply_ptr;
|
supply_timer.data = power_supply_ptr;
|
||||||
mod_timer(&supply_timer,
|
mod_timer(&supply_timer,
|
||||||
jiffies + msecs_to_jiffies(pdata->wait_for_charger));
|
jiffies + msecs_to_jiffies(pdata->wait_for_charger));
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static irqreturn_t power_changed_isr(int irq, void *power_supply)
|
static irqreturn_t power_changed_isr(int irq, void *power_supply)
|
||||||
|
@ -251,7 +247,6 @@ static int __init pda_power_init(void)
|
||||||
static void __exit pda_power_exit(void)
|
static void __exit pda_power_exit(void)
|
||||||
{
|
{
|
||||||
platform_driver_unregister(&pda_power_pdrv);
|
platform_driver_unregister(&pda_power_pdrv);
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
module_init(pda_power_init);
|
module_init(pda_power_init);
|
||||||
|
|
|
@ -203,8 +203,6 @@ static void __exit pmu_bat_exit(void)
|
||||||
}
|
}
|
||||||
power_supply_unregister(&pmu_ac);
|
power_supply_unregister(&pmu_ac);
|
||||||
platform_device_unregister(bat_pdev);
|
platform_device_unregister(bat_pdev);
|
||||||
|
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
module_init(pmu_bat_init);
|
module_init(pmu_bat_init);
|
||||||
|
|
|
@ -46,8 +46,6 @@ static void power_supply_changed_work(struct work_struct *work)
|
||||||
power_supply_update_leds(psy);
|
power_supply_update_leds(psy);
|
||||||
|
|
||||||
kobject_uevent(&psy->dev->kobj, KOBJ_CHANGE);
|
kobject_uevent(&psy->dev->kobj, KOBJ_CHANGE);
|
||||||
|
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void power_supply_changed(struct power_supply *psy)
|
void power_supply_changed(struct power_supply *psy)
|
||||||
|
@ -55,8 +53,6 @@ void power_supply_changed(struct power_supply *psy)
|
||||||
dev_dbg(psy->dev, "%s\n", __FUNCTION__);
|
dev_dbg(psy->dev, "%s\n", __FUNCTION__);
|
||||||
|
|
||||||
schedule_work(&psy->changed_work);
|
schedule_work(&psy->changed_work);
|
||||||
|
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
int power_supply_am_i_supplied(struct power_supply *psy)
|
int power_supply_am_i_supplied(struct power_supply *psy)
|
||||||
|
@ -129,7 +125,6 @@ void power_supply_unregister(struct power_supply *psy)
|
||||||
power_supply_remove_triggers(psy);
|
power_supply_remove_triggers(psy);
|
||||||
power_supply_remove_attrs(psy);
|
power_supply_remove_attrs(psy);
|
||||||
device_unregister(psy->dev);
|
device_unregister(psy->dev);
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static int __init power_supply_class_init(void)
|
static int __init power_supply_class_init(void)
|
||||||
|
@ -147,7 +142,6 @@ static int __init power_supply_class_init(void)
|
||||||
static void __exit power_supply_class_exit(void)
|
static void __exit power_supply_class_exit(void)
|
||||||
{
|
{
|
||||||
class_destroy(power_supply_class);
|
class_destroy(power_supply_class);
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
EXPORT_SYMBOL_GPL(power_supply_changed);
|
EXPORT_SYMBOL_GPL(power_supply_changed);
|
||||||
|
|
|
@ -40,8 +40,6 @@ static void power_supply_update_bat_leds(struct power_supply *psy)
|
||||||
led_trigger_event(psy->full_trig, LED_OFF);
|
led_trigger_event(psy->full_trig, LED_OFF);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static int power_supply_create_bat_triggers(struct power_supply *psy)
|
static int power_supply_create_bat_triggers(struct power_supply *psy)
|
||||||
|
@ -97,7 +95,6 @@ static void power_supply_remove_bat_triggers(struct power_supply *psy)
|
||||||
kfree(psy->full_trig_name);
|
kfree(psy->full_trig_name);
|
||||||
kfree(psy->charging_trig_name);
|
kfree(psy->charging_trig_name);
|
||||||
kfree(psy->charging_full_trig_name);
|
kfree(psy->charging_full_trig_name);
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Generated power specific LEDs triggers. */
|
/* Generated power specific LEDs triggers. */
|
||||||
|
@ -115,8 +112,6 @@ static void power_supply_update_gen_leds(struct power_supply *psy)
|
||||||
led_trigger_event(psy->online_trig, LED_FULL);
|
led_trigger_event(psy->online_trig, LED_FULL);
|
||||||
else
|
else
|
||||||
led_trigger_event(psy->online_trig, LED_OFF);
|
led_trigger_event(psy->online_trig, LED_OFF);
|
||||||
|
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static int power_supply_create_gen_triggers(struct power_supply *psy)
|
static int power_supply_create_gen_triggers(struct power_supply *psy)
|
||||||
|
@ -145,7 +140,6 @@ static void power_supply_remove_gen_triggers(struct power_supply *psy)
|
||||||
{
|
{
|
||||||
led_trigger_unregister_simple(psy->online_trig);
|
led_trigger_unregister_simple(psy->online_trig);
|
||||||
kfree(psy->online_trig_name);
|
kfree(psy->online_trig_name);
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Choice what triggers to create&update. */
|
/* Choice what triggers to create&update. */
|
||||||
|
@ -156,7 +150,6 @@ void power_supply_update_leds(struct power_supply *psy)
|
||||||
power_supply_update_bat_leds(psy);
|
power_supply_update_bat_leds(psy);
|
||||||
else
|
else
|
||||||
power_supply_update_gen_leds(psy);
|
power_supply_update_gen_leds(psy);
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
int power_supply_create_triggers(struct power_supply *psy)
|
int power_supply_create_triggers(struct power_supply *psy)
|
||||||
|
@ -172,5 +165,4 @@ void power_supply_remove_triggers(struct power_supply *psy)
|
||||||
power_supply_remove_bat_triggers(psy);
|
power_supply_remove_bat_triggers(psy);
|
||||||
else
|
else
|
||||||
power_supply_remove_gen_triggers(psy);
|
power_supply_remove_gen_triggers(psy);
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -176,8 +176,6 @@ void power_supply_remove_attrs(struct power_supply *psy)
|
||||||
for (i = 0; i < psy->num_properties; i++)
|
for (i = 0; i < psy->num_properties; i++)
|
||||||
device_remove_file(psy->dev,
|
device_remove_file(psy->dev,
|
||||||
&power_supply_attrs[psy->properties[i]]);
|
&power_supply_attrs[psy->properties[i]]);
|
||||||
|
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static char *kstruprdup(const char *str, gfp_t gfp)
|
static char *kstruprdup(const char *str, gfp_t gfp)
|
||||||
|
|
|
@ -121,8 +121,6 @@ static void release_bat_id(int id)
|
||||||
mutex_lock(&bat_idr_lock);
|
mutex_lock(&bat_idr_lock);
|
||||||
idr_remove(&bat_idr, id);
|
idr_remove(&bat_idr, id);
|
||||||
mutex_unlock(&bat_idr_lock);
|
mutex_unlock(&bat_idr_lock);
|
||||||
|
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static int w1_ds2760_add_slave(struct w1_slave *sl)
|
static int w1_ds2760_add_slave(struct w1_slave *sl)
|
||||||
|
@ -174,8 +172,6 @@ static void w1_ds2760_remove_slave(struct w1_slave *sl)
|
||||||
platform_device_unregister(pdev);
|
platform_device_unregister(pdev);
|
||||||
release_bat_id(id);
|
release_bat_id(id);
|
||||||
sysfs_remove_bin_file(&sl->dev.kobj, &w1_ds2760_bin_attr);
|
sysfs_remove_bin_file(&sl->dev.kobj, &w1_ds2760_bin_attr);
|
||||||
|
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static struct w1_family_ops w1_ds2760_fops = {
|
static struct w1_family_ops w1_ds2760_fops = {
|
||||||
|
|
Loading…
Reference in New Issue