]> www.infradead.org Git - users/jedix/linux-maple.git/commit
iio: light: gp2ap002: Fix rumtime PM imbalance on error
authorDinghao Liu <dinghao.liu@zju.edu.cn>
Wed, 7 Apr 2021 03:49:27 +0000 (11:49 +0800)
committerJonathan Cameron <Jonathan.Cameron@huawei.com>
Sun, 18 Apr 2021 09:37:54 +0000 (10:37 +0100)
commitfbecba8b838b68ec94f52e838a80be1e67015843
treeef10684bfdc0b49673959e8ac7b246c25c28f225
parente49d033bddf5b565044e2abe4241353959bc9120
iio: light: gp2ap002: Fix rumtime PM imbalance on error

When devm_request_threaded_irq() fails, we should decrease the
runtime PM counter to keep the counter balanced. But when
iio_device_register() fails, we need not to decrease it because
we have already decreased it before.

Signed-off-by: Dinghao Liu <dinghao.liu@zju.edu.cn>
Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
Fixes: 97d642e23037 ("iio: light: Add a driver for Sharp GP2AP002x00F")
Link: https://lore.kernel.org/r/20210407034927.16882-1-dinghao.liu@zju.edu.cn
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
drivers/iio/light/gp2ap002.c