USB: cxacru: return an empty value for modulation if there is no connection
authorSimon Arlott <simon@fire.lp0.eu>
Sat, 21 Nov 2009 15:03:23 +0000 (15:03 +0000)
committerGreg Kroah-Hartman <gregkh@suse.de>
Tue, 2 Mar 2010 22:52:57 +0000 (14:52 -0800)
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>
Documentation/networking/cxacru.txt
drivers/usb/atm/cxacru.c

index b074681a963e0a5acf7d1f0849d940ddbda4b696..3532ceecd2c321c62588cd83961fb479e7dc4e99 100644 (file)
@@ -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)"
index 56802d2e994ba24cd672e6671e56cc49e90ecde1..4a26a6c93bec20d1ac69ba0e601c69c0d9969915 100644 (file)
@@ -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]);
 }