mirror of
https://github.com/lm-sensors/lm-sensors.git
synced 2026-11-19 19:40:49 +00:00
Reindent sysfs helpers.
git-svn-id: http://lm-sensors.org/svn/lm-sensors/branches/lm-sensors-3.0.0@5444 7894878c-1315-0410-8ee3-d5d059ff63e0
This commit is contained in:
1 parent
3ee60a6fac
commit
88cab8add5
1 file changed
+14
-13
+14
-13
@@ -2360,28 +2360,29 @@ sub unload_modules
|
||||
#################
|
||||
|
||||
# From a sysfs device path, return the driver (module) name, or undef
|
||||
sub sysfs_device_driver($)
|
||||
sub sysfs_device_driver
|
||||
{
|
||||
my $device = shift;
|
||||
my $device = shift;
|
||||
|
||||
my $link = readlink("$device/driver/module");
|
||||
return unless defined $link;
|
||||
return basename($link);
|
||||
my $link = readlink("$device/driver/module");
|
||||
return unless defined $link;
|
||||
return basename($link);
|
||||
}
|
||||
|
||||
# From a sysfs device path and an attribute name, return the attribute
|
||||
# value, or undef
|
||||
sub sysfs_device_attribute($$)
|
||||
sub sysfs_device_attribute
|
||||
{
|
||||
my ($device, $attr) = @_;
|
||||
my $value;
|
||||
my ($device, $attr) = @_;
|
||||
my $value;
|
||||
|
||||
open(local *FILE, "$device/$attr") or return;
|
||||
return unless defined($value = <FILE>);
|
||||
close(FILE);
|
||||
open(local *FILE, "$device/$attr") or return;
|
||||
$value = <FILE>;
|
||||
close(FILE);
|
||||
return unless defined $value;
|
||||
|
||||
chomp($value);
|
||||
return $value;
|
||||
chomp($value);
|
||||
return $value;
|
||||
}
|
||||
|
||||
##############
|
||||
|
||||
Reference in new issue
Block a user