Check for capabilities before using them. Reported by Aurelien

Jarno.


git-svn-id: http://lm-sensors.org/svn/lm-sensors/trunk@2360 7894878c-1315-0410-8ee3-d5d059ff63e0
This commit is contained in:
Jean Delvare committed 2004-03-16 19:28:40 +00:00
1 parent 9b65707bd1
commit c44b1691cc
2 files changed
+4 -2

No files matched your search

+2 -1
View File
@@ -183,7 +183,8 @@ int ds1621_detect(struct i2c_adapter *adapter, int address,
#endif
if (!i2c_check_functionality(adapter, I2C_FUNC_SMBUS_BYTE_DATA |
I2C_FUNC_SMBUS_WORD_DATA))
I2C_FUNC_SMBUS_WORD_DATA |
I2C_FUNC_SMBUS_WRITE_BYTE))
goto ERROR0;
/* OK. For now, we presume we have a valid client. We now create the
+2 -1
View File
@@ -179,7 +179,8 @@ int pcf8591_detect(struct i2c_adapter *adapter, int address,
}
#endif
if (!i2c_check_functionality(adapter, I2C_FUNC_SMBUS_BYTE))
if (!i2c_check_functionality(adapter, I2C_FUNC_SMBUS_BYTE
| I2C_FUNC_SMBUS_WRITE_BYTE_DATA))
goto ERROR0;
/* OK. For now, we presume we have a valid client. We now create the