Merge tag 'iio-fixes-for-5.19a' of https://git.kernel.org/pub/scm/linux/kernel/git...
[platform/kernel/linux-rpi.git] / drivers / iio / trigger / iio-trig-sysfs.c
index 3d911c2..d6c5e96 100644 (file)
@@ -176,16 +176,15 @@ out1:
 
 static int iio_sysfs_trigger_remove(int id)
 {
-       bool foundit = false;
-       struct iio_sysfs_trig *t;
+       struct iio_sysfs_trig *t = NULL, *iter;
 
        mutex_lock(&iio_sysfs_trig_list_mut);
-       list_for_each_entry(t, &iio_sysfs_trig_list, l)
-               if (id == t->id) {
-                       foundit = true;
+       list_for_each_entry(iter, &iio_sysfs_trig_list, l)
+               if (id == iter->id) {
+                       t = iter;
                        break;
                }
-       if (!foundit) {
+       if (!t) {
                mutex_unlock(&iio_sysfs_trig_list_mut);
                return -EINVAL;
        }