summaryrefslogtreecommitdiffstats
path: root/drivers/counter
diff options
context:
space:
mode:
authorBiju Das <biju.das.jz@bp.renesas.com>2023-07-25 17:46:11 +0200
committerWilliam Breathitt Gray <william.gray@linaro.org>2023-08-16 15:41:29 +0200
commit39266b642ccdc154b48eae11263920956fa0e89e (patch)
tree76ab172266bf558ce3c707f9a0581b9f28acf743 /drivers/counter
parentDocumentation: ABI: sysfs-bus-counter: Fix indentation (diff)
downloadlinux-39266b642ccdc154b48eae11263920956fa0e89e.tar.xz
linux-39266b642ccdc154b48eae11263920956fa0e89e.zip
counter: rz-mtu3-cnt: Reorder locking sequence for consistency
All functions except rz_mtu3_count_enable_write(), call pm_runtime_{get,put} inside the lock. For consistency do the same here. Reported-by: Pavel Machek <pavel@denx.de> Closes: https://lore.kernel.org/r/ZH8Fmom8vZ4DwxqA@duo.ucw.cz Signed-off-by: Biju Das <biju.das.jz@bp.renesas.com> Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be> Link: https://lore.kernel.org/r/20230725154611.227556-1-biju.das.jz@bp.renesas.com/ Signed-off-by: William Breathitt Gray <william.gray@linaro.org>
Diffstat (limited to 'drivers/counter')
-rw-r--r--drivers/counter/rz-mtu3-cnt.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/counter/rz-mtu3-cnt.c b/drivers/counter/rz-mtu3-cnt.c
index 48c83933aa2f..ee821493b166 100644
--- a/drivers/counter/rz-mtu3-cnt.c
+++ b/drivers/counter/rz-mtu3-cnt.c
@@ -500,8 +500,8 @@ static int rz_mtu3_count_enable_write(struct counter_device *counter,
int ret = 0;
if (enable) {
- pm_runtime_get_sync(ch->dev);
mutex_lock(&priv->lock);
+ pm_runtime_get_sync(ch->dev);
ret = rz_mtu3_initialize_counter(counter, count->id);
if (ret == 0)
priv->count_is_enabled[count->id] = true;
@@ -510,8 +510,8 @@ static int rz_mtu3_count_enable_write(struct counter_device *counter,
mutex_lock(&priv->lock);
rz_mtu3_terminate_counter(counter, count->id);
priv->count_is_enabled[count->id] = false;
- mutex_unlock(&priv->lock);
pm_runtime_put(ch->dev);
+ mutex_unlock(&priv->lock);
}
return ret;