diff options
| author | Wolfgang Denk <wd@nyx.denx.de> | 2005-07-28 10:42:26 +0200 | 
|---|---|---|
| committer | Wolfgang Denk <wd@nyx.denx.de> | 2005-07-28 10:42:26 +0200 | 
| commit | 15f36a5efd31fe608b43dc197ebbd80d3cecbe44 (patch) | |
| tree | 0c3e6451f2cc4c3ede4302b13458ae5385c9780c /post/sysmon.c | |
| parent | e82bc62c038859b5bf7daae1bc24b7226f9ed74a (diff) | |
| download | olio-uboot-2014.01-15f36a5efd31fe608b43dc197ebbd80d3cecbe44.tar.xz olio-uboot-2014.01-15f36a5efd31fe608b43dc197ebbd80d3cecbe44.zip | |
Fix sysmon POST problem: check I2C error codes
This fixes a problem of displaying bogus voltages when the voltages
are so low that the I2C devices start failing while the rest of the
system keeps running.
Diffstat (limited to 'post/sysmon.c')
| -rw-r--r-- | post/sysmon.c | 13 | 
1 files changed, 11 insertions, 2 deletions
| diff --git a/post/sysmon.c b/post/sysmon.c index 8758ccdc0..72fcac385 100644 --- a/post/sysmon.c +++ b/post/sysmon.c @@ -185,6 +185,10 @@ static char *sysmon_unit_value (sysmon_table_t *s, uint val)  	char *p, sign;  	int dec, frac; +	if (val == -1) { +		return "I/O ERROR"; +	} +  	if (unit_val < 0) {  		sign = '-';  		unit_val = -unit_val; @@ -297,8 +301,13 @@ int sysmon_post_test (int flags)  		}  		val = t->sysmon->read(t->sysmon, t->addr); -		t->val_valid = val >= t->val_min && val <= t->val_max; -		t->val_valid_alt = val >= t->val_min_alt && val <= t->val_max_alt; +		if (val != -1) { +			t->val_valid = val >= t->val_min && val <= t->val_max; +			t->val_valid_alt = val >= t->val_min_alt && val <= t->val_max_alt; +		} else { +			t->val_valid = 0; +			t->val_valid_alt = 0; +		}  		if (t->exec_after) {  			t->exec_after(t); |