Merge tag 'iio-fixes-for-5.19a' of https://git.kernel.org/pub/scm/linux/kernel/git...
[linux-2.6-microblaze.git] / drivers / hwtracing / coresight / coresight-cpu-debug.c
index 8845ec4..1874df7 100644 (file)
@@ -380,9 +380,10 @@ static int debug_notifier_call(struct notifier_block *self,
        int cpu;
        struct debug_drvdata *drvdata;
 
-       mutex_lock(&debug_lock);
+       /* Bail out if we can't acquire the mutex or the functionality is off */
+       if (!mutex_trylock(&debug_lock))
+               return NOTIFY_DONE;
 
-       /* Bail out if the functionality is disabled */
        if (!debug_enable)
                goto skip_dump;
 
@@ -401,7 +402,7 @@ static int debug_notifier_call(struct notifier_block *self,
 
 skip_dump:
        mutex_unlock(&debug_lock);
-       return 0;
+       return NOTIFY_DONE;
 }
 
 static struct notifier_block debug_notifier = {