PD#SWPL-11929
Problem:
request gpio failed but the probe function continued
to execute successfully.
Solution:
add return value judgment.
Verify:
test pass on g12a
Change-Id: Iab04b8440a4ecb340d98baee7b1e0df5692739e7
Signed-off-by: Yingyuan Zhu <yingyuan.zhu@amlogic.com>
for (i = 0; i < keypad->key_size; i++) {
//get all gpio desc.
desc = devm_gpiod_get_index(&pdev->dev, "key", i, GPIOD_IN);
- if (!desc)
+ if (IS_ERR_OR_NULL(desc))
return -EINVAL;
keypad->key[i].desc = desc;
//The gpio default is high level.