linux-iio.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [RFC]iio:industrialio-event fix error-handling in iio_device_add_event
@ 2013-12-29 11:54 Hartmut Knaack
  2014-01-01 12:47 ` Jonathan Cameron
  0 siblings, 1 reply; 6+ messages in thread
From: Hartmut Knaack @ 2013-12-29 11:54 UTC (permalink / raw)
  To: linux-iio

__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@gmx.de>
---
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++;

^ permalink raw reply related	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2014-02-08 12:07 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-12-29 11:54 [RFC]iio:industrialio-event fix error-handling in iio_device_add_event Hartmut Knaack
2014-01-01 12:47 ` Jonathan Cameron
2014-02-08  0:07   ` Hartmut Knaack
2014-02-08 10:14     ` Jonathan Cameron
2014-02-08 11:43       ` Hartmut Knaack
2014-02-08 12:08         ` Jonathan Cameron

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).