mirror of
https://github.com/torvalds/linux.git
synced 2026-08-01 12:11:59 +02:00
leds: leds-qti-flash: update locking used for trigger iteration
Commit 2a5a8fa8b2 ("leds: trigger: use RCU to protect the
led_cdevs list") changed the locking mechanism for the led_cdevs
list. Update the locking in the leds-qti-flash driver to match.
Change-Id: I54b044052134b29f56cbf18ad2d37832d89eba55
Signed-off-by: David Collins <quic_collinsd@quicinc.com>
This commit is contained in:
parent
17ef00fb6d
commit
d356880fb9
|
|
@ -1,7 +1,7 @@
|
|||
// SPDX-License-Identifier: GPL-2.0-only
|
||||
/*
|
||||
* Copyright (c) 2016-2021, The Linux Foundation. All rights reserved.
|
||||
* Copyright (c) 2021 Qualcomm Innovation Center, Inc. All rights reserved.
|
||||
* Copyright (c) 2021-2022 Qualcomm Innovation Center, Inc. All rights reserved.
|
||||
*/
|
||||
#define pr_fmt(fmt) "qti-flash: %s: " fmt, __func__
|
||||
|
||||
|
|
@ -819,15 +819,15 @@ static struct led_classdev *trigger_to_lcdev(struct led_trigger *trig)
|
|||
{
|
||||
struct led_classdev *led_cdev;
|
||||
|
||||
read_lock(&trig->leddev_list_lock);
|
||||
list_for_each_entry(led_cdev, &trig->led_cdevs, trig_list) {
|
||||
rcu_read_lock();
|
||||
list_for_each_entry_rcu(led_cdev, &trig->led_cdevs, trig_list) {
|
||||
if (!strcmp(led_cdev->default_trigger, trig->name)) {
|
||||
read_unlock(&trig->leddev_list_lock);
|
||||
rcu_read_unlock();
|
||||
return led_cdev;
|
||||
}
|
||||
}
|
||||
rcu_read_unlock();
|
||||
|
||||
read_unlock(&trig->leddev_list_lock);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user