summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAmit Kucheria <amit.kucheria@linaro.org>2020-03-12 18:07:01 +0530
committerDaniel Lezcano <daniel.lezcano@linaro.org>2020-03-20 12:17:48 +0100
commitf22a3bf0d2225fba438c46a25d3ab8823585a5e0 (patch)
tree327229fb0649f0ee40e04415ddafe16718d2f8f9
parentc1c6f3b39c043b8c7312ad691bae88fea201161d (diff)
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
-rw-r--r--drivers/thermal/qcom/tsens-common.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/drivers/thermal/qcom/tsens-common.c b/drivers/thermal/qcom/tsens-common.c
index f044788681c4..fd3b56d52341 100644
--- a/drivers/thermal/qcom/tsens-common.c
+++ b/drivers/thermal/qcom/tsens-common.c
@@ -603,7 +603,7 @@ int __init init_common(struct tsens_priv *priv)
/* DT with separate SROT and TM address space */
priv->tm_offset = 0;
res = platform_get_resource(op, IORESOURCE_MEM, 1);
- srot_base = devm_ioremap_resource(&op->dev, res);
+ srot_base = devm_ioremap_resource(dev, res);
if (IS_ERR(srot_base)) {
ret = PTR_ERR(srot_base);
goto err_put_device;
@@ -621,7 +621,7 @@ int __init init_common(struct tsens_priv *priv)
}
res = platform_get_resource(op, IORESOURCE_MEM, 0);
- tm_base = devm_ioremap_resource(&op->dev, res);
+ tm_base = devm_ioremap_resource(dev, res);
if (IS_ERR(tm_base)) {
ret = PTR_ERR(tm_base);
goto err_put_device;
@@ -688,8 +688,6 @@ int __init init_common(struct tsens_priv *priv)
tsens_enable_irq(priv);
tsens_debug_init(op);
- return 0;
-
err_put_device:
put_device(&op->dev);
return ret;
drm-misc/tag/?h=drm-misc-fixes-2024-08-15'>drm-misc-fixes-2024-08-15commit fd45cc614b...Thomas Zimmermann5 months drm-misc-next-2024-08-09commit 219b45d023...Thomas Zimmermann5 months drm-misc-fixes-2024-08-08commit 929725bd7e...Maxime Ripard5 months drm-misc-next-2024-08-01commit d97e71e449...Thomas Zimmermann6 months drm-misc-fixes-2024-08-01commit 9c685f6172...Maxime Ripard6 months drm-misc-next-fixes-2024-07-25commit b6f7d984eb...Maxime Ripard6 months drm-misc-next-fixes-2024-07-19commit 1fe1c66274...Maxime Ripard6 months drm-misc-next-fixes-2024-07-11commit c537fb4e3d...Maxime Ripard6 months drm-misc-fixes-2024-07-11commit cb520c3f36...Maarten Lankhorst6 months drm-misc-next-2024-07-04commit 896868eded...Maxime Ripard7 months drm-misc-fixes-2024-07-04commit d99fbd9aab...Maarten Lankhorst7 months drm-misc-next-2024-06-27commit 61bfcd1908...Maxime Ripard7 months drm-misc-fixes-2024-06-26commit 66edf3fb33...Maarten Lankhorst7 months drm-misc-next-2024-06-20commit b9578c4945...Maxime Ripard7 months drm-misc-fixes-2024-06-14commit 14731a640e...Maarten Lankhorst7 months drm-misc-next-2024-06-13commit a13aaf1574...Maxime Ripard7 months drm-misc-next-fixes-2024-06-07commit 539d33b578...Maarten Lankhorst7 months drm-misc-fixes-2024-06-07commit 5703fc058e...Maarten Lankhorst7 months drm-misc-next-2024-06-06commit 310ec03841...Maxime Ripard7 months drm-misc-fixes-2024-05-30-1commit bb19535880...Maarten Lankhorst8 months drm-misc-fixes-2024-05-30commit bb19535880...Thomas Zimmermann8 months drm-misc-next-2024-05-30commit 0c02cebc7f...Maxime Ripard8 months drm-misc-fixes-2024-05-23commit 39bc27bd68...Thomas Zimmermann8 months drm-misc-next-fixes-2024-05-23commit 5a507b7d2b...Maarten Lankhorst8 months drm-misc-next-fixes-2024-05-16commit 959314c438...Maarten Lankhorst8 months drm-misc-fixes-2024-05-16commit aed9a1a4f7...Thomas Zimmermann8 months drm-misc-fixes-2024-05-10commit 6897204ea3...Thomas Zimmermann8 months drm-misc-next-fixes-2024-05-08commit be3f304239...Maarten Lankhorst8 months drm-misc-fixes-2024-05-02commit da85f0aaa9...Thomas Zimmermann9 months drm-misc-next-2024-04-25commit 9e2b84fb6c...Maarten Lankhorst9 months drm-misc-fixes-2024-04-25commit 78d9161d2b...Thomas Zimmermann9 months drm-misc-next-2024-04-19commit 069a6c0e94...Maarten Lankhorst9 months drm-misc-fixes-2024-04-18commit 941c0bdbc1...Thomas Zimmermann9 months drm-misc-fixes-2024-04-11commit 4c08f01934...Thomas Zimmermann9 months drm-misc-next-2024-04-10commit 29b39672bc...Maarten Lankhorst9 months drm-misc-next-2024-04-05commit d1ef8fc18b...Maarten Lankhorst9 months drm-misc-fixes-2024-04-04commit fddf092738...Thomas Zimmermann10 months drm-misc-fixes-2024-03-28commit aba2a144c0...Thomas Zimmermann10 months drm-misc-next-2024-03-28commit 4b2d588d8a...Maarten Lankhorst10 months drm-misc-next-fixes-2024-03-21commit 5d4e8ae6e5...Thomas Zimmermann10 months drm-misc-next-2024-03-21-1commit 5e842d55ba...Maarten Lankhorst10 months drm-misc-next-fixes-2024-03-14commit 9dd81b2e1e...Thomas Zimmermann10 months drm-misc-next-fixes-2024-03-07commit 838f865802...Thomas Zimmermann10 months drm-misc-fixes-2024-03-07commit 4ece8fc439...Maxime Ripard10 months drm-misc-fixes-2024-02-29commit c70703320e...Maxime Ripard11 months drm-misc-next-fixes-2024-02-29commit 9cb3542aee...Thomas Zimmermann11 months drm-misc-next-2024-02-29commit 8df1ddb5bf...Thomas Zimmermann11 months drm-misc-fixes-2024-02-22commit 2aa6f5b0fd...Maxime Ripard11 months drm-misc-next-2024-02-22commit a3baaca4a8...Thomas Zimmermann11 months drm-misc-next-2024-02-15commit aa1267e673...Thomas Zimmermann11 months drm-misc-fixes-2024-02-15commit a64056bb5a...Maxime Ripard11 months drm-misc-next-2024-02-08commit 3ce7384048...Thomas Zimmermann11 months drm-misc-fixes-2024-02-08commit 5f8408aca6...Maxime Ripard11 months drm-misc-fixes-2024-02-01commit 1c1914d6e8...Maxime Ripard12 months drm-misc-fixes-2024-01-26commit 27d19268cf...Maxime Ripard12 months drm-misc-next-fixes-2024-01-19commit 1f1626ac04...Maxime Ripard12 months drm-misc-next-2024-01-11commit 502756e233...Thomas Zimmermann12 months drm-misc-next-fixes-2024-01-11commit 89fe46019a...Maxime Ripard12 months drm-misc-next-fixes-2024-01-04commit eee7068393...Maxime Ripard13 months drm-misc-fixes-2024-01-03commit 11f9eb899e...Maarten Lankhorst13 months drm-misc-next-fixes-2023-12-21commit 933a2a376f...Maxime Ripard13 months drm-misc-fixes-2023-12-14commit 6c9dbee84c...Maarten Lankhorst13 months drm-misc-next-2023-12-14commit b1a2aa9bcb...Maxime Ripard13 months drm-misc-fixes-2023-12-07commit e0f04e41e8...Maarten Lankhorst13 months drm-misc-next-2023-12-07commit 90d50b8d85...Maxime Ripard13 months drm-misc-next-2023-11-30commit 9ee33dc477...Maxime Ripard14 months drm-misc-fixes-2023-11-29commit fb18fe0fdf...Maarten Lankhorst14 months drm-misc-fixes-2023-11-23commit ab93edb2f9...Maarten Lankhorst14 months drm-misc-next-2023-11-23commit 815d8b0425...Maxime Ripard14 months drm-misc-next-2023-11-17commit 3b434a3445...Maxime Ripard14 months drm-misc-fixes-2023-11-16commit ae1aadb1eb...Maarten Lankhorst14 months drm-misc-fixes-2023-11-08commit 0e8b9f258b...Maarten Lankhorst14 months drm-misc-next-fixes-2023-11-02commit 94565e95e2...Maarten Lankhorst15 months drm-misc-fixes-2023-11-02commit 101c9f637e...Thomas Zimmermann15 months drm-misc-next-2023-10-27commit b70438004a...Maarten Lankhorst15 months drm-misc-fixes-2023-10-26commit b132ac51d7...Thomas Zimmermann15 months drm-misc-fixes-2023-10-19commit 8f5ad367e8...Thomas Zimmermann15 months drm-misc-next-2023-10-19commit 2d23e7d6ba...Maarten Lankhorst15 months drm-misc-fixes-2023-10-12commit c1165df2be...Thomas Zimmermann15 months drm-misc-next-2023-10-12commit c395c83aaf...Maarten Lankhorst15 months drm-misc-next-2023-10-06commit c1698c73f4...Maarten Lankhorst15 months drm-misc-fixes-2023-10-05commit d59e75eef5...Thomas Zimmermann16 months drm-misc-fixes-2023-09-28commit 645d694559...Thomas Zimmermann16 months drm-misc-next-2023-09-27commit 78f54469b8...Maarten Lankhorst16 months drm-misc-fixes-2023-09-21commit f75f71b2c4...Thomas Zimmermann16 months drm-misc-fixes-2023-09-14commit 139a27854b...Thomas Zimmermann16 months drm-misc-next-fixes-2023-09-11commit d20b484c67...Thomas Zimmermann16 months drm-misc-next-2023-09-11-1commit 15d30b4657...Maarten Lankhorst16 months drm-misc-fixes-2023-09-07commit 7583028d35...Maxime Ripard16 months drm-misc-next-fixes-2023-09-01commit 978474dc82...Thomas Zimmermann17 months drm-misc-next-fixes-2023-08-24commit cdf4100eaa...Thomas Zimmermann17 months drm-misc-fixes-2023-08-24commit f9e96bf190...Maxime Ripard17 months drm-misc-fixes-2023-08-17commit 50b6f2c829...Maxime Ripard17 months drm-misc-next-fixes-2023-08-17commit ff065eaf55...Thomas Zimmermann17 months drm-misc-next-2023-08-10commit 2799804ac6...Thomas Zimmermann17 months drm-misc-fixes-2023-08-10commit 07dd476f61...Maxime Ripard17 months drm-misc-next-2023-08-03commit a0769f25a3...Thomas Zimmermann18 months drm-misc-fixes-2023-08-03commit c71b7aa861...Maxime Ripard18 months drm-misc-next-2023-07-27commit 7c5aa94858...Thomas Zimmermann18 months drm-misc-fixes-2023-07-27commit 39b1320e5d...Maxime Ripard18 months drm-misc-next-2023-07-21commit d281eeaa4d...Maxime Ripard18 months drm-misc-fixes-2023-07-20commit ea293f823a...Maxime Ripard18 months drm-misc-next-2023-07-13commit 36672dda2e...Thomas Zimmermann18 months drm-misc-fixes-2023-07-13commit 835a65f517...Maxime Ripard18 months drm-misc-fixes-2023-07-07commit 00ae1491f9...Thomas Zimmermann18 months drm-misc-next-fixes-2023-07-06commit 59bba51ec2...Thomas Zimmermann19 months drm-misc-next-fixes-2023-06-29commit 861c249cd7...Thomas Zimmermann19 months drm-misc-fixes-2023-06-21commit 54d217406a...Maarten Lankhorst19 months drm-misc-fixes-2023-06-16commit 55b94bb8c4...Maarten Lankhorst19 months drm-misc-next-fixes-2023-06-15commit cf683e8870...Thomas Zimmermann19 months drm-misc-fixes-2023-06-08commit a3efabee58...Maarten Lankhorst19 months drm-misc-next-2023-06-07commit 13cdd12a9f...Thomas Zimmermann19 months drm-misc-next-2023-06-01commit 43049f17b5...Thomas Zimmermann20 months drm-misc-next-2023-05-24commit 4bd65789ba...Thomas Zimmermann20 months drm-misc-fixes-2023-05-24commit e997c218ad...Maarten Lankhorst20 months drm-misc-fixes-2023-05-11commit 2da5bffe9e...Maarten Lankhorst20 months drm-misc-next-2023-05-11commit 4795c78768...Maxime Ripard20 months drm-misc-next-fixes-2023-04-26commit a50be876f4...Maarten Lankhorst21 months drm-misc-fixes-2023-04-26commit 0d68683838...Maarten Lankhorst21 months drm-misc-fixes-2023-04-20-2commit b63a553e8f...Thomas Zimmermann21 months drm-misc-fixes-2023-04-20-1commit b63a553e8f...Thomas Zimmermann21 months drm-misc-fixes-2023-04-20commit b63a553e8f...Thomas Zimmermann21 months drm-misc-fixes-2023-04-13commit 5603effb82...Thomas Zimmermann21 months drm-misc-next-2023-04-12commit fd35174e13...Maarten Lankhorst21 months drm-misc-next-2023-04-06commit e44f18c6ff...Maarten Lankhorst21 months drm-misc-fixes-2023-04-05commit 0ec8671837...Thomas Zimmermann22 months drm-misc-next-2023-03-31commit 7d690f936e...Maarten Lankhorst22 months drm-misc-fixes-2023-03-30commit 25bbe844ef...Thomas Zimmermann22 months drm-misc-next-2023-03-23commit 4ab9157c7e...Maarten Lankhorst22 months drm-misc-fixes-2023-03-23commit 1a70ca89d5...Thomas Zimmermann22 months drm-misc-next-2023-03-16commit b24343eace...Maarten Lankhorst22 months drm-misc-fixes-2023-03-16commit 4028cbf867...Thomas Zimmermann22 months drm-misc-next-2023-03-07commit 9228742caf...Maarten Lankhorst22 months drm-misc-next-fixes-2023-02-28commit 047a754558...Thomas Zimmermann23 months drm-misc-next-2023-02-23commit 95d39a0c64...Maarten Lankhorst23 months drm-misc-fixes-2023-02-23commit 1b9b4f922f...Maxime Ripard23 months drm-misc-next-fixes-2023-02-21commit 3fb1f62f80...Thomas Zimmermann23 months drm-misc-next-fixes-2023-02-16commit 38b2d8efd0...Thomas Zimmermann23 months drm-misc-fixes-2023-02-16commit a950b989ea...Maxime Ripard23 months drm-misc-next-fixes-2023-02-09commit 467fbc77f6...Thomas Zimmermann23 months drm-misc-fixes-2023-02-09commit 85e26dd510...Maxime Ripard23 months drm-misc-fixes-2023-02-02commit a3ee9e0b57...Maxime Ripard24 months drm-misc-next-fixes-2023-02-02commit 84cc4c7aec...Thomas Zimmermann24 months drm-misc-fixes-2023-01-26commit d6591da5f3...Maxime Ripard24 months drm-misc-next-2023-01-26commit 6ca80b9e5c...Thomas Zimmermann24 months drm-misc-next-2023-01-24commit 51affef35b...Thomas Zimmermann24 months drm-misc-next-2023-01-19commit bd43a9844b...Thomas Zimmermann2 years drm-misc-fixes-2023-01-19commit 2293a73ad4...Maxime Ripard2 years drm-misc-fixes-2023-01-12commit 5640e81607...Maxime Ripard2 years drm-misc-next-2023-01-12commit 6e41acd2e5...Thomas Zimmermann2 years drm-misc-fixes-2023-01-05commit 69555549cf...Maxime Ripard2 years drm-misc-next-fixes-2023-01-03commit 03dec92c4f...Maxime Ripard2 years drm-misc-next-2023-01-03commit 2591939e88...Thomas Zimmermann2 years drm-misc-fixes-2022-12-22commit 4217c6ac81...Maxime Ripard2 years drm-misc-fixes-2022-12-08commit 6e90293618...Maarten Lankhorst2 years drm-misc-next-fixes-2022-12-08commit b02897e56b...Maxime Ripard2 years drm-misc-fixes-2022-11-30commit ed14d225cc...Maarten Lankhorst2 years drm-misc-fixes-2022-11-24commit a6a00d7e8f...Maarten Lankhorst2 years drm-misc-next-2022-11-24commit 6fb6c979ca...Maxime Ripard2 years drm-misc-fixes-2022-11-17commit 5954acbacb...Maarten Lankhorst2 years drm-misc-next-2022-11-17commit 35c3a2d02f...Maxime Ripard2 years drm-misc-next-2022-11-10-1commit 6b818c533d...Maxime Ripard2 years drm-misc-next-2022-11-10commit 6b818c533d...Maxime Ripard2 years drm-misc-fixes-2022-11-09commit f352262f72...Maarten Lankhorst2 years drm-misc-next-2022-11-03commit ce28ab1380...Maxime Ripard2 years drm-misc-fixes-2022-11-02-1commit fc007fb815...Maarten Lankhorst2 years drm-misc-fixes-2022-10-27commit e0ba1a39b8...Maarten Lankhorst2 years drm-misc-next-2022-10-27commit e1e7bc481d...Maxime Ripard2 years drm-misc-fixes-2022-10-20commit 72655fb942...Maarten Lankhorst2 years drm-misc-next-2022-10-20commit 7c99616e3f...Maxime Ripard2 years drm-misc-fixes-2022-10-13commit 4190e8bbcb...Thomas Zimmermann2 years drm-misc-next-2022-09-30commit c9b48b91e2...Maarten Lankhorst2 years drm-misc-fixes-2022-09-29commit cc62d98bd5...Thomas Zimmermann2 years drm-misc-next-2022-09-23commit 39dd0cc2e5...Maxime Ripard2 years drm-misc-fixes-2022-09-22commit d8a79c0305...Thomas Zimmermann2 years drm-misc-fixes-2022-09-15commit b0b9408f13...Thomas Zimmermann2 years drm-misc-next-2022-09-09commit 5d832b6694...Maarten Lankhorst2 years drm-misc-fixes-2022-09-08commit d76034a427...Thomas Zimmermann2 years drm-misc-fixes-2022-08-31commit a3f7c10a26...Thomas Zimmermann2 years drm-misc-fixes-2022-08-25commit 6b04ce966a...Thomas Zimmermann2 years drm-misc-next-2022-08-20-1commit 8869fa666a...Maarten Lankhorst2 years drm-misc-fixes-2022-08-16commit 82a1356a93...Maxime Ripard2 years drm-misc-next-fixes-2022-08-10commit 2939deac1f...Thomas Zimmermann2 years drm-misc-fixes-2022-07-29commit 66cee9097e...Maxime Ripard2 years drm-misc-fixes-2022-07-28commit 0c09bc33aa...Maxime Ripard2 years drm-misc-fixes-2022-07-21commit 02c87df248...Maxime Ripard3 years drm-misc-next-fixes-2022-07-21commit 6f2c8d5f16...Thomas Zimmermann3 years drm-misc-next-fixes-2022-07-14commit 7d09c76063...Thomas Zimmermann3 years drm-misc-fixes-2022-07-14commit 925b6e5913...Maxime Ripard3 years drm-misc-fixes-2022-07-07-1commit b68277f19e...Maxime Ripard3 years drm-misc-next-2022-07-07commit 3915f8bdde...Thomas Zimmermann3 years drm-misc-fixes-2022-06-30commit ee7a69aa38...Maxime Ripard3 years drm-misc-next-2022-06-30commit 6fb5ee7cec...Thomas Zimmermann3 years drm-misc-next-2022-06-23commit 009a3a5279...Thomas Zimmermann3 years drm-misc-fixes-2022-06-23commit 85016f66af...Maxime Ripard3 years drm-misc-next-2022-06-17commit e4a8864f74...Thomas Zimmermann3 years drm-misc-fixes-2022-06-16commit 0f9cd1ea10...Maxime Ripard3 years drm-misc-fixes-2022-06-09commit 477277c7fd...Maxime Ripard3 years drm-misc-next-2022-06-08commit dfa687bffc...Thomas Zimmermann3 years drm-misc-fixes-2022-05-26commit 6e516faf04...Maxime Ripard3 years drm-misc-fixes-2022-05-20commit 6e03b13cc7...Maxime Ripard3 years drm-misc-next-fixes-2022-05-19commit 5ee8c8f930...Maxime Ripard3 years drm-misc-fixes-2022-05-13commit 6fed53de56...Maxime Ripard3 years drm-misc-fixes-2022-05-05commit 841e512ffb...Maarten Lankhorst3 years drm-misc-next-2022-05-05commit 6071c4c2a3...Maxime Ripard3 years drm-misc-next-2022-04-28commit e08a99d005...Maxime Ripard3 years drm-misc-fixes-2022-04-27commit dc3ae06c5f...Maarten Lankhorst3 years drm-misc-fixes-2022-04-22commit 94f4c4965e...Maxime Ripard3 years drm-misc-next-2022-04-21commit 40d8d4bd06...Maxime Ripard3 years drm-misc-next-2022-04-14commit 9d79799193...Maxime Ripard3 years drm-misc-fixes-2022-04-07commit 1ecc0c09f1...Maarten Lankhorst3 years drm-misc-next-fixes-2022-04-07commit 67bae5f28c...Maarten Lankhorst3 years drm-misc-next-2022-04-07commit c8d4c18bfb...Maxime Ripard3 years drm-misc-next-fixes-2022-03-24-1commit 7344bad7fb...Maarten Lankhorst3 years drm-misc-next-fixes-2022-03-24commit 7344bad7fb...Maarten Lankhorst3 years drm-misc-fixes-2022-03-24commit d14eb80e27...Thomas Zimmermann3 years drm-misc-fixes-2022-03-17commit 3c3384050d...Thomas Zimmermann3 years drm-misc-fixes-2022-03-10commit 9470c29faa...Thomas Zimmermann3 years drm-misc-fixes-2022-03-03commit 62929726ef...Thomas Zimmermann3 years drm-misc-next-2022-03-03commit 701920ca98...Maarten Lankhorst3 years drm-misc-fixes-2022-02-23commit ecbd4912a6...Thomas Zimmermann3 years drm-misc-next-2022-02-23commit f915686bd9...Maarten Lankhorst3 years drm-misc-fixes-2022-02-17commit 439cf34c8e...Thomas Zimmermann3 years