]> git.baikalelectronics.ru Git - kernel.git/commit
drivers: thermal: tsens: Release device in success path
authorAmit Kucheria <amit.kucheria@linaro.org>
Thu, 12 Mar 2020 12:37:01 +0000 (18:07 +0530)
committerDaniel Lezcano <daniel.lezcano@linaro.org>
Fri, 20 Mar 2020 11:17:48 +0000 (12:17 +0100)
commit5c892fc30294c3df1d742d55ffbbd86890f91de4
tree327229fb0649f0ee40e04415ddafe16718d2f8f9
parent74ad5d2dc75e88897b75a8cf258408eda421a657
drivers: thermal: tsens: Release device in success path

We don't currently call put_device in case of successfully initialising
the device. So we hold the reference and keep the device pinned forever.

Allow control to fall through so we can use same code for success and
error paths to put_device.

As a part of this fixup, change devm_ioremap_resource to act on the same
device pointer as that used to allocate regmap memory. That ensures that
we are free to release op->dev after examining its resources.

Signed-off-by: Amit Kucheria <amit.kucheria@linaro.org>
Reviewed-by: Bjorn Andersson <bjorn.andersson@linaro.org>
Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org>
Link: https://lore.kernel.org/r/d3996667e9f976bb30e97e301585cb1023be422e.1584015867.git.amit.kucheria@linaro.org
drivers/thermal/qcom/tsens-common.c