Skip to content
Commit 0187294d authored by Dinghao Liu's avatar Dinghao Liu Committed by Jonathan Cameron
Browse files

iio: magnetometer: ak8974: Fix runtime PM imbalance on error



When devm_regmap_init_i2c() returns an error code, a pairing
runtime PM usage counter decrement is needed to keep the
counter balanced. For error paths after ak8974_set_power(),
ak8974_detect() and ak8974_reset(), things are the same.

However, When iio_triggered_buffer_setup() returns an error
code, there will be two PM usgae counter decrements.

Signed-off-by: default avatarDinghao Liu <dinghao.liu@zju.edu.cn>
Fixes: 7c94a8b2 ("iio: magn: add a driver for AK8974")
Reviewed-by: default avatarLinus Walleij <linus.walleij@linaro.org>
Cc: <Stable@vger.kernel.org>
Signed-off-by: default avatarJonathan Cameron <Jonathan.Cameron@huawei.com>
parent d7369ae1
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment