summaryrefslogtreecommitdiff
path: root/xpp/perl_modules/Dahdi/Xpp.pm
diff options
context:
space:
mode:
authorTzafrir Cohen <tzafrir.cohen@xorcom.com>2012-03-15 20:32:27 +0000
committerTzafrir Cohen <tzafrir.cohen@xorcom.com>2012-03-15 20:32:27 +0000
commit906c7e3f92de6e3e0e2193ecdb0f232a40fd1d7e (patch)
treef6b1183639db85c81da55b3e97da8385d169bc1e /xpp/perl_modules/Dahdi/Xpp.pm
parentab44f81dde27cb645a2934e71956b40dc1eb581f (diff)
xpp: sysfs access cleanups
With /proc/xpp code removed, some cleanup can be done. * No need to search alternative attribute names, so xbus_attr_path() is redundant. * Don't compose xbus sysfs directory in multiple code locations. Do it once in Xbus->new() and use the result ($xbus->sysfs_dir) * Pass XPD directory strings directly to Xpd->new() - So we parse it for unit/subunit only in Xpd->new() * Don't parse xbus sysfs name: - Toplevel scan, pass it as is to Xbus->new() - Xbus->new() deduce the xbus->num from the naming of Xpd's inside (nn:m:k) -- this is a hack until we add xbus number as an xbus sysfs attribute Signed-off-by: Oron Peled <oron.peled@xorcom.com> Acked-by: Tzafrir Cohen <tzafrir.cohen@xorcom.com> git-svn-id: http://svn.asterisk.org/svn/dahdi/tools/trunk@10494 a0bf4364-ded3-4de4-8d8a-66a801d63aff
Diffstat (limited to 'xpp/perl_modules/Dahdi/Xpp.pm')
-rw-r--r--xpp/perl_modules/Dahdi/Xpp.pm4
1 files changed, 2 insertions, 2 deletions
diff --git a/xpp/perl_modules/Dahdi/Xpp.pm b/xpp/perl_modules/Dahdi/Xpp.pm
index 765b59e..3acd2ef 100644
--- a/xpp/perl_modules/Dahdi/Xpp.pm
+++ b/xpp/perl_modules/Dahdi/Xpp.pm
@@ -50,8 +50,8 @@ sub scan($) {
opendir(D, $sysfs_astribanks) || return();
while(my $entry = readdir D) {
- next unless $entry =~ /xbus-(\d+)/;
- my $xbus = Dahdi::Xpp::Xbus->new($1);
+ next if $entry eq '.' or $entry eq '..';
+ my $xbus = Dahdi::Xpp::Xbus->new($sysfs_astribanks, $entry);
push(@xbuses, $xbus);
}
closedir D;