提交 d211c6e8 编写于 作者: A Axel Lin 提交者: Anton Vorontsov

generic-adc-battery: Fix checking if none of the channels are supported

If none of the channels are supported, index is 0. Also ensure to return
error code instead of 0 in goto second_mem_fail path.
Signed-off-by: NAxel Lin <axel.lin@ingics.com>
Acked-by: Nanish kumar <anish198519851985@gmail.com>
Signed-off-by: NAnton Vorontsov <anton@enomsg.org>
上级 e0835879
......@@ -299,8 +299,10 @@ static int gab_probe(struct platform_device *pdev)
}
/* none of the channels are supported so let's bail out */
if (index == ARRAY_SIZE(gab_chan_name))
if (index == 0) {
ret = -ENODEV;
goto second_mem_fail;
}
/*
* Total number of properties is equal to static properties
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册