[RFC]iio:industrialio-event fix error-handling in iio_device_add_event

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



__iio_add_chan_devattr returns -EBUSY, when registering the event-interface of
ad799x, but iio_device_add_event does not catch it. So, handle it like in
iio_device_add_info_mask_type. Not sure, if this is the right solution, but it
makes the ad799x (and possibly others as well) usable.

Signed-off-by: Hartmut Knaack <knaack.h@xxxxxx>
---
diff --git a/drivers/iio/industrialio-event.c b/drivers/iio/industrialio-event.c
index c10eab6..d37a907 100644
--- a/drivers/iio/industrialio-event.c
+++ b/drivers/iio/industrialio-event.c
@@ -362,7 +362,9 @@ static int iio_device_add_event(struct iio_dev *indio_dev,
 			&indio_dev->event_interface->dev_attr_list);
 		kfree(postfix);
 
-		if (ret)
+		if ((ret == -EBUSY) && (shared_by != IIO_SEPARATE))
+			continue;
+		else if (ret < 0)
 			return ret;
 
 		attrcount++;
--
To unsubscribe from this list: send the line "unsubscribe linux-iio" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Input]     [Linux Kernel]     [Linux SCSI]     [X.org]

  Powered by Linux