* small bit of common i2c / ddc white space cleanup

* small bit of tracing cleanup
* no functional change


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@42794 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Alexander von Gluck IV 2011-10-01 03:11:21 +00:00
parent ae347a6ce0
commit 39bc159e6e
2 changed files with 14 additions and 14 deletions

View File

@ -18,7 +18,6 @@
#define READ_RETRIES 4 // number of retries to read ddc data
#define TRACE_DDC
#ifdef TRACE_DDC
extern void _sPrintf(const char* format, ...);
@ -28,7 +27,6 @@ extern void _sPrintf(const char* format, ...);
#endif
//! Verify checksum of DDC data.
static status_t
verify_checksum(const uint8 *data, size_t len)
@ -43,12 +41,12 @@ verify_checksum(const uint8 *data, size_t len)
}
if (allOr == 0) {
TRACE("verify_checksum() DDC information contains zeros only\n");
TRACE("%s: DDC information contains zeros only\n", __func__);
return B_ERROR;
}
if (sum != 0) {
TRACE("verify_checksum() Checksum error in DDC information\n");
TRACE("%s: Checksum error in DDC information\n", __func__);
return B_IO_ERROR;
}
@ -72,14 +70,14 @@ ddc2_read(const i2c_bus *bus, int start, uint8 *buffer, size_t length)
start < 0x100 ? 1 : 2, buffer, length);
if (status != B_OK)
TRACE("ddc2_read(): DDC information read failure\n");
TRACE("%s: DDC information read failure\n", __func__);
if (status == B_OK) {
status = verify_checksum(buffer, length);
if (status == B_OK)
break;
dprintf("DDC checksum incorrect!\n");
dprintf("%s: DDC checksum incorrect!\n", __func__);
}
}
@ -159,7 +157,7 @@ ddc2_read_edid1(const i2c_bus *bus, edid1_info *edid,
return status;
if (raw.version.version != 1 || raw.version.revision > 4) {
TRACE("ddc2_read_edid1() EDID version or revision out of range\n");
TRACE("%s: EDID version or revision out of range\n", __func__);
return B_ERROR;
}

View File

@ -107,8 +107,10 @@ wait_for_clk(const i2c_bus *bus, bigtime_t timeout)
if (clk != 0)
return B_OK;
if (system_time() - startTime > timeout)
if (system_time() - startTime > timeout) {
TRACE("%s: Timeout waiting on clock (r)\n");
return B_TIMEOUT;
}
spin(bus->timing.r);
}