All of lore.kernel.org
 help / color / mirror / Atom feed
From: Hartmut Knaack <knaack.h@gmx.de>
To: linux-iio@vger.kernel.org
Subject: [RFC]iio:industrialio-event fix error-handling in iio_device_add_event
Date: Sun, 29 Dec 2013 12:54:29 +0100	[thread overview]
Message-ID: <52C00D75.70302@gmx.de> (raw)

__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++;

             reply	other threads:[~2013-12-29 11:54 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-12-29 11:54 Hartmut Knaack [this message]
2014-01-01 12:47 ` [RFC]iio:industrialio-event fix error-handling in iio_device_add_event 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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=52C00D75.70302@gmx.de \
    --to=knaack.h@gmx.de \
    --cc=linux-iio@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.