if ((sharpsl_ac_check() < 0) || (sharpsl_check_battery(1) < 0)) 
if ((sharpsl_ac_check() < 0) || (sharpsl_check_battery_temp() < 0)) 
static int sharpsl_off_charge_battery(void){	int time;	dev_dbg(sharpsl_pm.dev, "Charge Mode: %d\n", sharpsl_pm.charge_mode);	if (sharpsl_pm.charge_mode == CHRG_OFF) {		dev_dbg(sharpsl_pm.dev, "Offline Charger: Step 1\n");		/* AC Check */		if ((sharpsl_ac_check() < 0) || (sharpsl_check_battery(1) < 0))			return sharpsl_off_charge_error();		/* Start Charging */		CHARGE_LED_ON();		CHARGE_OFF();		mdelay(SHARPSL_CHARGE_WAIT_TIME);		CHARGE_ON();		sharpsl_pm.charge_mode = CHRG_ON;		sharpsl_pm.full_count = 0;		return 1;	} else if (sharpsl_pm.charge_mode != CHRG_ON) {		return 1;	}	if (sharpsl_pm.full_count == 0) {		int time;		dev_dbg(sharpsl_pm.dev, "Offline Charger: Step 2\n");		if (sharpsl_check_battery(0) < 0)			return sharpsl_off_charge_error();		CHARGE_OFF();		mdelay(SHARPSL_CHARGE_WAIT_TIME);		CHARGE_ON();		sharpsl_pm.charge_mode = CHRG_ON;		mdelay(SHARPSL_CHARGE_CO_CHECK_TIME);		time = RCNR;		while(1) {			/* Check if any wakeup event had occured */			if (sharpsl_pm.machinfo->charger_wakeup() != 0)				return 0;			/* Check for timeout */			if ((RCNR - time) > SHARPSL_WAIT_CO_TIME)				return 1;			if (STATUS_CHRG_FULL) {				dev_dbg(sharpsl_pm.dev, "Offline Charger: Charge full occured. Retrying to check\n");	   			sharpsl_pm.full_count++;				CHARGE_OFF();				mdelay(SHARPSL_CHARGE_WAIT_TIME);				CHARGE_ON();				return 1;			}		}	}	dev_dbg(sharpsl_pm.dev, "Offline Charger: Step 3\n");	mdelay(SHARPSL_CHARGE_CO_CHECK_TIME);	time = RCNR;	while(1) {		/* Check if any wakeup event had occured */		if (sharpsl_pm.machinfo->charger_wakeup() != 0)			return 0;		/* Check for timeout */		if ((RCNR-time) > SHARPSL_WAIT_CO_TIME) {			if (sharpsl_pm.full_count > SHARPSL_CHARGE_RETRY_CNT) {				dev_dbg(sharpsl_pm.dev, "Offline Charger: Not charged sufficiently. Retrying.\n");				sharpsl_pm.full_count = 0;			}			sharpsl_pm.full_count++;			return 1;		}		if (STATUS_CHRG_FULL) {			dev_dbg(sharpsl_pm.dev, "Offline Charger: Charging complete.\n");			CHARGE_LED_OFF();			CHARGE_OFF();			sharpsl_pm.charge_mode = CHRG_DONE;			return 1;		}	}}
4520	/local/tlutelli/issta_data/temp/c/2005_temp/2005/4520/c5e1ae9729d97d3c543cc70d7865df1e724da0d0/sharpsl_pm.c/clean/arch/arm/mach-pxa/sharpsl_pm.c