Update driver code to fix indenting...

The Editor tried to make changes for me...
This commit is contained in:
Jeff Curless
2025-12-30 18:09:46 -05:00
parent 990f4cfdf7
commit 7839828b34

View File

@@ -268,10 +268,12 @@ static int check_battery_state( struct i2c_client *client )
int SOCPercent; int SOCPercent;
SOCPercent = i2c_smbus_read_byte_data( client, SOC_HIGH_REG ); SOCPercent = i2c_smbus_read_byte_data( client, SOC_HIGH_REG );
if( SOCPercent > 100 ) if( SOCPercent > 100 ){
SOCPercent = 100; SOCPercent = 100;
if( SOCPercent < 0 ) }
if( SOCPercent < 0 ){
SOCPercent = 0; SOCPercent = 0;
}
if( battery.capacity != SOCPercent ){ if( battery.capacity != SOCPercent ){
battery.capacity = SOCPercent; battery.capacity = SOCPercent;
@@ -290,10 +292,9 @@ static int check_battery_state( struct i2c_client *client )
// plugged in. // plugged in.
// //
static void shutdown_helper( void ){ static void shutdown_helper( void ){
static char * shutdown_argv[] = static char * shutdown_argv[] ={ "/sbin/shutdown", "-h", "-P", "now", NULL };
{ "/sbin/shutdown", "-h", "-P", "now", NULL };
call_usermodehelper(shutdown_argv[0], shutdown_argv, NULL, UMH_NO_WAIT);
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; ac_online = 0;
battery.status = POWER_SUPPLY_STATUS_DISCHARGING; 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]); power_supply_changed(power_supplies[i]);
}
//PR_INFO("%s: 'changed' event sent, sleeping for 10 seconds...\n", __func__); //PR_INFO("%s: 'changed' event sent, sleeping for 10 seconds...\n", __func__);
//ssleep(10); //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]); power_supply_unregister(power_supplies[i]);
}
module_initialized = false; module_initialized = false;
} }