Skip to content

Commit

Permalink
USB: cxacru: return an empty value for modulation if there is no conn…
Browse files Browse the repository at this point in the history
…ection

When there is no connection, return an empty string
instead of "0" for the connection modulation.

Signed-off-by: Simon Arlott <simon@fire.lp0.eu>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
  • Loading branch information
Simon Arlott authored and Greg Kroah-Hartman committed Mar 2, 2010
1 parent 4e0fa90 commit 1bfbd28
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
1 change: 1 addition & 0 deletions Documentation/networking/cxacru.txt
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ several sysfs attribute files for retrieving device statistics:
* mac_address

* modulation
"" (when not connected)
"ANSI T1.413"
"ITU-T G.992.1 (G.DMT)"
"ITU-T G.992.2 (G.LITE)"
Expand Down
4 changes: 2 additions & 2 deletions drivers/usb/atm/cxacru.c
Original file line number Diff line number Diff line change
Expand Up @@ -267,12 +267,12 @@ static ssize_t cxacru_sysfs_showattr_LINE(u32 value, char *buf)
static ssize_t cxacru_sysfs_showattr_MODU(u32 value, char *buf)
{
static char *str[] = {
NULL,
"",
"ANSI T1.413",
"ITU-T G.992.1 (G.DMT)",
"ITU-T G.992.2 (G.LITE)"
};
if (unlikely(value >= ARRAY_SIZE(str) || str[value] == NULL))
if (unlikely(value >= ARRAY_SIZE(str)))
return snprintf(buf, PAGE_SIZE, "%u\n", value);
return snprintf(buf, PAGE_SIZE, "%s\n", str[value]);
}
Expand Down

0 comments on commit 1bfbd28

Please sign in to comment.