mirror of
https://github.com/lm-sensors/lm-sensors
synced 2025-08-30 13:57:41 +00:00
Minor clean-up in i2c_probe.
git-svn-id: http://lm-sensors.org/svn/lm-sensors/branches/lm-sensors-3.0.0@5472 7894878c-1315-0410-8ee3-d5d059ff63e0
This commit is contained in:
parent
e0e74f7033
commit
e955d2cd6e
@ -2391,7 +2391,6 @@ sub i2c_smbus_read_word_data
|
|||||||
sub i2c_probe
|
sub i2c_probe
|
||||||
{
|
{
|
||||||
my ($file, $addr, $funcs) = @_;
|
my ($file, $addr, $funcs) = @_;
|
||||||
my $data = [];
|
|
||||||
|
|
||||||
if (($addr >= 0x50 && $addr <= 0x5F)
|
if (($addr >= 0x50 && $addr <= 0x5F)
|
||||||
|| ($addr >= 0x30 && $addr <= 0x37)) {
|
|| ($addr >= 0x30 && $addr <= 0x37)) {
|
||||||
@ -2402,10 +2401,10 @@ sub i2c_probe
|
|||||||
# themselves permanently on almost any write to their page
|
# themselves permanently on almost any write to their page
|
||||||
# protection address.
|
# protection address.
|
||||||
return 0 unless ($funcs & I2C_FUNC_SMBUS_READ_BYTE);
|
return 0 unless ($funcs & I2C_FUNC_SMBUS_READ_BYTE);
|
||||||
return i2c_smbus_access($file, SMBUS_READ, 0, SMBUS_BYTE, $data);
|
return i2c_smbus_access($file, SMBUS_READ, 0, SMBUS_BYTE, []);
|
||||||
} else {
|
} else {
|
||||||
return 0 unless ($funcs & I2C_FUNC_SMBUS_QUICK);
|
return 0 unless ($funcs & I2C_FUNC_SMBUS_QUICK);
|
||||||
return i2c_smbus_access($file, SMBUS_WRITE, 0, SMBUS_QUICK, $data);
|
return i2c_smbus_access($file, SMBUS_WRITE, 0, SMBUS_QUICK, []);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user