diff options
author | Vladimir Zapolskiy <vz@mleia.com> | 2017-12-21 17:37:30 +0100 |
---|---|---|
committer | Linus Walleij <linus.walleij@linaro.org> | 2018-01-02 09:33:07 +0100 |
commit | dd3b9a44083d3815517a692f8181be8c30c0a1aa (patch) | |
tree | d37fbe7375ea1f1f7bc68f89f0d80af243960694 /drivers/gpio | |
parent | gpiolib: don't dereference a desc before validation (diff) | |
download | linux-dd3b9a44083d3815517a692f8181be8c30c0a1aa.tar.xz linux-dd3b9a44083d3815517a692f8181be8c30c0a1aa.zip |
gpiolib: remove a redundant check in gpiod_to_chip()
This non-functional change slightly simplifies the implementation
of gpiod_to_chip() function.
Signed-off-by: Vladimir Zapolskiy <vz@mleia.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Diffstat (limited to 'drivers/gpio')
-rw-r--r-- | drivers/gpio/gpiolib.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/gpio/gpiolib.c b/drivers/gpio/gpiolib.c index 02cf658eeedd..c23cc6b586ba 100644 --- a/drivers/gpio/gpiolib.c +++ b/drivers/gpio/gpiolib.c @@ -161,7 +161,7 @@ EXPORT_SYMBOL_GPL(desc_to_gpio); */ struct gpio_chip *gpiod_to_chip(const struct gpio_desc *desc) { - if (!desc || !desc->gdev || !desc->gdev->chip) + if (!desc || !desc->gdev) return NULL; return desc->gdev->chip; } |