summaryrefslogtreecommitdiff
path: root/drivers/iio/inkern.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2014-07-03 19:11:48 -0700
committerLinus Torvalds <torvalds@linux-foundation.org>2014-07-03 19:11:48 -0700
commit9911f2e1541aacf8f7ef48fd4e35382fdb61ff6c (patch)
treeb38b57fdb8f247605dbcd84f8b378fc78e1d566d /drivers/iio/inkern.c
parent3089f54a7928d28645661c2f3d829e3939d60dd3 (diff)
parent6b64168de843b16e96a22f9e98c6afc92ee1da71 (diff)
Merge tag 'staging-3.16-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging
Pull staging driver bugfixes from Greg KH: "Nothing major here, just 4 small bugfixes that resolve some issues reported for the IIO (staging and non-staging) and the tidspbridge driver" * tag 'staging-3.16-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging: staging: tidspbridge: fix an erroneous removal of parentheses iio: of_iio_channel_get_by_name() returns non-null pointers for error legs staging: iio/ad7291: fix error code in ad7291_probe() iio:adc:ad799x: Fix reading and writing of event values, apply shift
Diffstat (limited to 'drivers/iio/inkern.c')
-rw-r--r--drivers/iio/inkern.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/drivers/iio/inkern.c b/drivers/iio/inkern.c
index d833d55052ea..c7497009d60a 100644
--- a/drivers/iio/inkern.c
+++ b/drivers/iio/inkern.c
@@ -183,7 +183,7 @@ static struct iio_channel *of_iio_channel_get_by_name(struct device_node *np,
else if (name && index >= 0) {
pr_err("ERROR: could not get IIO channel %s:%s(%i)\n",
np->full_name, name ? name : "", index);
- return chan;
+ return NULL;
}
/*
@@ -193,8 +193,9 @@ static struct iio_channel *of_iio_channel_get_by_name(struct device_node *np,
*/
np = np->parent;
if (np && !of_get_property(np, "io-channel-ranges", NULL))
- break;
+ return NULL;
}
+
return chan;
}
@@ -317,6 +318,7 @@ struct iio_channel *iio_channel_get(struct device *dev,
if (channel != NULL)
return channel;
}
+
return iio_channel_get_sys(name, channel_name);
}
EXPORT_SYMBOL_GPL(iio_channel_get);