summaryrefslogtreecommitdiff
path: root/drivers/usb/core/port.c
diff options
context:
space:
mode:
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>2013-08-23 16:05:26 -0700
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2013-08-25 15:12:03 -0700
commitd03f254f2ee2a708af9a7347402d9aed7f6cc4c1 (patch)
treef07afa1896e3d87385f3aa0bcc475ed5874ac210 /drivers/usb/core/port.c
parent598d03610a0169eb88d2b08d6743be31b3b9c258 (diff)
USB: core: be specific about attribute permissions
Instead of having to audit all sysfs attributes, to ensure we get them right, use the default macros the driver core provides us (read-only, read-write) to make the code simpler, and to prevent any mistakes from ever happening. Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/usb/core/port.c')
-rw-r--r--drivers/usb/core/port.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/drivers/usb/core/port.c b/drivers/usb/core/port.c
index 9909911665ce..51542f852393 100644
--- a/drivers/usb/core/port.c
+++ b/drivers/usb/core/port.c
@@ -23,8 +23,8 @@
static const struct attribute_group *port_dev_group[];
-static ssize_t show_port_connect_type(struct device *dev,
- struct device_attribute *attr, char *buf)
+static ssize_t connect_type_show(struct device *dev,
+ struct device_attribute *attr, char *buf)
{
struct usb_port *port_dev = to_usb_port(dev);
char *result;
@@ -46,8 +46,7 @@ static ssize_t show_port_connect_type(struct device *dev,
return sprintf(buf, "%s\n", result);
}
-static DEVICE_ATTR(connect_type, S_IRUGO, show_port_connect_type,
- NULL);
+static DEVICE_ATTR_RO(connect_type);
static struct attribute *port_dev_attrs[] = {
&dev_attr_connect_type.attr,