Eric Biederman | 6aa31cc | 2003-06-10 21:22:07 +0000 | [diff] [blame] | 1 | void smbus_read_byte(void) |
2 | { | ||||
3 | unsigned char host_status_register; | ||||
4 | unsigned char byte; | ||||
5 | int result; | ||||
6 | |||||
7 | host_status_register = __builtin_inb(0x1234); | ||||
8 | |||||
9 | /* read results of transaction */ | ||||
10 | byte = __builtin_inb(0x4567); | ||||
11 | |||||
12 | result = byte; | ||||
13 | if (host_status_register != 0x02) { | ||||
14 | result = -1; | ||||
15 | } | ||||
16 | } |