spin_unlock_irqrestore(&rtc_lock, flags); 
rtc_ds1386_set_time(unsigned long t){	struct rtc_time tm;	u8 byte;	u8 temp;	u8 year, month, day, hour, minute, second;	/* let us freeze external registers */	byte = READ_RTC(0xB);	byte &= 0x3f;	WRITE_RTC(0xB, byte);	/* convert */	to_tm(t, &tm);	/* check each field one by one */	year = BIN2BCD(tm.tm_year - EPOCH);	if (year != READ_RTC(0xA)) {		WRITE_RTC(0xA, year);	}	temp = READ_RTC(0x9);	month = BIN2BCD(tm.tm_mon+1);	/* tm_mon starts from 0 to 11 */	if (month != (temp & 0x1f)) {		WRITE_RTC( 0x9,			   (month & 0x1f) | (temp & ~0x1f) );	}	day = BIN2BCD(tm.tm_mday);	if (day != READ_RTC(0x8)) {		WRITE_RTC(0x8, day);	}	temp = READ_RTC(0x4);	if (temp & 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 != temp) WRITE_RTC(0x4, hour);	minute = BIN2BCD(tm.tm_min);	if (minute != READ_RTC(0x2)) {		WRITE_RTC(0x2, minute);	}	second = BIN2BCD(tm.tm_sec);	if (second != READ_RTC(0x1)) {		WRITE_RTC(0x1, second);	}	return 0;}
10457	/local/tlutelli/issta_data/temp/c/2005_temp/2005/10457/53c2df2f4ebbc1d8231ca7cc13ac5381230888b1/rtc_ds1386.c/buggy/arch/mips/ddb5xxx/common/rtc_ds1386.c