Commit ab7d91318bfc192ec38edaaabae06daa34b89a4d
1 parent
b94eb43f
Fix smbus_eeprom.c compile with DEBUG (spotted by Duilio Protti).
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@4645 c046a42c-6fe2-441c-8c8c-71466251a162
Showing
1 changed file
with
7 additions
and
5 deletions
hw/smbus_eeprom.c
@@ -37,7 +37,7 @@ typedef struct SMBusEEPROMDevice { | @@ -37,7 +37,7 @@ typedef struct SMBusEEPROMDevice { | ||
37 | static void eeprom_quick_cmd(SMBusDevice *dev, uint8_t read) | 37 | static void eeprom_quick_cmd(SMBusDevice *dev, uint8_t read) |
38 | { | 38 | { |
39 | #ifdef DEBUG | 39 | #ifdef DEBUG |
40 | - printf("eeprom_quick_cmd: addr=0x%02x read=%d\n", dev->addr, read); | 40 | + printf("eeprom_quick_cmd: addr=0x%02x read=%d\n", dev->i2c.address, read); |
41 | #endif | 41 | #endif |
42 | } | 42 | } |
43 | 43 | ||
@@ -45,7 +45,8 @@ static void eeprom_send_byte(SMBusDevice *dev, uint8_t val) | @@ -45,7 +45,8 @@ static void eeprom_send_byte(SMBusDevice *dev, uint8_t val) | ||
45 | { | 45 | { |
46 | SMBusEEPROMDevice *eeprom = (SMBusEEPROMDevice *) dev; | 46 | SMBusEEPROMDevice *eeprom = (SMBusEEPROMDevice *) dev; |
47 | #ifdef DEBUG | 47 | #ifdef DEBUG |
48 | - printf("eeprom_send_byte: addr=0x%02x val=0x%02x\n", dev->addr, val); | 48 | + printf("eeprom_send_byte: addr=0x%02x val=0x%02x\n", |
49 | + dev->i2c.address, val); | ||
49 | #endif | 50 | #endif |
50 | eeprom->offset = val; | 51 | eeprom->offset = val; |
51 | } | 52 | } |
@@ -55,7 +56,8 @@ static uint8_t eeprom_receive_byte(SMBusDevice *dev) | @@ -55,7 +56,8 @@ static uint8_t eeprom_receive_byte(SMBusDevice *dev) | ||
55 | SMBusEEPROMDevice *eeprom = (SMBusEEPROMDevice *) dev; | 56 | SMBusEEPROMDevice *eeprom = (SMBusEEPROMDevice *) dev; |
56 | uint8_t val = eeprom->data[eeprom->offset++]; | 57 | uint8_t val = eeprom->data[eeprom->offset++]; |
57 | #ifdef DEBUG | 58 | #ifdef DEBUG |
58 | - printf("eeprom_receive_byte: addr=0x%02x val=0x%02x\n", dev->addr, val); | 59 | + printf("eeprom_receive_byte: addr=0x%02x val=0x%02x\n", |
60 | + dev->i2c.address, val); | ||
59 | #endif | 61 | #endif |
60 | return val; | 62 | return val; |
61 | } | 63 | } |
@@ -65,8 +67,8 @@ static void eeprom_write_data(SMBusDevice *dev, uint8_t cmd, uint8_t *buf, int l | @@ -65,8 +67,8 @@ static void eeprom_write_data(SMBusDevice *dev, uint8_t cmd, uint8_t *buf, int l | ||
65 | SMBusEEPROMDevice *eeprom = (SMBusEEPROMDevice *) dev; | 67 | SMBusEEPROMDevice *eeprom = (SMBusEEPROMDevice *) dev; |
66 | int n; | 68 | int n; |
67 | #ifdef DEBUG | 69 | #ifdef DEBUG |
68 | - printf("eeprom_write_byte: addr=0x%02x cmd=0x%02x val=0x%02x\n", dev->addr, | ||
69 | - cmd, buf[0]); | 70 | + printf("eeprom_write_byte: addr=0x%02x cmd=0x%02x val=0x%02x\n", |
71 | + dev->i2c.address, cmd, buf[0]); | ||
70 | #endif | 72 | #endif |
71 | /* An page write operation is not a valid SMBus command. | 73 | /* An page write operation is not a valid SMBus command. |
72 | It is a block write without a length byte. Fortunately we | 74 | It is a block write without a length byte. Fortunately we |