From 4884bd86527583dcad1589147d071b4866108762 Mon Sep 17 00:00:00 2001 From: Jean Delvare Date: Mon, 24 Nov 2008 17:26:33 +0000 Subject: [PATCH] Clean up smartbatt_detect. git-svn-id: http://lm-sensors.org/svn/lm-sensors/branches/lm-sensors-3.0.0@5428 7894878c-1315-0410-8ee3-d5d059ff63e0 --- prog/detect/sensors-detect | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) diff --git a/prog/detect/sensors-detect b/prog/detect/sensors-detect index 11fd33a5..a8ccc57d 100755 --- a/prog/detect/sensors-detect +++ b/prog/detect/sensors-detect @@ -4813,16 +4813,10 @@ sub fintek_detect sub smartbatt_detect { my ($file, $addr) = @_; - # check some registers - if (i2c_smbus_read_word_data($file, 0x08) == 0xffff) { - return; - } - if (i2c_smbus_read_word_data($file, 0x09) == 0xffff) { - return; - } - if (i2c_smbus_read_word_data($file, 0x0a) == 0xffff) { - return; - } + + return if i2c_smbus_read_word_data($file, 0x08) == 0xffff + || i2c_smbus_read_word_data($file, 0x09) == 0xffff + || i2c_smbus_read_word_data($file, 0x0a) == 0xffff; return (5); }