usb: gadget: udc-core: anywone can read 'speed' attributes
authorFelipe Balbi <balbi@ti.com>
Tue, 26 Feb 2013 17:15:14 +0000 (19:15 +0200)
committerFelipe Balbi <balbi@ti.com>
Mon, 18 Mar 2013 09:17:56 +0000 (11:17 +0200)
current code only allows the file owner (usually
root) to read current_speed and maximum_speed
sysfs files. Let anyone read those.

Signed-off-by: Felipe Balbi <balbi@ti.com>
drivers/usb/gadget/udc-core.c

index 26e116bd6f595ddeef539bd861a2ca8db64072c9..7999cc656979a5f8a7bab69368a3c8f09b950b5b 100644 (file)
@@ -471,7 +471,7 @@ ssize_t usb_udc_##param##_show(struct device *dev,                  \
        return snprintf(buf, PAGE_SIZE, "%s\n",                         \
                        usb_speed_string(udc->gadget->param));          \
 }                                                                      \
-static DEVICE_ATTR(name, S_IRUSR, usb_udc_##param##_show, NULL)
+static DEVICE_ATTR(name, S_IRUGO, usb_udc_##param##_show, NULL)
 
 static USB_UDC_SPEED_ATTR(current_speed, speed);
 static USB_UDC_SPEED_ATTR(maximum_speed, max_speed);