* Due to the structure of pre-exisiting code, don't use assembler line
* comment character # to ignore the arguments. Instead, use a dummy macro.
*/
--.macro cfi_ignore a=0, b=0, c=0, d=0
++.macro cfi_ignore a=0, b=0, c=0, d=0, e=0, f=0, g=0, h=0
.endm
#define CFI_STARTPROC cfi_ignore
static int iio_event_getfd(struct iio_dev *indio_dev)
{
- if (indio_dev->event_interface == NULL)
++ struct iio_event_interface *ev_int = indio_dev->event_interface;
+ int fd;
+
- if (indio_dev->event_interface == NULL)
++ if (ev_int == NULL)
return -ENODEV;
-- mutex_lock(&indio_dev->event_interface->event_list_lock);
-- if (test_and_set_bit(IIO_BUSY_BIT_POS,
-- &indio_dev->event_interface->flags)) {
-- mutex_unlock(&indio_dev->event_interface->event_list_lock);
++ mutex_lock(&ev_int->event_list_lock);
++ if (test_and_set_bit(IIO_BUSY_BIT_POS, &ev_int->flags)) {
++ mutex_unlock(&ev_int->event_list_lock);
return -EBUSY;
}
-- mutex_unlock(&indio_dev->event_interface->event_list_lock);
- return anon_inode_getfd("iio:event",
- &iio_event_chrdev_fileops,
- indio_dev->event_interface, O_RDONLY);
- fd = anon_inode_getfd("iio:event",
- &iio_event_chrdev_fileops,
- indio_dev->event_interface, O_RDONLY);
++ mutex_unlock(&ev_int->event_list_lock);
++ fd = anon_inode_getfd("iio:event", &iio_event_chrdev_fileops,
++ ev_int, O_RDONLY);
+ if (fd < 0) {
- mutex_lock(&indio_dev->event_interface->event_list_lock);
++ mutex_lock(&ev_int->event_list_lock);
+ clear_bit(IIO_BUSY_BIT_POS, &ev_int->flags);
- mutex_unlock(&indio_dev->event_interface->event_list_lock);
++ mutex_unlock(&ev_int->event_list_lock);
+ }
+ return fd;
}
static int __init iio_init(void)