Skip to content

Commit

Permalink
acpi: use bcd2bin/bin2bcd
Browse files Browse the repository at this point in the history
Change ACPI to use the new bcd2bin/bin2bcd functions instead of the
obsolete BCD_TO_BIN/BIN_TO_BCD macros.

Signed-off-by: Adrian Bunk <[email protected]>
Cc: Andi Kleen <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
  • Loading branch information
AdrianBunk authored and torvalds committed Oct 20, 2008
1 parent fdd2e5f commit ab527d7
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions drivers/acpi/sleep/proc.c
Original file line number Diff line number Diff line change
@@ -120,13 +120,13 @@ static int acpi_system_alarm_seq_show(struct seq_file *seq, void *offset)
spin_unlock_irqrestore(&rtc_lock, flags);

if (!(rtc_control & RTC_DM_BINARY) || RTC_ALWAYS_BCD) {
BCD_TO_BIN(sec);
BCD_TO_BIN(min);
BCD_TO_BIN(hr);
BCD_TO_BIN(day);
BCD_TO_BIN(mo);
BCD_TO_BIN(yr);
BCD_TO_BIN(cent);
sec = bcd2bin(sec);
min = bcd2bin(min);
hr = bcd2bin(hr);
day = bcd2bin(day);
mo = bcd2bin(mo);
yr = bcd2bin(yr);
cent = bcd2bin(cent);
}

/* we're trusting the FADT (see above) */
@@ -204,15 +204,15 @@ static u32 cmos_bcd_read(int offset, int rtc_control)
{
u32 val = CMOS_READ(offset);
if (!(rtc_control & RTC_DM_BINARY) || RTC_ALWAYS_BCD)
BCD_TO_BIN(val);
val = bcd2bin(val);
return val;
}

/* Write binary value into possibly BCD register */
static void cmos_bcd_write(u32 val, int offset, int rtc_control)
{
if (!(rtc_control & RTC_DM_BINARY) || RTC_ALWAYS_BCD)
BIN_TO_BCD(val);
val = bin2bcd(val);
CMOS_WRITE(val, offset);
}

0 comments on commit ab527d7

Please sign in to comment.