mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Mark Brown <broonie@kernel.org>
To: Baolin Wang <baolin.wang@linaro.org>
Cc: linux-kernel@vger.kernel.org, Mark Brown <broonie@kernel.org>
Subject: [PATCH 2/2] regmap: Clean up hwspinlock on regmap exit
Date: Fri,  3 Nov 2017 20:08:51 +0000	[thread overview]
Message-ID: <20171103200851.10215-2-broonie@kernel.org> (raw)
In-Reply-To: <20171103200851.10215-1-broonie@kernel.org>

We should free any hwspinlocks when we destroy the regmap, do so.

Signed-off-by: Mark Brown <broonie@kernel.org>
---
 drivers/base/regmap/regmap.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/base/regmap/regmap.c b/drivers/base/regmap/regmap.c
index 5ff549fa880b..bfe2f250d011 100644
--- a/drivers/base/regmap/regmap.c
+++ b/drivers/base/regmap/regmap.c
@@ -1305,6 +1305,8 @@ void regmap_exit(struct regmap *map)
 		kfree(async->work_buf);
 		kfree(async);
 	}
+	if (IS_ENABLED(REGMAP_HWSPINLOCK) && map->hwlock)
+		hwspin_lock_free(map->hwlock);
 	kfree(map);
 }
 EXPORT_SYMBOL_GPL(regmap_exit);
-- 
2.15.0

  reply	other threads:[~2017-11-03 20:08 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-11-03 20:08 [PATCH 1/2] regmap: Also protect hwspinlock in error handling path Mark Brown
2017-11-03 20:08 ` Mark Brown [this message]
2017-11-03 20:17   ` Applied "regmap: Clean up hwspinlock on regmap exit" to the regmap tree Mark Brown
2017-11-03 20:17 ` Applied "regmap: Also protect hwspinlock in error handling path" " Mark Brown

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20171103200851.10215-2-broonie@kernel.org \
    --to=broonie@kernel.org \
    --cc=baolin.wang@linaro.org \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

Powered by JetHome