diff options
author | Simon Arlott <simon@fire.lp0.eu> | 2009-11-21 10:03:23 -0500 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2010-03-02 17:52:57 -0500 |
commit | 1bfbd283cd3082b6cadfbf340faf7d35b8a36b83 (patch) | |
tree | f01f9d74dcd3e829449953b5d84a26013a5c2f42 | |
parent | 4e0fa90d1de10d68429afa9353e10bb9436455db (diff) |
USB: cxacru: return an empty value for modulation if there is no connection
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>
-rw-r--r-- | Documentation/networking/cxacru.txt | 1 | ||||
-rw-r--r-- | drivers/usb/atm/cxacru.c | 4 |
2 files changed, 3 insertions, 2 deletions
diff --git a/Documentation/networking/cxacru.txt b/Documentation/networking/cxacru.txt index b074681a963e..3532ceecd2c3 100644 --- a/Documentation/networking/cxacru.txt +++ b/Documentation/networking/cxacru.txt | |||
@@ -61,6 +61,7 @@ several sysfs attribute files for retrieving device statistics: | |||
61 | * mac_address | 61 | * mac_address |
62 | 62 | ||
63 | * modulation | 63 | * modulation |
64 | "" (when not connected) | ||
64 | "ANSI T1.413" | 65 | "ANSI T1.413" |
65 | "ITU-T G.992.1 (G.DMT)" | 66 | "ITU-T G.992.1 (G.DMT)" |
66 | "ITU-T G.992.2 (G.LITE)" | 67 | "ITU-T G.992.2 (G.LITE)" |
diff --git a/drivers/usb/atm/cxacru.c b/drivers/usb/atm/cxacru.c index 56802d2e994b..4a26a6c93bec 100644 --- a/drivers/usb/atm/cxacru.c +++ b/drivers/usb/atm/cxacru.c | |||
@@ -267,12 +267,12 @@ static ssize_t cxacru_sysfs_showattr_LINE(u32 value, char *buf) | |||
267 | static ssize_t cxacru_sysfs_showattr_MODU(u32 value, char *buf) | 267 | static ssize_t cxacru_sysfs_showattr_MODU(u32 value, char *buf) |
268 | { | 268 | { |
269 | static char *str[] = { | 269 | static char *str[] = { |
270 | NULL, | 270 | "", |
271 | "ANSI T1.413", | 271 | "ANSI T1.413", |
272 | "ITU-T G.992.1 (G.DMT)", | 272 | "ITU-T G.992.1 (G.DMT)", |
273 | "ITU-T G.992.2 (G.LITE)" | 273 | "ITU-T G.992.2 (G.LITE)" |
274 | }; | 274 | }; |
275 | if (unlikely(value >= ARRAY_SIZE(str) || str[value] == NULL)) | 275 | if (unlikely(value >= ARRAY_SIZE(str))) |
276 | return snprintf(buf, PAGE_SIZE, "%u\n", value); | 276 | return snprintf(buf, PAGE_SIZE, "%u\n", value); |
277 | return snprintf(buf, PAGE_SIZE, "%s\n", str[value]); | 277 | return snprintf(buf, PAGE_SIZE, "%s\n", str[value]); |
278 | } | 278 | } |