提交 1739a2d8 编写于 作者: B Bartosz Golaszewski 提交者: Linus Walleij

gpiolib: use gpiochip_get_desc() where applicable

Whenever retrieving a descriptor from a gpiochip: use the provided
helper which checks for errors.
Signed-off-by: NBartosz Golaszewski <bgolaszewski@baylibre.com>
Link: https://lore.kernel.org/r/20200219094702.6463-1-brgl@bgdev.plSigned-off-by: NLinus Walleij <linus.walleij@linaro.org>
上级 023892ec
......@@ -3143,7 +3143,9 @@ const char *gpiochip_is_requested(struct gpio_chip *chip, unsigned offset)
if (offset >= chip->ngpio)
return NULL;
desc = &chip->gpiodev->descs[offset];
desc = gpiochip_get_desc(chip, offset);
if (IS_ERR(desc))
return NULL;
if (test_bit(FLAG_REQUESTED, &desc->flags) == 0)
return NULL;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册