Update driver code to fix indenting...
The Editor tried to make changes for me...
This commit is contained in:
@@ -268,10 +268,12 @@ static int check_battery_state( struct i2c_client *client )
|
||||
int SOCPercent;
|
||||
|
||||
SOCPercent = i2c_smbus_read_byte_data( client, SOC_HIGH_REG );
|
||||
if( SOCPercent > 100 )
|
||||
if( SOCPercent > 100 ){
|
||||
SOCPercent = 100;
|
||||
if( SOCPercent < 0 )
|
||||
}
|
||||
if( SOCPercent < 0 ){
|
||||
SOCPercent = 0;
|
||||
}
|
||||
|
||||
if( battery.capacity != SOCPercent ){
|
||||
battery.capacity = SOCPercent;
|
||||
@@ -290,10 +292,9 @@ static int check_battery_state( struct i2c_client *client )
|
||||
// plugged in.
|
||||
//
|
||||
static void shutdown_helper( void ){
|
||||
static char * shutdown_argv[] =
|
||||
{ "/sbin/shutdown", "-h", "-P", "now", NULL };
|
||||
call_usermodehelper(shutdown_argv[0], shutdown_argv, NULL, UMH_NO_WAIT);
|
||||
static char * shutdown_argv[] ={ "/sbin/shutdown", "-h", "-P", "now", NULL };
|
||||
|
||||
call_usermodehelper(shutdown_argv[0], shutdown_argv, NULL, UMH_NO_WAIT);
|
||||
}
|
||||
|
||||
//
|
||||
@@ -595,14 +596,16 @@ static void __exit oneup_power_exit(void)
|
||||
ac_online = 0;
|
||||
battery.status = POWER_SUPPLY_STATUS_DISCHARGING;
|
||||
|
||||
for (i = 0; i < ARRAY_SIZE(power_supplies); i++)
|
||||
for (i = 0; i < ARRAY_SIZE(power_supplies); i++){
|
||||
power_supply_changed(power_supplies[i]);
|
||||
}
|
||||
|
||||
//PR_INFO("%s: 'changed' event sent, sleeping for 10 seconds...\n", __func__);
|
||||
//ssleep(10);
|
||||
|
||||
for (i = 0; i < ARRAY_SIZE(power_supplies); i++)
|
||||
for (i = 0; i < ARRAY_SIZE(power_supplies); i++){
|
||||
power_supply_unregister(power_supplies[i]);
|
||||
}
|
||||
|
||||
module_initialized = false;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user