[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PULL v2 07/11] smbus: allow returning an error from reads
From: |
Michael S. Tsirkin |
Subject: |
[Qemu-devel] [PULL v2 07/11] smbus: allow returning an error from reads |
Date: |
Wed, 7 May 2014 19:17:13 +0300 |
From: Paolo Bonzini <address@hidden>
Signed-off-by: Paolo Bonzini <address@hidden>
Acked-by: Michael S. Tsirkin <address@hidden>
Reviewed-by: Andreas Färber <address@hidden>
Signed-off-by: Michael S. Tsirkin <address@hidden>
---
include/hw/i2c/smbus.h | 6 +++---
hw/i2c/smbus.c | 6 +++---
2 files changed, 6 insertions(+), 6 deletions(-)
diff --git a/include/hw/i2c/smbus.h b/include/hw/i2c/smbus.h
index 63f0cc4..285d3b5 100644
--- a/include/hw/i2c/smbus.h
+++ b/include/hw/i2c/smbus.h
@@ -67,11 +67,11 @@ struct SMBusDevice {
/* Master device commands. */
void smbus_quick_command(I2CBus *bus, uint8_t addr, int read);
-uint8_t smbus_receive_byte(I2CBus *bus, uint8_t addr);
+int smbus_receive_byte(I2CBus *bus, uint8_t addr);
void smbus_send_byte(I2CBus *bus, uint8_t addr, uint8_t data);
-uint8_t smbus_read_byte(I2CBus *bus, uint8_t addr, uint8_t command);
+int smbus_read_byte(I2CBus *bus, uint8_t addr, uint8_t command);
void smbus_write_byte(I2CBus *bus, uint8_t addr, uint8_t command, uint8_t
data);
-uint16_t smbus_read_word(I2CBus *bus, uint8_t addr, uint8_t command);
+int smbus_read_word(I2CBus *bus, uint8_t addr, uint8_t command);
void smbus_write_word(I2CBus *bus, uint8_t addr, uint8_t command, uint16_t
data);
int smbus_read_block(I2CBus *bus, uint8_t addr, uint8_t command, uint8_t
*data);
void smbus_write_block(I2CBus *bus, uint8_t addr, uint8_t command, uint8_t
*data,
diff --git a/hw/i2c/smbus.c b/hw/i2c/smbus.c
index 3febf3c..190f08e 100644
--- a/hw/i2c/smbus.c
+++ b/hw/i2c/smbus.c
@@ -214,7 +214,7 @@ void smbus_quick_command(I2CBus *bus, uint8_t addr, int
read)
i2c_end_transfer(bus);
}
-uint8_t smbus_receive_byte(I2CBus *bus, uint8_t addr)
+int smbus_receive_byte(I2CBus *bus, uint8_t addr)
{
uint8_t data;
@@ -232,7 +232,7 @@ void smbus_send_byte(I2CBus *bus, uint8_t addr, uint8_t
data)
i2c_end_transfer(bus);
}
-uint8_t smbus_read_byte(I2CBus *bus, uint8_t addr, uint8_t command)
+int smbus_read_byte(I2CBus *bus, uint8_t addr, uint8_t command)
{
uint8_t data;
i2c_start_transfer(bus, addr, 0);
@@ -252,7 +252,7 @@ void smbus_write_byte(I2CBus *bus, uint8_t addr, uint8_t
command, uint8_t data)
i2c_end_transfer(bus);
}
-uint16_t smbus_read_word(I2CBus *bus, uint8_t addr, uint8_t command)
+int smbus_read_word(I2CBus *bus, uint8_t addr, uint8_t command)
{
uint16_t data;
i2c_start_transfer(bus, addr, 0);
--
MST
- [Qemu-devel] [PULL v2 00/11] pc,net,MAINTAINERS,build updates, Michael S. Tsirkin, 2014/05/07
- [Qemu-devel] [PULL v2 01/11] acpi/pcihp.c: Rewrite acpi_pcihp_get_bsel using object_property_get_int, Michael S. Tsirkin, 2014/05/07
- [Qemu-devel] [PULL v2 02/11] acpi-build: properly decrement objects' reference counters, Michael S. Tsirkin, 2014/05/07
- [Qemu-devel] [PULL v2 03/11] acpi: fix tables for no-hpet configuration, Michael S. Tsirkin, 2014/05/07
- [Qemu-devel] [PULL v2 05/11] pc: add compat_props placeholder for 2.0 machine type, Michael S. Tsirkin, 2014/05/07
- [Qemu-devel] [PULL v2 04/11] i8259: don't abort when trying to use level sensitive irqs, Michael S. Tsirkin, 2014/05/07
- [Qemu-devel] [PULL v2 07/11] smbus: allow returning an error from reads,
Michael S. Tsirkin <=
- [Qemu-devel] [PULL v2 06/11] apic: use emulated lapic version 0x14 on pc machines >= 2.1, Michael S. Tsirkin, 2014/05/07
- [Qemu-devel] [PULL v2 08/11] smbus: return -1 if nothing found at the given address, Michael S. Tsirkin, 2014/05/07
- [Qemu-devel] [PULL v2 09/11] pm_smbus: correctly report unclaimed cycles, Michael S. Tsirkin, 2014/05/07
- [Qemu-devel] [PULL v2 10/11] MAINTAINERS: addresses for responsible disclosure, Michael S. Tsirkin, 2014/05/07
- [Qemu-devel] [PULL v2 11/11] configure: make source tree build more robust, Michael S. Tsirkin, 2014/05/07
- Re: [Qemu-devel] [PULL v2 00/11] pc,net,MAINTAINERS,build updates, Peter Maydell, 2014/05/07