staging:iio: Add ability to have event attributes with awkward names
authorJonathan Cameron <jic23@cam.ac.uk>
Sat, 26 Jun 2010 11:54:22 +0000 (12:54 +0100)
committerGreg Kroah-Hartman <gregkh@suse.de>
Thu, 8 Jul 2010 19:25:29 +0000 (12:25 -0700)
Signed-off-by: Jonathan Cameron <jic23@cam.ac.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
drivers/staging/iio/sysfs.h

index 79926efec6d42c0a0fa0342126d6bbfbacc5372a..60834162eb320a7a3b529324fc2844220c2d0ace 100644 (file)
@@ -284,6 +284,14 @@ struct iio_const_attr {
            .mask = _mask,                                              \
            .listel = &_ev_list };
 
+#define IIO_EVENT_ATTR_NAMED_SH(_vname, _name, _ev_list, _show, _store, _mask) \
+       static struct iio_event_attr                                    \
+       iio_event_attr_##_vname                                         \
+       = { .dev_attr = __ATTR(_name, S_IRUGO | S_IWUSR,                \
+                              _show, _store),                          \
+           .mask = _mask,                                              \
+           .listel = &_ev_list };
+
 /**
  * IIO_EVENT_ATTR - non-shared event attribute
  * @_name: event name