if ( (time_state == TIME_ERROR) || (time_state == TIME_BAD) ) time_state = TIME_OK; 
int __chrp chrp_set_rtc_time(unsigned long nowtime){	unsigned char save_control, save_freq_select;	struct rtc_time tm;	spin_lock(&rtc_lock);	to_tm(nowtime, &tm);	save_control = chrp_cmos_clock_read(RTC_CONTROL); /* tell the clock it's being set */	chrp_cmos_clock_write((save_control|RTC_SET), RTC_CONTROL);	save_freq_select = chrp_cmos_clock_read(RTC_FREQ_SELECT); /* stop and reset prescaler */	chrp_cmos_clock_write((save_freq_select|RTC_DIV_RESET2), RTC_FREQ_SELECT);        tm.tm_year -= 1900;	if (!(save_control & RTC_DM_BINARY) || RTC_ALWAYS_BCD) {		BIN_TO_BCD(tm.tm_sec);		BIN_TO_BCD(tm.tm_min);		BIN_TO_BCD(tm.tm_hour);		BIN_TO_BCD(tm.tm_mon);		BIN_TO_BCD(tm.tm_mday);		BIN_TO_BCD(tm.tm_year);	}	chrp_cmos_clock_write(tm.tm_sec,RTC_SECONDS);	chrp_cmos_clock_write(tm.tm_min,RTC_MINUTES);	chrp_cmos_clock_write(tm.tm_hour,RTC_HOURS);	chrp_cmos_clock_write(tm.tm_mon,RTC_MONTH);	chrp_cmos_clock_write(tm.tm_mday,RTC_DAY_OF_MONTH);	chrp_cmos_clock_write(tm.tm_year,RTC_YEAR);	/* The following flags have to be released exactly in this order,	 * otherwise the DS12887 (popular MC146818A clone with integrated	 * battery and quartz) will not reset the oscillator and will not	 * update precisely 500 ms later. You won't find this mentioned in	 * the Dallas Semiconductor data sheets, but who believes data	 * sheets anyway ...                           -- Markus Kuhn	 */	chrp_cmos_clock_write(save_control, RTC_CONTROL);	chrp_cmos_clock_write(save_freq_select, RTC_FREQ_SELECT);	if ( (time_state == TIME_ERROR) || (time_state == TIME_BAD) )		time_state = TIME_OK;	spin_unlock(&rtc_lock);	return 0;}
4520	/local/tlutelli/issta_data/temp/c/2005_temp/2005/4520/54095a6ec7b11a008c07c5016b025206a051f560/chrp_time.c/clean/arch/ppc/platforms/chrp_time.c