spin_unlock_irqrestore(&rtc_lock, flags); 
rtc_ds1742_set_time(unsigned long t){	struct rtc_time tm;	u8 year, month, day, hour, minute, second;	u8 cmos_year, cmos_month, cmos_day, cmos_hour, cmos_minute, cmos_second;	int cmos_century;	CMOS_WRITE(RTC_READ, RTC_CONTROL);	cmos_second = (u8)(CMOS_READ(RTC_SECONDS) & RTC_SECONDS_MASK);	cmos_minute = (u8)CMOS_READ(RTC_MINUTES);	cmos_hour = (u8)CMOS_READ(RTC_HOURS);	cmos_day = (u8)CMOS_READ(RTC_DATE);	cmos_month = (u8)CMOS_READ(RTC_MONTH);	cmos_year = (u8)CMOS_READ(RTC_YEAR);	cmos_century = CMOS_READ(RTC_CENTURY) & RTC_CENTURY_MASK;	CMOS_WRITE(RTC_WRITE, RTC_CONTROL);	/* convert */	to_tm(t, &tm);	/* check each field one by one */	year = BIN2BCD(tm.tm_year - EPOCH);	if (year != cmos_year) {		CMOS_WRITE(year,RTC_YEAR);	}	month = BIN2BCD(tm.tm_mon);	if (month != (cmos_month & 0x1f)) {		CMOS_WRITE((month & 0x1f) | (cmos_month & ~0x1f),RTC_MONTH);	}	day = BIN2BCD(tm.tm_mday);	if (day != cmos_day) {		CMOS_WRITE(day, RTC_DATE);	}	if (cmos_hour & 0x40) {		/* 12 hour format */		hour = 0x40;		if (tm.tm_hour > 12) {			hour |= 0x20 | (BIN2BCD(hour-12) & 0x1f);		} else {			hour |= BIN2BCD(tm.tm_hour);		}	} else {		/* 24 hour format */		hour = BIN2BCD(tm.tm_hour) & 0x3f;	}	if (hour != cmos_hour) CMOS_WRITE(hour, RTC_HOURS);	minute = BIN2BCD(tm.tm_min);	if (minute !=  cmos_minute) {		CMOS_WRITE(minute, RTC_MINUTES);	}	second = BIN2BCD(tm.tm_sec);	if (second !=  cmos_second) {		CMOS_WRITE(second & RTC_SECONDS_MASK,RTC_SECONDS);	}	/* RTC_CENTURY and RTC_CONTROL share same address... */	CMOS_WRITE(cmos_century, RTC_CONTROL);	return 0;}
10457	/local/tlutelli/issta_data/temp/c/2005_temp/2005/10457/53c2df2f4ebbc1d8231ca7cc13ac5381230888b1/rtc_ds1742.c/buggy/arch/mips/jmr3927/common/rtc_ds1742.c