aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/iio/inkern.c
diff options
context:
space:
mode:
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,
183 else if (name && index >= 0) { 183 else if (name && index >= 0) {
184 pr_err("ERROR: could not get IIO channel %s:%s(%i)\n", 184 pr_err("ERROR: could not get IIO channel %s:%s(%i)\n",
185 np->full_name, name ? name : "", index); 185 np->full_name, name ? name : "", index);
186 return chan; 186 return NULL;
187 } 187 }
188 188
189 /* 189 /*
@@ -193,8 +193,9 @@ static struct iio_channel *of_iio_channel_get_by_name(struct device_node *np,
193 */ 193 */
194 np = np->parent; 194 np = np->parent;
195 if (np && !of_get_property(np, "io-channel-ranges", NULL)) 195 if (np && !of_get_property(np, "io-channel-ranges", NULL))
196 break; 196 return NULL;
197 } 197 }
198
198 return chan; 199 return chan;
199} 200}
200 201
@@ -317,6 +318,7 @@ struct iio_channel *iio_channel_get(struct device *dev,
317 if (channel != NULL) 318 if (channel != NULL)
318 return channel; 319 return channel;
319 } 320 }
321
320 return iio_channel_get_sys(name, channel_name); 322 return iio_channel_get_sys(name, channel_name);
321} 323}
322EXPORT_SYMBOL_GPL(iio_channel_get); 324EXPORT_SYMBOL_GPL(iio_channel_get);