From 89dcefb5af9651a4496ed53949ee0e287714f28b Mon Sep 17 00:00:00 2001 From: Greg Kroah-Hartman Date: Sat, 24 Aug 2013 10:30:28 -0700 Subject: [PATCH] staging: frontier: use better DEVICE_ATTR_ macros MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Use the DEVICE_ATTR_RO/RW macros to better describe the permissions on the file, and make them easier to audit. Cc: David Täht Cc: Sara Bird Cc: Masanari Iida Signed-off-by: Greg Kroah-Hartman --- drivers/staging/frontier/tranzport.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/drivers/staging/frontier/tranzport.c b/drivers/staging/frontier/tranzport.c index 6cbf9c7c1d38..074b0e5bcc68 100644 --- a/drivers/staging/frontier/tranzport.c +++ b/drivers/staging/frontier/tranzport.c @@ -177,24 +177,24 @@ static void usb_tranzport_abort_transfers(struct usb_tranzport *dev) } #define show_int(value) \ - static ssize_t show_##value(struct device *dev, \ + static ssize_t value##_show(struct device *dev, \ struct device_attribute *attr, char *buf) \ { \ struct usb_interface *intf = to_usb_interface(dev); \ struct usb_tranzport *t = usb_get_intfdata(intf); \ return sprintf(buf, "%d\n", t->value); \ } \ - static DEVICE_ATTR(value, S_IRUGO, show_##value, NULL); + static DEVICE_ATTR_RO(value) #define show_set_int(value) \ - static ssize_t show_##value(struct device *dev, \ + static ssize_t value##_show(struct device *dev, \ struct device_attribute *attr, char *buf) \ { \ struct usb_interface *intf = to_usb_interface(dev); \ struct usb_tranzport *t = usb_get_intfdata(intf); \ return sprintf(buf, "%d\n", t->value); \ } \ - static ssize_t set_##value(struct device *dev, \ + static ssize_t value##_store(struct device *dev, \ struct device_attribute *attr, \ const char *buf, size_t count) \ { \ @@ -206,7 +206,7 @@ static void usb_tranzport_abort_transfers(struct usb_tranzport *dev) t->value = temp; \ return count; \ } \ - static DEVICE_ATTR(value, S_IWUSR | S_IRUGO, show_##value, set_##value); + static DEVICE_ATTR_RW(value) show_int(enable); show_int(offline); -- 2.30.2