diff options
author | Tzafrir Cohen <tzafrir.cohen@xorcom.com> | 2012-05-23 12:36:42 +0000 |
---|---|---|
committer | Tzafrir Cohen <tzafrir.cohen@xorcom.com> | 2012-05-23 12:36:42 +0000 |
commit | 94b80ba13567379ef2fc4e7efd7ac3d87515f242 (patch) | |
tree | 038e96a47bfde7eae92dbbc80eadaba8162525cc /drivers/dahdi/dahdi-sysfs.c | |
parent | 3359e84a8d937b96153af9b1d608b68f9c0a949b (diff) |
sysfs: refactor lineconfig string representation
Signed-off-by: Shaun Ruffell <sruffell@digium.com>
Acked-by: Tzafrir Cohen <tzafrir.cohen@xorcom.com>
git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@10685 a0bf4364-ded3-4de4-8d8a-66a801d63aff
Diffstat (limited to 'drivers/dahdi/dahdi-sysfs.c')
-rw-r--r-- | drivers/dahdi/dahdi-sysfs.c | 20 |
1 files changed, 1 insertions, 19 deletions
diff --git a/drivers/dahdi/dahdi-sysfs.c b/drivers/dahdi/dahdi-sysfs.c index d7bf608..1715f8f 100644 --- a/drivers/dahdi/dahdi-sysfs.c +++ b/drivers/dahdi/dahdi-sysfs.c @@ -179,25 +179,7 @@ static BUS_ATTR_READER(lineconfig_show, dev, buf) int len = 0; span = dev_to_span(dev); - if (span->lineconfig) { - /* framing first */ - if (span->lineconfig & DAHDI_CONFIG_B8ZS) - len += sprintf(buf + len, "B8ZS/"); - else if (span->lineconfig & DAHDI_CONFIG_AMI) - len += sprintf(buf + len, "AMI/"); - else if (span->lineconfig & DAHDI_CONFIG_HDB3) - len += sprintf(buf + len, "HDB3/"); - /* then coding */ - if (span->lineconfig & DAHDI_CONFIG_ESF) - len += sprintf(buf + len, "ESF"); - else if (span->lineconfig & DAHDI_CONFIG_D4) - len += sprintf(buf + len, "D4"); - else if (span->lineconfig & DAHDI_CONFIG_CCS) - len += sprintf(buf + len, "CCS"); - /* E1's can enable CRC checking */ - if (span->lineconfig & DAHDI_CONFIG_CRC4) - len += sprintf(buf + len, "/CRC4"); - } + len += lineconfig_str(span->lineconfig, buf, 20); len += sprintf(buf + len, "\n"); return len; } |