From 67da3d33f3df328f89780bc0c79e1620dc47267a Mon Sep 17 00:00:00 2001 From: Rosen Penev Date: Thu, 31 Oct 2024 12:22:04 -0700 Subject: [PATCH] lantiq: use devm for mutex_init MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit It's common to avoid calling mutex_destroy when done. It's not correct strictly speaking. Signed-off-by: Rosen Penev Link: https://github.com/openwrt/openwrt/pull/16832 Signed-off-by: Hauke Mehrtens (cherry picked from commit fccff963c0a6ba035455daea61566f4d121643e3) Link: https://github.com/openwrt/openwrt/pull/17097 Signed-off-by: Petr Å tetiar --- .../0008-MIPS-lantiq-backport-old-timer-code.patch | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/target/linux/lantiq/patches-6.6/0008-MIPS-lantiq-backport-old-timer-code.patch b/target/linux/lantiq/patches-6.6/0008-MIPS-lantiq-backport-old-timer-code.patch index 81bf72913b..a396efd990 100644 --- a/target/linux/lantiq/patches-6.6/0008-MIPS-lantiq-backport-old-timer-code.patch +++ b/target/linux/lantiq/patches-6.6/0008-MIPS-lantiq-backport-old-timer-code.patch @@ -186,7 +186,7 @@ Signed-off-by: John Crispin obj-y += vmmc.o --- /dev/null +++ b/arch/mips/lantiq/xway/timer.c -@@ -0,0 +1,886 @@ +@@ -0,0 +1,888 @@ +#ifndef CONFIG_SOC_AMAZON_SE + +#include @@ -989,7 +989,9 @@ Signed-off-by: John Crispin + ltq_w32(0xfff, LQ_GPTU_IRNCR); + + memset(&timer_dev, 0, sizeof(timer_dev)); -+ mutex_init(&timer_dev.gptu_mutex); ++ ret = devm_mutex_init(&pdev->dev, &timer_dev.gptu_mutex); ++ if (ret) ++ return ret; + + lq_enable_gptu(); + timer_dev.number_of_timers = GPTU_ID_CFG * 2; -- 2.30.2