diff options
Diffstat (limited to 'drivers/char')
-rw-r--r-- | drivers/char/ds1286.c | 34 | ||||
-rw-r--r-- | drivers/char/ds1302.c | 24 | ||||
-rw-r--r-- | drivers/char/ip27-rtc.c | 24 | ||||
-rw-r--r-- | drivers/char/pc8736x_gpio.c | 11 | ||||
-rw-r--r-- | drivers/char/rtc.c | 40 | ||||
-rw-r--r-- | drivers/char/sx.c | 6 | ||||
-rw-r--r-- | drivers/char/sysrq.c | 2 | ||||
-rw-r--r-- | drivers/char/tpm/tpm.c | 2 |
8 files changed, 74 insertions, 69 deletions
diff --git a/drivers/char/ds1286.c b/drivers/char/ds1286.c index 5329d482b582..0a826d7be10e 100644 --- a/drivers/char/ds1286.c +++ b/drivers/char/ds1286.c | |||
@@ -210,8 +210,8 @@ static int ds1286_ioctl(struct inode *inode, struct file *file, | |||
210 | if (sec != 0) | 210 | if (sec != 0) |
211 | return -EINVAL; | 211 | return -EINVAL; |
212 | 212 | ||
213 | min = BIN2BCD(min); | 213 | min = bin2bcd(min); |
214 | min = BIN2BCD(hrs); | 214 | min = bin2bcd(hrs); |
215 | 215 | ||
216 | spin_lock(&ds1286_lock); | 216 | spin_lock(&ds1286_lock); |
217 | rtc_write(hrs, RTC_HOURS_ALARM); | 217 | rtc_write(hrs, RTC_HOURS_ALARM); |
@@ -353,7 +353,7 @@ static int ds1286_proc_output(char *buf) | |||
353 | 353 | ||
354 | ds1286_get_time(&tm); | 354 | ds1286_get_time(&tm); |
355 | hundredth = rtc_read(RTC_HUNDREDTH_SECOND); | 355 | hundredth = rtc_read(RTC_HUNDREDTH_SECOND); |
356 | BCD_TO_BIN(hundredth); | 356 | hundredth = bcd2bin(hundredth); |
357 | 357 | ||
358 | p += sprintf(p, | 358 | p += sprintf(p, |
359 | "rtc_time\t: %02d:%02d:%02d.%02d\n" | 359 | "rtc_time\t: %02d:%02d:%02d.%02d\n" |
@@ -477,12 +477,12 @@ static void ds1286_get_time(struct rtc_time *rtc_tm) | |||
477 | rtc_write(save_control, RTC_CMD); | 477 | rtc_write(save_control, RTC_CMD); |
478 | spin_unlock_irqrestore(&ds1286_lock, flags); | 478 | spin_unlock_irqrestore(&ds1286_lock, flags); |
479 | 479 | ||
480 | BCD_TO_BIN(rtc_tm->tm_sec); | 480 | rtc_tm->tm_sec = bcd2bin(rtc_tm->tm_sec); |
481 | BCD_TO_BIN(rtc_tm->tm_min); | 481 | rtc_tm->tm_min = bcd2bin(rtc_tm->tm_min); |
482 | BCD_TO_BIN(rtc_tm->tm_hour); | 482 | rtc_tm->tm_hour = bcd2bin(rtc_tm->tm_hour); |
483 | BCD_TO_BIN(rtc_tm->tm_mday); | 483 | rtc_tm->tm_mday = bcd2bin(rtc_tm->tm_mday); |
484 | BCD_TO_BIN(rtc_tm->tm_mon); | 484 | rtc_tm->tm_mon = bcd2bin(rtc_tm->tm_mon); |
485 | BCD_TO_BIN(rtc_tm->tm_year); | 485 | rtc_tm->tm_year = bcd2bin(rtc_tm->tm_year); |
486 | 486 | ||
487 | /* | 487 | /* |
488 | * Account for differences between how the RTC uses the values | 488 | * Account for differences between how the RTC uses the values |
@@ -531,12 +531,12 @@ static int ds1286_set_time(struct rtc_time *rtc_tm) | |||
531 | if (yrs >= 100) | 531 | if (yrs >= 100) |
532 | yrs -= 100; | 532 | yrs -= 100; |
533 | 533 | ||
534 | BIN_TO_BCD(sec); | 534 | sec = bin2bcd(sec); |
535 | BIN_TO_BCD(min); | 535 | min = bin2bcd(min); |
536 | BIN_TO_BCD(hrs); | 536 | hrs = bin2bcd(hrs); |
537 | BIN_TO_BCD(day); | 537 | day = bin2bcd(day); |
538 | BIN_TO_BCD(mon); | 538 | mon = bin2bcd(mon); |
539 | BIN_TO_BCD(yrs); | 539 | yrs = bin2bcd(yrs); |
540 | 540 | ||
541 | spin_lock_irqsave(&ds1286_lock, flags); | 541 | spin_lock_irqsave(&ds1286_lock, flags); |
542 | save_control = rtc_read(RTC_CMD); | 542 | save_control = rtc_read(RTC_CMD); |
@@ -572,8 +572,8 @@ static void ds1286_get_alm_time(struct rtc_time *alm_tm) | |||
572 | cmd = rtc_read(RTC_CMD); | 572 | cmd = rtc_read(RTC_CMD); |
573 | spin_unlock_irqrestore(&ds1286_lock, flags); | 573 | spin_unlock_irqrestore(&ds1286_lock, flags); |
574 | 574 | ||
575 | BCD_TO_BIN(alm_tm->tm_min); | 575 | alm_tm->tm_min = bcd2bin(alm_tm->tm_min); |
576 | BCD_TO_BIN(alm_tm->tm_hour); | 576 | alm_tm->tm_hour = bcd2bin(alm_tm->tm_hour); |
577 | alm_tm->tm_sec = 0; | 577 | alm_tm->tm_sec = 0; |
578 | } | 578 | } |
579 | 579 | ||
diff --git a/drivers/char/ds1302.c b/drivers/char/ds1302.c index c5e67a623951..170693c93c73 100644 --- a/drivers/char/ds1302.c +++ b/drivers/char/ds1302.c | |||
@@ -131,12 +131,12 @@ get_rtc_time(struct rtc_time *rtc_tm) | |||
131 | 131 | ||
132 | local_irq_restore(flags); | 132 | local_irq_restore(flags); |
133 | 133 | ||
134 | BCD_TO_BIN(rtc_tm->tm_sec); | 134 | rtc_tm->tm_sec = bcd2bin(rtc_tm->tm_sec); |
135 | BCD_TO_BIN(rtc_tm->tm_min); | 135 | rtc_tm->tm_min = bcd2bin(rtc_tm->tm_min); |
136 | BCD_TO_BIN(rtc_tm->tm_hour); | 136 | rtc_tm->tm_hour = bcd2bin(rtc_tm->tm_hour); |
137 | BCD_TO_BIN(rtc_tm->tm_mday); | 137 | rtc_tm->tm_mday = bcd2bin(rtc_tm->tm_mday); |
138 | BCD_TO_BIN(rtc_tm->tm_mon); | 138 | rtc_tm->tm_mon = bcd2bin(rtc_tm->tm_mon); |
139 | BCD_TO_BIN(rtc_tm->tm_year); | 139 | rtc_tm->tm_year = bcd2bin(rtc_tm->tm_year); |
140 | 140 | ||
141 | /* | 141 | /* |
142 | * Account for differences between how the RTC uses the values | 142 | * Account for differences between how the RTC uses the values |
@@ -211,12 +211,12 @@ static long rtc_ioctl(struct file *file, unsigned int cmd, unsigned long arg) | |||
211 | else | 211 | else |
212 | yrs -= 1900; /* RTC (70, 71, ... 99) */ | 212 | yrs -= 1900; /* RTC (70, 71, ... 99) */ |
213 | 213 | ||
214 | BIN_TO_BCD(sec); | 214 | sec = bin2bcd(sec); |
215 | BIN_TO_BCD(min); | 215 | min = bin2bcd(min); |
216 | BIN_TO_BCD(hrs); | 216 | hrs = bin2bcd(hrs); |
217 | BIN_TO_BCD(day); | 217 | day = bin2bcd(day); |
218 | BIN_TO_BCD(mon); | 218 | mon = bin2bcd(mon); |
219 | BIN_TO_BCD(yrs); | 219 | yrs = bin2bcd(yrs); |
220 | 220 | ||
221 | lock_kernel(); | 221 | lock_kernel(); |
222 | local_irq_save(flags); | 222 | local_irq_save(flags); |
diff --git a/drivers/char/ip27-rtc.c b/drivers/char/ip27-rtc.c index ec9d0443d92c..2abd881b4cbc 100644 --- a/drivers/char/ip27-rtc.c +++ b/drivers/char/ip27-rtc.c | |||
@@ -130,12 +130,12 @@ static long rtc_ioctl(struct file *filp, unsigned int cmd, unsigned long arg) | |||
130 | if (yrs >= 100) | 130 | if (yrs >= 100) |
131 | yrs -= 100; | 131 | yrs -= 100; |
132 | 132 | ||
133 | sec = BIN2BCD(sec); | 133 | sec = bin2bcd(sec); |
134 | min = BIN2BCD(min); | 134 | min = bin2bcd(min); |
135 | hrs = BIN2BCD(hrs); | 135 | hrs = bin2bcd(hrs); |
136 | day = BIN2BCD(day); | 136 | day = bin2bcd(day); |
137 | mon = BIN2BCD(mon); | 137 | mon = bin2bcd(mon); |
138 | yrs = BIN2BCD(yrs); | 138 | yrs = bin2bcd(yrs); |
139 | 139 | ||
140 | spin_lock_irq(&rtc_lock); | 140 | spin_lock_irq(&rtc_lock); |
141 | rtc->control |= M48T35_RTC_SET; | 141 | rtc->control |= M48T35_RTC_SET; |
@@ -311,12 +311,12 @@ static void get_rtc_time(struct rtc_time *rtc_tm) | |||
311 | rtc->control &= ~M48T35_RTC_READ; | 311 | rtc->control &= ~M48T35_RTC_READ; |
312 | spin_unlock_irq(&rtc_lock); | 312 | spin_unlock_irq(&rtc_lock); |
313 | 313 | ||
314 | rtc_tm->tm_sec = BCD2BIN(rtc_tm->tm_sec); | 314 | rtc_tm->tm_sec = bcd2bin(rtc_tm->tm_sec); |
315 | rtc_tm->tm_min = BCD2BIN(rtc_tm->tm_min); | 315 | rtc_tm->tm_min = bcd2bin(rtc_tm->tm_min); |
316 | rtc_tm->tm_hour = BCD2BIN(rtc_tm->tm_hour); | 316 | rtc_tm->tm_hour = bcd2bin(rtc_tm->tm_hour); |
317 | rtc_tm->tm_mday = BCD2BIN(rtc_tm->tm_mday); | 317 | rtc_tm->tm_mday = bcd2bin(rtc_tm->tm_mday); |
318 | rtc_tm->tm_mon = BCD2BIN(rtc_tm->tm_mon); | 318 | rtc_tm->tm_mon = bcd2bin(rtc_tm->tm_mon); |
319 | rtc_tm->tm_year = BCD2BIN(rtc_tm->tm_year); | 319 | rtc_tm->tm_year = bcd2bin(rtc_tm->tm_year); |
320 | 320 | ||
321 | /* | 321 | /* |
322 | * Account for differences between how the RTC uses the values | 322 | * Account for differences between how the RTC uses the values |
diff --git a/drivers/char/pc8736x_gpio.c b/drivers/char/pc8736x_gpio.c index b930de50407a..3f7da8cf3a80 100644 --- a/drivers/char/pc8736x_gpio.c +++ b/drivers/char/pc8736x_gpio.c | |||
@@ -41,7 +41,8 @@ static u8 pc8736x_gpio_shadow[4]; | |||
41 | #define SIO_BASE2 0x4E /* alt command-reg to check */ | 41 | #define SIO_BASE2 0x4E /* alt command-reg to check */ |
42 | 42 | ||
43 | #define SIO_SID 0x20 /* SuperI/O ID Register */ | 43 | #define SIO_SID 0x20 /* SuperI/O ID Register */ |
44 | #define SIO_SID_VALUE 0xe9 /* Expected value in SuperI/O ID Register */ | 44 | #define SIO_SID_PC87365 0xe5 /* Expected value in ID Register for PC87365 */ |
45 | #define SIO_SID_PC87366 0xe9 /* Expected value in ID Register for PC87366 */ | ||
45 | 46 | ||
46 | #define SIO_CF1 0x21 /* chip config, bit0 is chip enable */ | 47 | #define SIO_CF1 0x21 /* chip config, bit0 is chip enable */ |
47 | 48 | ||
@@ -91,13 +92,17 @@ static inline int superio_inb(int addr) | |||
91 | 92 | ||
92 | static int pc8736x_superio_present(void) | 93 | static int pc8736x_superio_present(void) |
93 | { | 94 | { |
95 | int id; | ||
96 | |||
94 | /* try the 2 possible values, read a hardware reg to verify */ | 97 | /* try the 2 possible values, read a hardware reg to verify */ |
95 | superio_cmd = SIO_BASE1; | 98 | superio_cmd = SIO_BASE1; |
96 | if (superio_inb(SIO_SID) == SIO_SID_VALUE) | 99 | id = superio_inb(SIO_SID); |
100 | if (id == SIO_SID_PC87365 || id == SIO_SID_PC87366) | ||
97 | return superio_cmd; | 101 | return superio_cmd; |
98 | 102 | ||
99 | superio_cmd = SIO_BASE2; | 103 | superio_cmd = SIO_BASE2; |
100 | if (superio_inb(SIO_SID) == SIO_SID_VALUE) | 104 | id = superio_inb(SIO_SID); |
105 | if (id == SIO_SID_PC87365 || id == SIO_SID_PC87366) | ||
101 | return superio_cmd; | 106 | return superio_cmd; |
102 | 107 | ||
103 | return 0; | 108 | return 0; |
diff --git a/drivers/char/rtc.c b/drivers/char/rtc.c index 17683de95717..32dc89720d58 100644 --- a/drivers/char/rtc.c +++ b/drivers/char/rtc.c | |||
@@ -518,17 +518,17 @@ static int rtc_do_ioctl(unsigned int cmd, unsigned long arg, int kernel) | |||
518 | if (!(CMOS_READ(RTC_CONTROL) & RTC_DM_BINARY) || | 518 | if (!(CMOS_READ(RTC_CONTROL) & RTC_DM_BINARY) || |
519 | RTC_ALWAYS_BCD) { | 519 | RTC_ALWAYS_BCD) { |
520 | if (sec < 60) | 520 | if (sec < 60) |
521 | BIN_TO_BCD(sec); | 521 | sec = bin2bcd(sec); |
522 | else | 522 | else |
523 | sec = 0xff; | 523 | sec = 0xff; |
524 | 524 | ||
525 | if (min < 60) | 525 | if (min < 60) |
526 | BIN_TO_BCD(min); | 526 | min = bin2bcd(min); |
527 | else | 527 | else |
528 | min = 0xff; | 528 | min = 0xff; |
529 | 529 | ||
530 | if (hrs < 24) | 530 | if (hrs < 24) |
531 | BIN_TO_BCD(hrs); | 531 | hrs = bin2bcd(hrs); |
532 | else | 532 | else |
533 | hrs = 0xff; | 533 | hrs = 0xff; |
534 | } | 534 | } |
@@ -614,12 +614,12 @@ static int rtc_do_ioctl(unsigned int cmd, unsigned long arg, int kernel) | |||
614 | 614 | ||
615 | if (!(CMOS_READ(RTC_CONTROL) & RTC_DM_BINARY) | 615 | if (!(CMOS_READ(RTC_CONTROL) & RTC_DM_BINARY) |
616 | || RTC_ALWAYS_BCD) { | 616 | || RTC_ALWAYS_BCD) { |
617 | BIN_TO_BCD(sec); | 617 | sec = bin2bcd(sec); |
618 | BIN_TO_BCD(min); | 618 | min = bin2bcd(min); |
619 | BIN_TO_BCD(hrs); | 619 | hrs = bin2bcd(hrs); |
620 | BIN_TO_BCD(day); | 620 | day = bin2bcd(day); |
621 | BIN_TO_BCD(mon); | 621 | mon = bin2bcd(mon); |
622 | BIN_TO_BCD(yrs); | 622 | yrs = bin2bcd(yrs); |
623 | } | 623 | } |
624 | 624 | ||
625 | save_control = CMOS_READ(RTC_CONTROL); | 625 | save_control = CMOS_READ(RTC_CONTROL); |
@@ -1099,7 +1099,7 @@ no_irq: | |||
1099 | spin_unlock_irq(&rtc_lock); | 1099 | spin_unlock_irq(&rtc_lock); |
1100 | 1100 | ||
1101 | if (!(ctrl & RTC_DM_BINARY) || RTC_ALWAYS_BCD) | 1101 | if (!(ctrl & RTC_DM_BINARY) || RTC_ALWAYS_BCD) |
1102 | BCD_TO_BIN(year); /* This should never happen... */ | 1102 | year = bcd2bin(year); /* This should never happen... */ |
1103 | 1103 | ||
1104 | if (year < 20) { | 1104 | if (year < 20) { |
1105 | epoch = 2000; | 1105 | epoch = 2000; |
@@ -1352,13 +1352,13 @@ static void rtc_get_rtc_time(struct rtc_time *rtc_tm) | |||
1352 | spin_unlock_irqrestore(&rtc_lock, flags); | 1352 | spin_unlock_irqrestore(&rtc_lock, flags); |
1353 | 1353 | ||
1354 | if (!(ctrl & RTC_DM_BINARY) || RTC_ALWAYS_BCD) { | 1354 | if (!(ctrl & RTC_DM_BINARY) || RTC_ALWAYS_BCD) { |
1355 | BCD_TO_BIN(rtc_tm->tm_sec); | 1355 | rtc_tm->tm_sec = bcd2bin(rtc_tm->tm_sec); |
1356 | BCD_TO_BIN(rtc_tm->tm_min); | 1356 | rtc_tm->tm_min = bcd2bin(rtc_tm->tm_min); |
1357 | BCD_TO_BIN(rtc_tm->tm_hour); | 1357 | rtc_tm->tm_hour = bcd2bin(rtc_tm->tm_hour); |
1358 | BCD_TO_BIN(rtc_tm->tm_mday); | 1358 | rtc_tm->tm_mday = bcd2bin(rtc_tm->tm_mday); |
1359 | BCD_TO_BIN(rtc_tm->tm_mon); | 1359 | rtc_tm->tm_mon = bcd2bin(rtc_tm->tm_mon); |
1360 | BCD_TO_BIN(rtc_tm->tm_year); | 1360 | rtc_tm->tm_year = bcd2bin(rtc_tm->tm_year); |
1361 | BCD_TO_BIN(rtc_tm->tm_wday); | 1361 | rtc_tm->tm_wday = bcd2bin(rtc_tm->tm_wday); |
1362 | } | 1362 | } |
1363 | 1363 | ||
1364 | #ifdef CONFIG_MACH_DECSTATION | 1364 | #ifdef CONFIG_MACH_DECSTATION |
@@ -1392,9 +1392,9 @@ static void get_rtc_alm_time(struct rtc_time *alm_tm) | |||
1392 | spin_unlock_irq(&rtc_lock); | 1392 | spin_unlock_irq(&rtc_lock); |
1393 | 1393 | ||
1394 | if (!(ctrl & RTC_DM_BINARY) || RTC_ALWAYS_BCD) { | 1394 | if (!(ctrl & RTC_DM_BINARY) || RTC_ALWAYS_BCD) { |
1395 | BCD_TO_BIN(alm_tm->tm_sec); | 1395 | alm_tm->tm_sec = bcd2bin(alm_tm->tm_sec); |
1396 | BCD_TO_BIN(alm_tm->tm_min); | 1396 | alm_tm->tm_min = bcd2bin(alm_tm->tm_min); |
1397 | BCD_TO_BIN(alm_tm->tm_hour); | 1397 | alm_tm->tm_hour = bcd2bin(alm_tm->tm_hour); |
1398 | } | 1398 | } |
1399 | } | 1399 | } |
1400 | 1400 | ||
diff --git a/drivers/char/sx.c b/drivers/char/sx.c index 5b8d7a1aa3e6..ba4e86281fbf 100644 --- a/drivers/char/sx.c +++ b/drivers/char/sx.c | |||
@@ -2504,7 +2504,7 @@ static void __devexit sx_remove_card(struct sx_board *board, | |||
2504 | del_timer(&board->timer); | 2504 | del_timer(&board->timer); |
2505 | if (pdev) { | 2505 | if (pdev) { |
2506 | #ifdef CONFIG_PCI | 2506 | #ifdef CONFIG_PCI |
2507 | pci_iounmap(pdev, board->base2); | 2507 | iounmap(board->base2); |
2508 | pci_release_region(pdev, IS_CF_BOARD(board) ? 3 : 2); | 2508 | pci_release_region(pdev, IS_CF_BOARD(board) ? 3 : 2); |
2509 | #endif | 2509 | #endif |
2510 | } else { | 2510 | } else { |
@@ -2677,7 +2677,7 @@ static int __devinit sx_pci_probe(struct pci_dev *pdev, | |||
2677 | } | 2677 | } |
2678 | board->hw_base = pci_resource_start(pdev, reg); | 2678 | board->hw_base = pci_resource_start(pdev, reg); |
2679 | board->base2 = | 2679 | board->base2 = |
2680 | board->base = pci_iomap(pdev, reg, WINDOW_LEN(board)); | 2680 | board->base = ioremap_nocache(board->hw_base, WINDOW_LEN(board)); |
2681 | if (!board->base) { | 2681 | if (!board->base) { |
2682 | dev_err(&pdev->dev, "ioremap failed\n"); | 2682 | dev_err(&pdev->dev, "ioremap failed\n"); |
2683 | goto err_reg; | 2683 | goto err_reg; |
@@ -2703,7 +2703,7 @@ static int __devinit sx_pci_probe(struct pci_dev *pdev, | |||
2703 | 2703 | ||
2704 | return 0; | 2704 | return 0; |
2705 | err_unmap: | 2705 | err_unmap: |
2706 | pci_iounmap(pdev, board->base2); | 2706 | iounmap(board->base2); |
2707 | err_reg: | 2707 | err_reg: |
2708 | pci_release_region(pdev, reg); | 2708 | pci_release_region(pdev, reg); |
2709 | err_flag: | 2709 | err_flag: |
diff --git a/drivers/char/sysrq.c b/drivers/char/sysrq.c index dce4cc0e6953..d0c0d64ed366 100644 --- a/drivers/char/sysrq.c +++ b/drivers/char/sysrq.c | |||
@@ -168,7 +168,7 @@ static void sysrq_handle_show_timers(int key, struct tty_struct *tty) | |||
168 | static struct sysrq_key_op sysrq_show_timers_op = { | 168 | static struct sysrq_key_op sysrq_show_timers_op = { |
169 | .handler = sysrq_handle_show_timers, | 169 | .handler = sysrq_handle_show_timers, |
170 | .help_msg = "show-all-timers(Q)", | 170 | .help_msg = "show-all-timers(Q)", |
171 | .action_msg = "Show Pending Timers", | 171 | .action_msg = "Show pending hrtimers (no others)", |
172 | }; | 172 | }; |
173 | 173 | ||
174 | static void sysrq_handle_mountro(int key, struct tty_struct *tty) | 174 | static void sysrq_handle_mountro(int key, struct tty_struct *tty) |
diff --git a/drivers/char/tpm/tpm.c b/drivers/char/tpm/tpm.c index e70d13defde4..9c47dc48c9fd 100644 --- a/drivers/char/tpm/tpm.c +++ b/drivers/char/tpm/tpm.c | |||
@@ -1157,7 +1157,7 @@ EXPORT_SYMBOL_GPL(tpm_dev_vendor_release); | |||
1157 | * Once all references to platform device are down to 0, | 1157 | * Once all references to platform device are down to 0, |
1158 | * release all allocated structures. | 1158 | * release all allocated structures. |
1159 | */ | 1159 | */ |
1160 | static void tpm_dev_release(struct device *dev) | 1160 | void tpm_dev_release(struct device *dev) |
1161 | { | 1161 | { |
1162 | struct tpm_chip *chip = dev_get_drvdata(dev); | 1162 | struct tpm_chip *chip = dev_get_drvdata(dev); |
1163 | 1163 | ||