[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 2/4] hw/i2c/smbus_slave: Add object path on error prints
From: |
Joe Komlodi |
Subject: |
[PATCH 2/4] hw/i2c/smbus_slave: Add object path on error prints |
Date: |
Wed, 10 Jan 2024 21:26:39 +0000 |
The current logging doesn't tell us which specific smbus device is an
error state.
Signed-off-by: Joe Komlodi <komlodi@google.com>
---
hw/i2c/smbus_slave.c | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)
diff --git a/hw/i2c/smbus_slave.c b/hw/i2c/smbus_slave.c
index 1300c9ec72..e24a1ef472 100644
--- a/hw/i2c/smbus_slave.c
+++ b/hw/i2c/smbus_slave.c
@@ -25,11 +25,15 @@
#define DPRINTF(fmt, ...) \
do { printf("smbus(%02x): " fmt , dev->i2c.address, ## __VA_ARGS__); } while
(0)
#define BADF(fmt, ...) \
-do { fprintf(stderr, "smbus: error: " fmt , ## __VA_ARGS__); exit(1);} while
(0)
+do { fprintf(stderr, "%s: smbus: error: " fmt , \
+ object_get_canonical_path(OBJECT(dev)), ## __VA_ARGS__); \
+ exit(1); } while (0)
#else
#define DPRINTF(fmt, ...) do {} while(0)
#define BADF(fmt, ...) \
-do { fprintf(stderr, "smbus: error: " fmt , ## __VA_ARGS__);} while (0)
+do { fprintf(stderr, "%s: smbus: error: " fmt , \
+ object_get_canonical_path(OBJECT(dev)), ## __VA_ARGS__); \
+ } while (0)
#endif
enum {
--
2.43.0.472.g3155946c3a-goog
- [PATCH 0/4] hw/i2c: smbus: Reset fixes, Joe Komlodi, 2024/01/10
- [PATCH 1/4] hw/i2c: core: Add reset, Joe Komlodi, 2024/01/10
- [PATCH 3/4] hw/i2c: smbus_slave: Reset state on reset, Joe Komlodi, 2024/01/10
- [PATCH 2/4] hw/i2c/smbus_slave: Add object path on error prints,
Joe Komlodi <=
- [PATCH 4/4] hw/i2c: smbus: mux: Reset SMBusDevice state on reset, Joe Komlodi, 2024/01/10
- Re: [PATCH 0/4] hw/i2c: smbus: Reset fixes, Joe Komlodi, 2024/01/10
- Re: [PATCH 0/4] hw/i2c: smbus: Reset fixes, Corey Minyard, 2024/01/11